-
Notifications
You must be signed in to change notification settings - Fork 186
Improve Doc to Make the Tracing Context Example #575 #583
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
base: main
Are you sure you want to change the base?
Improve Doc to Make the Tracing Context Example #575 #583
Conversation
99380f8
to
71f9bf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, these changes don't actually compile when trying to run the doctests.
You'll need to add some of these dependencies to [dev-dependencies]
and potentially update the enabled feature flags for some of the existing dev dependencies.
You can run cargo test -p metrics-tracing-context --doc
locally to execute the tests while fixing the dependencies to ensure they're passing before requesting another review.
metrics-tracing-context/src/lib.rs
Outdated
//! use metrics_tracing_context::MetricsLayer; | ||
//! use metrics_tracing_context::TracingContextLayer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! use metrics_tracing_context::MetricsLayer; | |
//! use metrics_tracing_context::TracingContextLayer; | |
//! use metrics_tracing_context::{MetricsLayer, TracingContextLayer}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @tobz.
I will fix the ci, if other changes are ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added dependencies, but I still got the following error:
---- metrics-tracing-context/src/lib.rs - (line 11) stdout ----
error[E0277]: the trait bound `PrometheusRecorder: Recorder` is not satisfied
--> metrics-tracing-context/src/lib.rs:32:30
|
24 | metrics::set_global_recorder(recorder).unwrap();
| ---------------------------- ^^^^^^^^ the trait `Recorder` is not implemented for `PrometheusRecorder`
I've failed to understand why as Recorder as implemented for PrometheusRecorder and all dependencies seems up to date.
metrics-tracing-context/Cargo.toml
Outdated
tracing-subscriber = { workspace = true, features = ["registry"] } | ||
tracing-subscriber = { workspace = true, features = ["registry", "fmt"] } | ||
tokio = { workspace = true } | ||
metrics-exporter-prometheus = { version = "0.17.0", features = ["http-listener", "hyper", "hyper-util"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to be a path dependency (see metrics-util
above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is. I can't get why :)
Thank you.
Improve Doc to Make the Tracing Context Example ready to use out of the Box.
Please refer to issue #575