ATTENTION:
OpenTelemetry support is currently "experimental". It may be subject to breaking changes between minor versions, and is not yet recommended for use in production or other sensitive environments.
If you are interested in using this feature experimentally, please contact the dd-trace-rb maintainers; we would be happy to provide you with more information!
Supported tracing frameworks:
Type | Documentation | ddtrace version | Gem version support |
---|---|---|---|
OpenTelemetry | https://github.com/open-telemetry/opentelemetry-ruby | 1.9.0+ | >= 1.1.0 |
-
Add the
ddtrace
gem to your Gemfile:source 'https://rubygems.org' gem 'ddtrace'
-
Install the gem with
bundle install
-
To your OpenTelemetry configuration file, add the following:
require 'opentelemetry' require 'datadog/opentelemetry'
-
Add a configuration block to your application:
Datadog.configure do |c| # Configure the Datadog tracer here. # Activate integrations, change tracer settings, etc... # By default without additional configuration, # no additional integrations will be traced, only # what you have instrumented with OpenTelemetry. end
Using this block you can:
-
OpenTelemetry spans and Datadog APM spans will now be combined into a single trace your application.
Integration instrumentations and OpenTelemetry Automatic instrumentations are also supported.
There are a few limitations to OpenTelemetry Tracing when the APM integration is activated:
Feature | Support? | Explanation | Recommendation | |
---|---|---|---|---|
Context propagation | Unsupported | Datadog distributed header format is used instead. | N/A | |
Span processors | Unsupported | N/A | ||
Span Exporters | Unsupported | N/A | ||
OpenTelemetry.logger |
Special | OpenTelemetry.logger is set to the same object as Datadog.logger . |
Configure through Custom logging. | |
Trace/span ID generators | Special | ID generation is performed by ddtrace . |
N/A |
You can send OpenTelemetry traces directly to the Datadog agent (without ddtrace
) by using OTLP.
Check out our documentation on OTLP ingest in the Datadog Agent for details.
Datadog APM spans will not be sent through the OTLP exporter.