-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Datadog Rust SDK #32629
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: master
Are you sure you want to change the base?
Datadog Rust SDK #32629
Conversation
Preview links (active after the
|
content/en/tracing/trace_collection/trace_context_propagation/_index.md
Outdated
Show resolved
Hide resolved
…_index.md Co-authored-by: Edmund Kump <ekump@mac.com>
| fn do_work() { | ||
| let tracer = global::tracer("my-component"); | ||
|
|
||
| tracer.in_span("operation_name", |span| { |
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.
| tracer.in_span("operation_name", |span| { | |
| tracer.in_span("operation_name", |cx| { |
All the in_span calls have a context as parameter, and not a span.
|
|
||
| ## Unified Service Tagging | ||
|
|
||
| It is recommended to use `DD_ENV`, `DD_SERVICE`, and `DD_VERSION` to set `env`, `service`, and `version` for your services. |
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 full list of the configuration options and default values are now documented here https://github.com/DataDog/dd-trace-rs/blob/main/supported-configurations.json
| use axum::http::HeaderMap; | ||
|
|
||
| // AXUM example | ||
| async fn axum_handler(headers: HeaderMap) { |
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 think this should use hyper as well since that's what we compile and test in the example https://github.com/DataDog/dd-trace-rs/blob/f649c8bba8a0609e341608c46fbe55ffb86e3375/datadog-opentelemetry/examples/propagator/src/server.rs#L136
| .with_kind(SpanKind::Server) | ||
| .start_with_context(tracer, &parent_cx); | ||
|
|
||
| // ... your handler logic ... |
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 should probably mention that you have to create a Context like this let cx = parent_cx.with_span(span); and then attach it either directly or around the future for async calls to make the span become the current span.
| ```toml | ||
| [dependencies] | ||
| # Provides HeaderInjector and HeaderExtractor | ||
| opentelemetry-http = "0.31" |
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 version should be kept in sync with the other OTel versions, or things will break.
What does this PR do? What is the motivation?
Adds documentation for new Datadog Rust SDK, which is built on the OTel SDK.
TODO
Merge instructions
Merge readiness:
For Datadog employees:
Your branch name MUST follow the
<name>/<description>convention and include the forward slash (/). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.If your branch doesn't follow this format, rename it or create a new branch and PR.
[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.
Additional notes