- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Datadog tracing libraries provide an implementation of the OpenTelemetry API for instrumenting your code. This means you can maintain vendor-neutral instrumentation of all your services, while still taking advantage of Datadog’s native implementation, features, and products. 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.
By instrumenting your code with OpenTelemetry API:
Replace the OpenTelemetry SDK with the Datadog tracing library in the instrumented application, and the traces produced by your running code can be processed, analyzed, and monitored alongside Datadog traces and in Datadog proprietary products.
For more information, read Interoperability of OpenTelemetry API and Datadog instrumented traces.
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.
dd-trace-rb
バージョン 1.9.0 以上。特記されている通り、Datadog のライブラリに実装されている以下の OpenTelemetry 機能:
機能 | サポートノート |
---|---|
OpenTelemetry コンテキスト伝搬 | Datadog 分散ヘッダーフォーマットが代わりに使用されます。 |
スパンプロセッサー | 非サポート |
スパンエクスポーター | 非サポート |
OpenTelemetry.logger | OpenTelemetry.logger は Datadog.logger と同じオブジェクトに設定されています。カスタムロギングから構成します。 |
トレース/スパン ID ジェネレーター | ID の生成は ddtrace が行います。 |
OpenTelemetry Ruby Manual Instrumentation ドキュメントに従って、ご希望の手動 OpenTelemetry インスツルメンテーションを Ruby コードに追加します。
ddtrace
gem を Gemfile に追加します。
source 'https://rubygems.org'
gem 'ddtrace'
bundle install
を実行して gem をインストールします。
OpenTelemetry のコンフィギュレーションファイルに以下の行を追加します。
require 'opentelemetry'
require 'datadog/opentelemetry'
インテグレーションを有効にし、トレーサー設定を変更できる構成ブロックをアプリケーションに追加します。ここで追加の構成を行わないと、OpenTelemetry でインスツルメンテーションを行ったコードのみがトレースされます。
Datadog.configure do |c|
...
end
このブロックを使うと、以下のことができます。
Datadog は、これらの OpenTelemetry スパンと他の Datadog APM スパンを組み合わせて、アプリケーションの単一のトレースにします。また、インテグレーションインスツルメンテーションと OpenTelemetry 自動インスツルメンテーションもサポートしています。
お役に立つドキュメント、リンクや記事: