DataDog / dd-trace-go

Datadog Go Library including APM tracing, profiling, and security monitoring.
https://docs.datadoghq.com/tracing/
Other
653 stars 437 forks source link

proposal: contrib/segmentio/kafka.go.v0: add WithSpanOptions #2465

Open balogal opened 9 months ago

balogal commented 9 months ago

It would be great if contrib/segmentio/kafka.go.v0 would support a WithSpanOptions option for Writer and Reader, similar to e.g. the net/http or contrib/google.golang.org/grpc (see proposal https://github.com/DataDog/dd-trace-go/issues/1125) integrations. In particular, I'm interested in making the spans of the Writer Measured.

ajgajg1134 commented 9 months ago

Hello! Thanks for reaching out with this idea! Overall this seems possible, but I'll bring it to the rest of the team to discuss further.

You mentioned wanting to primarily use this to add the Measured option for your Writer, I will note that our FAQ indicates this could be problematic if the reading side of that Kafka topic is also traced.

balogal commented 9 months ago

Hi @ajgajg1134, thanks for getting back to me so quickly and the hint about measuring client spans. I think, irregardless of the usage of Measured, WithSpanOptions would be a useful addition to the package. (And personally, I would still like to proceed with measuring these spans, accepting the drawbacks).