Skip to content

Conversation

@pedroreys
Copy link
Contributor

What does this PR do?

When a nil deliveryChan is passed to the producer.Produce(msg, nil) call, the producer wraps the producer.Events() channel and passes this wrapper channel to the inner .Produce call.

Motivation

When a nil deliveryChan was passed to the producer.Produce call, i.e. when the client was using the producer.Events() channel to get delivery reports, the kafka.produce span was never finished.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@pedroreys pedroreys requested review from a team as code owners November 6, 2025 18:55
Copy link
Member

@darccio darccio left a comment

Choose a reason for hiding this comment

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

LGTM

@pedroreys
Copy link
Contributor Author

@darccio thanks! Not sure what's up with the pipeline failure, tho.

@darccio
Copy link
Member

darccio commented Nov 11, 2025

@pedroreys You need to run make generate && make fix-modules to fix these failing pipelines. That should be enough.

…e span is finished

When a nil deliveryChan was passed in the Produce call the kafka.produce span was never finished.
@pedroreys pedroreys force-pushed the pedroreys/fix-kafka-producer-span branch from 65c6b13 to cd65351 Compare November 12, 2025 03:45
@pedroreys
Copy link
Contributor Author

@darccio done. rebased to fix conflicts and then ran make generate and make fix-modules.

@darccio
Copy link
Member

darccio commented Nov 12, 2025

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Nov 12, 2025

View all feedbacks in Devflow UI.

2025-11-12 09:10:46 UTC ℹ️ Start processing command /merge


2025-11-12 09:10:55 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-11-12 09:30:22 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 18m (p90).


2025-11-12 09:45:16 UTC ℹ️ MergeQueue: This merge request was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants