-
Notifications
You must be signed in to change notification settings - Fork 597
Description
Discussed in #3191
Originally posted by houseme October 3, 2025
Summary
The internal-logs feature in the opentelemetry-otlp crate currently enables "opentelemetry-http/internal-logs". However, since opentelemetry-http itself depends on "opentelemetry/internal-logs", this indirection introduces an unnecessary dependency on opentelemetry-http when using grpc-tonic without default or http features.
Current Behavior
In opentelemetry-otlp/Cargo.toml:
[features]
internal-logs = ["tracing", "opentelemetry_sdk/internal-logs", "opentelemetry-http/internal-logs"]This forces users to depend on opentelemetry-http even when:
- Using
grpc-tonictransport - Not using
httpordefaultfeatures - Only needing
internal-logsfunctionality
Proposed Change
Directly depend on "opentelemetry/internal-logs" instead:
[features]
internal-logs = ["tracing", "opentelemetry_sdk/internal-logs", "opentelemetry/internal-logs"]Benefits
- Eliminates unnecessary dependencies
Removes forcedopentelemetry-httpdependency forgrpc-tonicusers - Aligns with dependency hierarchy
Sinceopentelemetry-httpalready depends onopentelemetry/internal-logs, this change respects the existing dependency chain - Improves compile times
Particularly for projects usinggrpc-tonicwithdefault-features = false - Maintains compatibility
No breaking changes - all existing functionality preserved
Verification Steps
- Check
opentelemetry-http/Cargo.tomlconfirms:[features] internal-logs = ["opentelemetry/internal-logs"]
- Test with:
Should not pull
opentelemetry-otlp = { version = "*", default-features = false, features = ["grpc-tonic", "internal-logs"] }
opentelemetry-http
Additional Context
This micro-optimization supports the project's goal of maintaining a lean dependency tree, especially important for users carefully managing their dependency footprint in performance-sensitive applications.
Would you like me to submit a PR for this change?
I can prepare a minimal PR updating the feature flag if the maintainers agree this is a welcome optimization.