Skip to content

feat(tracing): migrate to OpenTelemetry OTLP and enrich trace metadata #1160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025

Conversation

gaius-qi
Copy link
Member

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, the init_tracing function now accepts a Host parameter to provide contextual metadata for tracing.

Dependency Updates:

  • Updated tracing-opentelemetry to version 0.30.0 and replaced Jaeger dependencies with OTLP-related dependencies (opentelemetry, opentelemetry-otlp, and opentelemetry_sdk). These changes enable the use of the OTLP exporter for tracing.

Code Updates for Tracing:

  • Enhanced the init_tracing function to support the OTLP exporter by configuring opentelemetry_sdk::trace::SdkTracerProvider with resource attributes like idc, location, hostname, and ip. These attributes are derived from the new Host parameter.
  • Introduced a SPAN_EXPORTER_TIMEOUT constant to define the timeout for the span exporter.

Function Signature Changes:

  • Updated the init_tracing function to include an optional host: Option<Host> parameter, allowing the injection of host-specific metadata into the tracing setup.

Related Issue

Motivation and Context

Screenshots (if appropriate)

@gaius-qi gaius-qi added this to the v2.3.0 milestone May 26, 2025
@gaius-qi gaius-qi self-assigned this May 26, 2025
@gaius-qi gaius-qi requested a review from a team as a code owner May 26, 2025 13:42
@gaius-qi gaius-qi added the enhancement New feature or request label May 26, 2025
Copy link
Contributor

@Liam-Zhao Liam-Zhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Liam-Zhao Liam-Zhao enabled auto-merge (squash) May 26, 2025 13:58
Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 0% with 42 lines in your changes missing coverage. Please review.

Project coverage is 49.33%. Comparing base (1d63a07) to head (a49fe1e).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
dragonfly-client/src/tracing/mod.rs 0.00% 36 Missing ⚠️
dragonfly-client-init/src/bin/main.rs 0.00% 1 Missing ⚠️
dragonfly-client/src/bin/dfcache/export.rs 0.00% 1 Missing ⚠️
dragonfly-client/src/bin/dfcache/import.rs 0.00% 1 Missing ⚠️
dragonfly-client/src/bin/dfcache/stat.rs 0.00% 1 Missing ⚠️
dragonfly-client/src/bin/dfdaemon/main.rs 0.00% 1 Missing ⚠️
dragonfly-client/src/bin/dfget/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1160      +/-   ##
==========================================
- Coverage   49.51%   49.33%   -0.18%     
==========================================
  Files          58       58              
  Lines       12085    12114      +29     
==========================================
- Hits         5984     5977       -7     
- Misses       6101     6137      +36     
Files with missing lines Coverage Δ
dragonfly-client-init/src/bin/main.rs 0.00% <0.00%> (ø)
dragonfly-client/src/bin/dfcache/export.rs 0.00% <0.00%> (ø)
dragonfly-client/src/bin/dfcache/import.rs 0.00% <0.00%> (ø)
dragonfly-client/src/bin/dfcache/stat.rs 0.00% <0.00%> (ø)
dragonfly-client/src/bin/dfdaemon/main.rs 0.00% <0.00%> (ø)
dragonfly-client/src/bin/dfget/main.rs 25.09% <0.00%> (-0.04%) ⬇️
dragonfly-client/src/tracing/mod.rs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Liam-Zhao Liam-Zhao merged commit 57caa35 into main May 26, 2025
7 checks passed
@Liam-Zhao Liam-Zhao deleted the feature/tracing branch May 26, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants