-
Notifications
You must be signed in to change notification settings - Fork 441
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
[DSM] Close span on produce error in ckgo #2558
Conversation
// with no delivery channel or enqueue error, finish immediately | ||
if err != nil || deliveryChan == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, it seems like in case of an error we'd never close the span. Does this change also need to be performed in the kafka.v2 version?
dd-trace-go/contrib/confluentinc/confluent-kafka-go/kafka.v2/kafka.go
Lines 356 to 360 in 55ad19b
err := p.Producer.Produce(msg, deliveryChan) | |
// with no delivery channel, finish immediately | |
if deliveryChan == nil { | |
span.Finish(tracer.WithError(err)) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
55ad19b
to
a72b9f5
Compare
a72b9f5
to
a69ac18
Compare
When enqueueing a message to the producer fails, the span would never be finished.
a69ac18
to
444103c
Compare
What does this PR do?
When the produce queue is full, the confluent-kafka-go producer returns a synchronous error. The span started in the wrapper for the produce call currently isn't
Finish
ed in this scenario.Motivation
Stumbled upon during reading code.
Reviewer's Checklist
For Datadog employees:
@DataDog/security-design-and-guidance
.