-
Notifications
You must be signed in to change notification settings - Fork 31
Add support for the prometheus-client
crate
#88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b255f8c
7cbe053
ff161ea
9e402eb
f29aae1
11d052f
9817601
8635ad7
8130657
49410dc
537553e
ecfe52f
e311510
ad830c3
4406f08
43bea12
36f65e2
fb34b11
8f263f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,9 +186,21 @@ pub use autometrics_macros::ResultLabels; | |
#[cfg(feature = "prometheus-exporter")] | ||
pub use self::prometheus_exporter::*; | ||
|
||
/// Functionality specific to the libraries used to collect metrics | ||
pub mod integrations { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still not sure I like this name, but I can't think of anything better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. couldn't we just put the integrations as the top level name, getting rid of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm that would also be an option. The main downside with that is we may want some other submodules exported from the crate root that are different, and they could get a bit lost. For example #90. We'd have 4-5 modules that are all related to the metrics libraries and 1-2 that aren't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems fine imo |
||
#[cfg(feature = "prometheus-client")] | ||
pub mod prometheus_client { | ||
pub use crate::tracker::prometheus_client::REGISTRY; | ||
} | ||
} | ||
|
||
/// We use the histogram buckets recommended by the OpenTelemetry specification | ||
/// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation | ||
#[cfg(any(feature = "prometheus", feature = "prometheus-exporter"))] | ||
#[cfg(any( | ||
feature = "prometheus", | ||
feature = "prometheus-client", | ||
feature = "prometheus-exporter" | ||
))] | ||
pub(crate) const HISTOGRAM_BUCKETS: [f64; 14] = [ | ||
0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, | ||
]; | ||
|
Uh oh!
There was an error while loading. Please reload this page.