Disable default features of metrics-exporter-prometheus - #68
Open
farnyser wants to merge 1 commit into
Open
Conversation
The summary feature only uses Distribution and DistributionBuilder, which are available without any m-e-p features. The default features (http-listener, push-gateway) pull in hyper, hyper-rustls and aws-lc-sys, adding significant build time for every consumer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Disable default features of
metrics-exporter-prometheusin thesummaryfeature.The
summaryfeature only usesmetrics_exporter_prometheus::DistributionandDistributionBuilder(inprometric/src/summary/rolling.rs), which are exported unconditionally — they don't require any m-e-p feature.However, m-e-p's default features are
http-listenerandpush-gateway.push-gatewaypulls inhyper-rustlswith the hardcodedaws-lc-rsfeature, which forcesaws-lc-sys(and its slow C/asm build, roughly a minute of extra clean-build time) into every downstream consumer of prometric — even though prometric never uses the push gateway or m-e-p's HTTP listener (it ships its own hyper-based exporter behind theexporterfeature).With
default-features = false,cargo tree -i aws-lc-sysandcargo tree -i hyper-rustlsin this workspace both come back empty.Changes
metrics-exporter-prometheus = { version = "0.17.2", optional = true, default-features = false }Cargo.lock(drops ~90 now-unused transitive packages)Testing
cargo build --all-features✅cargo test --all-features✅ (all unit + doc tests pass)cargo tree -i aws-lc-sys→ no longer in the dependency graph ✅🤖 Generated with Claude Code