Skip to content
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

[exporterhelper] Propagate Context in DisabledBatcher #12225

Conversation

jade-guiton-dd
Copy link
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.

Copy link

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.

@@ -29,13 +29,13 @@ func (qb *DisabledBatcher) Start(_ context.Context, _ component.Host) error {
go func() {
defer qb.stopWG.Done()
for {
idx, _, req, ok := qb.queue.Read(context.Background())
idx, ctx, req, ok := qb.queue.Read(context.Background())
Copy link
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 <[email protected]>
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