docs.rs failed to build tracing-datadog-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
tracing-datadog-0.6.1
tracing-datadog
A tracing exporter layer for Datadog, without dependencies on opentelemetry.
- Exporter for
tracingtraces to Datadog APM - (Optional) Datadog-compatible log formatting and APM ↔ log correlation
- (Optional) Distributed tracing support for HTTP requests via W3C Trace Context headers or Datadog's proprietary headers
- (Optional) Container-ID tracking for infrastructure metrics in APM
Crate features
ahash- Use AHashMaps instead ofstdHashMaps for performancehttp- HTTP Trace Context header support (W3C Trace Context and Datadog)
Usage
To enable both trace data and log collection, use the DatadogTraceLayer layer
in your tracing subscriber:
use ;
use DatadogTraceLayer;
registry
.with
.init;
Logs will be emitted to stdout in the Datadog JSON format.
Span tag semantics
Certain span tags have special meaning in Datadog:
service- can be used to override the service on a per-span basisoperation- maps to Datadog APM operationsresource- maps to Datadog APM resourcesspan.kind- defaults tointernal, but can be set toclient,server,producer, orconsumer. Internal spans do not generate trace metrics.span.type- defaults tocustom, but can be set towebfor request handlers,httpfor HTTP client requests, or any ofsql,cassandra,memcached,mongodb,elasticsearch,opensearch,redis, ordbfor data store queries.customcan be used for any other type of span.
There are few other semantic conventions, like the ones for errors. This page lists a lot of them.
Distributed tracing over HTTP
To enable distributed tracing over HTTP, enable the http feature and use
DatadogContext to extract and inject trace context from/into HTTP headers.
See the API documentation for examples.
Prior Art
Some code has been adopted for the following projects:
See also komoju-datadog for opinionated usage of this library.