Skip to content

[exporterhelper] Propagate Context in DisabledBatcher#12225

Closed
jade-guiton-dd wants to merge 1 commit intoopen-telemetry:mainfrom
jade-guiton-dd:disabled-batcher-context
Closed

[exporterhelper] Propagate Context in DisabledBatcher#12225
jade-guiton-dd wants to merge 1 commit intoopen-telemetry:mainfrom
jade-guiton-dd:disabled-batcher-context

Conversation

@jade-guiton-dd
Copy link
Copy Markdown
Contributor

@jade-guiton-dd jade-guiton-dd commented Jan 31, 2025

Description

When the batching functionality of exporterhelper is disabled (which is the default), the DisabledBatcher discards the provided Context and creates a new one with context.Background. This breaks traces, even when using the in-memory queue.

Link to tracking issue

No tracking issue.

Testing

I compared the traces emitted for a simple OTLP receiver -> OTLP exporter pipeline: the exporterhelper span is in its own trace before the PR, and in the same trace as the receiver span after.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.25%. Comparing base (349b84b) to head (12225b2).
Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12225   +/-   ##
=======================================
  Coverage   91.25%   91.25%           
=======================================
  Files         466      466           
  Lines       25722    25722           
=======================================
  Hits        23472    23472           
  Misses       1837     1837           
  Partials      413      413           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

defer qb.stopWG.Done()
for {
idx, _, req, ok := qb.queue.Read(context.Background())
idx, ctx, req, ok := qb.queue.Read(context.Background())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps a naive question: should the Context from the Start parameters above be used?

github-merge-queue Bot pushed a commit that referenced this pull request Feb 1, 2025
Finishes the implementation started in
#12225

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants