Support for custom instrumenting your application using the OpenTelemetry API and sending the spans to Datadog is in beta.

If your code is custom instrumented with the OpenTelemetry (OTel) API, you can configure it to generate Datadog-style spans and traces to be processed by the Datadog tracing library for your language, and send those to Datadog.

The Datadog tracing library, when configured as described here, accepts the spans and traces generated by OpenTelemetry-instrumented code, processes the telemetry, and sends it to Datadog. You can use this approach, for example, if your code has already been instrumented with the OpenTelemetry API, or if you want to instrument using the OpenTelemetry API, and you want to gain the benefits of using the Datadog tracing libraries without changing your code.

If you’re looking for a way to instrument your code with OpenTelemetry and then send span data to Datadog without going through the Datadog tracing library, see OpenTelemetry in Datadog.

要件と制限

  • Datadog .NET トレースライブラリ dd-trace-dotnet バージョン 2.21.0 以上。

特記されている通り、Datadog のライブラリに実装されている以下の OpenTelemetry 機能:

機能サポートノート
OpenTelemetry コンテキスト伝搬Datadog 分散ヘッダーフォーマットが代わりに使用されます。
スパンプロセッサー非サポート
スパンエクスポーター非サポート
トレース/スパン ID ジェネレーターID の生成は ddtrace が行います。

Datadog トレースプロバイダーを使用するための OpenTelemetry の構成

  1. OpenTelemetry .NET Manual Instrumentation ドキュメントに従って、ご希望の手動 OpenTelemetry インスツルメンテーションを .NET コードに追加します。
  2. Datadog .NET トレーシングライブラリをインストールし、.NET Framework サービスまたは .NET Core (および .NET 5+) サービスのトレーサーを有効にします。
  3. DD_TRACE_OTEL_ENABLED 環境変数を true に設定します。
  4. アプリケーションを実行します。

Datadog は、これらの OpenTelemetry スパンと他の Datadog APM スパンを組み合わせて、アプリケーションの単一のトレースにします。また、OpenTelemetry インスツルメンテーションライブラリもサポートしています。

その他の参考資料

お役に立つドキュメント、リンクや記事: