open-telemetry / opentelemetry-rust

The Rust OpenTelemetry implementation
https://opentelemetry.io
Apache License 2.0
1.85k stars 431 forks source link

Otlp requires `full` feature from Tokio #747

Closed neoeinstein closed 2 years ago

neoeinstein commented 2 years ago

The opentelemetry-otlp, opentelemetry-aws, opentelemetry-prometheus, and opentelemetry-zpages crates in this repository consistently require full features from Tokio and Hyper, even if they are not needed by those crates. Only otlp specifies this requirement as a non-dev-dependency.

Using full in libraries results in added compile times for those crates and binaries that do not require these features, and goes counter to the reason that the tokio and hyper crates expose these features. Instead, each crate should only be requesting the tokio or hyper features that it actually requires.

Based on my initial inspection:

There are a variety of examples that also declare that they need "full" options, but these may not be as much of an issue except insofar as they make it harder to determine the actual minimal set of features required.

TommyCpp commented 2 years ago

Make sense. We should definitely try to use as few features as possible.

djc commented 2 years ago

@neoeinstein good find! Would you be able to submit a PR for this?

neoeinstein commented 2 years ago

Added a PR that should resolve this.