Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscriber: allow disabling tonic's "transport" feature #333

Open
hawkw opened this issue Apr 14, 2022 · 6 comments
Open

subscriber: allow disabling tonic's "transport" feature #333

hawkw opened this issue Apr 14, 2022 · 6 comments
Labels
C-subscriber Crate: console-subscriber. S-feature Severity: feature. This is adding a new feature.

Comments

@hawkw
Copy link
Member

hawkw commented Apr 14, 2022

What problem are you trying to solve?

Currently, console-subscriber enables tonic's "transport" feature flag unconditionally. This feature flag pulls in a relatively large set of additional dependencies, including axum (used for routing). This feature is necessary to enable some of the one-stop serve methods on the Server struct.

However, Server also implements the tonic-generated Instrument trait for the gRPC bindings. In some use-cases, users may want to bind the API to an endpoint themselves, rather than using tonic's "transport" feature. It's possible to do this now using the Server type's other trait implementations...but users who do this will still be pulling in a bunch of code they don't actually use.

How should the problem be solved?

We should make it possible to disable tonic/transport. We could feature-flag the APIs that require transport, and make them depend on a "transport" feature flag on console-subscriber.

Any alternatives you've considered?

We may additionally want to look into using tonic's "channel" feature flag, a subset of "transport" that doesn't depend on axum. I think we can probably do this because the serve and serve_with methods don't serve multiple gRPC APIs on the same port, and don't need routing?

How would users interact with this feature?

No response

Would you like to work on this feature?

maybe

@hawkw hawkw added S-feature Severity: feature. This is adding a new feature. C-subscriber Crate: console-subscriber. labels Apr 14, 2022
@hawkw
Copy link
Member Author

hawkw commented Apr 14, 2022

(@LucioFranco might have advice on this?)

@LucioFranco
Copy link
Member

LucioFranco commented Apr 15, 2022

I think having a transport feature makes sense. The feature was added for use cases like this. The channel one is just there if you do client only interaction.

@hawkw
Copy link
Member Author

hawkw commented Apr 15, 2022

Oh, okay, so it seems like the tokio-console crate (purely a client) should use the channel feature, rather than transport?

@devanbenz
Copy link
Contributor

Is this issue still prevalent? Would love to take it on if so.

@dan-da
Copy link

dan-da commented Nov 2, 2024

+1. I came here looking for a way to avoid pulling in axum, etc to my codebase that uses console-subscriber. I was rather surprised to see the huge dependency list in cargo tree.

@hds
Copy link
Collaborator

hds commented Nov 4, 2024

@dan-da Not really much to say here except that pulling in Tonic / Axum, plus a number of other crates for specific features or use cases all adds up. If you have suggestions for reducing this that would be interesting, but a top priority is maintainability, and adding a lot more code to console-subscriber rather than depending on external crates usually reduces maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-subscriber Crate: console-subscriber. S-feature Severity: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

5 participants