-
-
Notifications
You must be signed in to change notification settings - Fork 59
fixes before release #334
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
fixes before release #334
Changes from all commits
2c9f520
2a60f21
e692afc
9a4db64
3108365
3282314
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -281,10 +281,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||
| Log export can be toggled at runtime via `.with_logs(bool)`: | ||||||
|
|
||||||
| ```rust,no_run | ||||||
| use init_tracing_opentelemetry::TracingConfig; | ||||||
| //... | ||||||
| TracingConfig::default() | ||||||
| .with_logs(false) // disable log export (default: enabled when feature is active) | ||||||
| .init_subscriber()?; | ||||||
| .init_subscriber() | ||||||
| .expect("valid tracing configuration"); | ||||||
| ``` | ||||||
| > Traces are automatically attached to logs as well, so if the logs are queried in Grafana (for example), the trace automatically links to the log line. | ||||||
|
|
||||||
|  | ||||||
|
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. Consider using a relative path for the image link. This ensures the image displays correctly when viewing the README on different branches or forks of the repository, and is generally more robust than an absolute URL to the
Suggested change
Owner
Author
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. except when the README is imported into a documentation system (crates.io, docs.rs) that only retreive the project repository, not the full repo |
||||||
|
|
||||||
| Configure the following environment variables to control the logs exporter (in addition to the shared variables 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.
The
Guardreturned byinit_subscriber()must be assigned to a variable (e.g.,let _guard = ...) to ensure it remains in scope for the duration of the application. If the guard is dropped immediately (as in this example), the tracing subscriber and OpenTelemetry exporters will be shut down, and pending traces or logs may not be flushed. Note that theGuardstruct is annotated with#[must_use]to help prevent this mistake.