Skip to content

Disable default features of metrics-exporter-prometheus - #68

Open
farnyser wants to merge 1 commit into
chainbound:mainfrom
farnyser:mep-no-default-features
Open

Disable default features of metrics-exporter-prometheus#68
farnyser wants to merge 1 commit into
chainbound:mainfrom
farnyser:mep-no-default-features

Conversation

@farnyser

Copy link
Copy Markdown

Summary

Disable default features of metrics-exporter-prometheus in the summary feature.

The summary feature only uses metrics_exporter_prometheus::Distribution and DistributionBuilder (in prometric/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-listener and push-gateway. push-gateway pulls in hyper-rustls with the hardcoded aws-lc-rs feature, which forces aws-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 the exporter feature).

With default-features = false, cargo tree -i aws-lc-sys and cargo tree -i hyper-rustls in this workspace both come back empty.

Changes

  • metrics-exporter-prometheus = { version = "0.17.2", optional = true, default-features = false }
  • Regenerated 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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant