opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[exporterhelper] Preserve request span context in the persistent queue

Open dmitryax opened this issue 5 months ago • 2 comments

This change makes it possible to propagate span context through the Collector with enable persistent queue.

Currently, it is behind the exporter.PersistRequestContext feature gate, which can be enabled by adding --feature-gates=exporter.PersistRequestContext to the collector command line. An exporter buffer stored by a previous version of the collector (or by a collector with the feature gate disabled) can be read by a newer collector with the feature enabled. However, the reverse is not supported: a buffer stored by a newer collector with the feature enabled cannot be read by an older collector (or by a collector with the feature gate disabled).

Resolves https://github.com/open-telemetry/opentelemetry-collector/issues/11740

dmitryax avatar Jun 07 '25 05:06 dmitryax

Codecov Report

Attention: Patch coverage is 60.51502% with 92 lines in your changes missing coverage. Please review.

Project coverage is 91.28%. Comparing base (d800ad3) to head (bf58132). Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
...exporterhelper/internal/persistentqueue/meta.pb.go 21.00% 77 Missing and 2 partials :warning:
...xporterhelper/internal/persistentqueue/encoding.go 89.28% 8 Missing and 4 partials :warning:
...rterhelper/internal/queuebatch/persistent_queue.go 90.00% 0 Missing and 1 partial :warning:

:x: Your patch status has failed because the patch coverage (60.51%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13176      +/-   ##
==========================================
- Coverage   91.28%   91.28%   -0.01%     
==========================================
  Files         510      512       +2     
  Lines       28725    28844     +119     
==========================================
+ Hits        26223    26330     +107     
- Misses       1988     1996       +8     
- Partials      514      518       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 07 '25 05:06 codecov[bot]

@bogdandrutu @jmacd here is another approach that doesn't involve the custom encoding but introduces new public module pdata/xpdata/request which provides access to the pdata protobuf to built a wrapper on top of it https://github.com/open-telemetry/opentelemetry-collector/pull/13188

dmitryax avatar Jun 11 '25 05:06 dmitryax

Closing in favor of https://github.com/open-telemetry/opentelemetry-collector/pull/13188

dmitryax avatar Jun 16 '25 04:06 dmitryax