-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add client_requests timing module to metrics (#802)
* Add client_requests timing module to metrics - Add a timing span to anything that can be instrumented and returns a Result. Example: ```ignore let client = GatewayClient::new(channel); client.info(req) .with_timing("iot_fetch_info") .await?; ``` This will result in a prometheus metric >> client_request_duration_seconds{name = "iot_fetch_info", quantile="xxx"} - Install the `ApiTimingLayer`. Adding `.with_span_events(FmtSpan::CLOSE)` to a regular format layer will print the timing spans to stdout as well. Example: ```ignore tracing_subscriber::registry() .with(tracing_subscriber::fmt::layer().with_span_events(FmtSpan::CLOSE)) .with(metrics::client_requests::client_request_timing_layer("histogram_name")) .init(); ``` - Remove unused `install_metrics` function, replace with nested `install` function that `start_metrics` delegates to. This allows us to start metrics in tests without needing to make a `Settings` struct. * Update metrics (#805) * Update metrics crate Also bumps metrics-exporter-prometheus. The biggest change from 0.21 -> 0.22 is in this PR metrics-rs/metrics#394 * allow for versions greater than 0.22 this may change if the api to metrics changes _again_ before a major version. * make string values consts Makes the values hide a little bit less in the code
- Loading branch information
1 parent
d29595c
commit 2531d93
Showing
31 changed files
with
440 additions
and
152 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.