pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Make prometheus as optional dependency

Open kumarlokesh opened this issue 7 months ago • 1 comments

Fixes #560.

Change summary:

  1. Made the prometheus dependency optional in Cargo.toml
  2. Added a new feature flag called prometheus in the [features] section of the Cargo.toml
  3. Added #[cfg(feature = "prometheus")] attributes to all Prometheus-related code
  4. Updated documentation

kumarlokesh avatar May 12 '25 07:05 kumarlokesh

I'm not a project member, this comment is FWIW.

It should be in a separate crate (like pingora-prometheus, pingora-extras or something), not optional: nothing in pingora-core depends on prometheus, except single file prometheus_http_app.rs. Features complicate dependency trees, introduce compilation errors due to being hard to test all permutation of features, make compilation slower.

stepancheg avatar Oct 22 '25 22:10 stepancheg