feat(tracing): migrate to OpenTelemetry OTLP and enrich trace metadata #1160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces significant updates to the OpenTelemetry tracing setup in the
dragonfly-client
project. The changes modernize the tracing infrastructure by replacing the Jaeger exporter with an OTLP exporter and adding support for enhanced resource attributes. Additionally, theinit_tracing
function now accepts aHost
parameter to provide contextual metadata for tracing.Dependency Updates:
tracing-opentelemetry
to version0.30.0
and replaced Jaeger dependencies with OTLP-related dependencies (opentelemetry
,opentelemetry-otlp
, andopentelemetry_sdk
). These changes enable the use of the OTLP exporter for tracing.Code Updates for Tracing:
init_tracing
function to support the OTLP exporter by configuringopentelemetry_sdk::trace::SdkTracerProvider
with resource attributes likeidc
,location
,hostname
, andip
. These attributes are derived from the newHost
parameter.SPAN_EXPORTER_TIMEOUT
constant to define the timeout for the span exporter.Function Signature Changes:
init_tracing
function to include an optionalhost: Option<Host>
parameter, allowing the injection of host-specific metadata into the tracing setup.Related Issue
Motivation and Context
Screenshots (if appropriate)