elastic / apm-agent-go

https://www.elastic.co/guide/en/apm/agent/go/current/index.html
Apache License 2.0
418 stars 193 forks source link

Add instrumentation support for segmentio/kafka-go #1471

Open sohaibomr opened 1 year ago

sohaibomr commented 1 year ago

Is your feature request related to a problem? Please describe. There doesn't seem to be a client for instrumenting Kafka, especially for tracing Kafka messages across multiple microservices. It will be helpful to have this support to achieve distributed async tracing in event-driven architecture where kaka is used as a messaging queue.

Describe the solution you'd like Support for instrumentation in segmentio/kafka-go kafka client.

axw commented 1 year ago

Thanks for opening the issue @sohaibomr

As an alternative to native instrumentation in the Go Agent, another option would be to use OpenTelemetry instrumentation for kafka-go with the recently added apmotel module. There's an open issue about adding OTel instrumentation for kafka-go (https://github.com/segmentio/kafka-go/issues/1025).

sohaibomr commented 1 year ago

Let me look into the alternative approach you suggested. Thanks @axw

sohaibomr commented 1 year ago

@axw I attempted to add this support in apm-agent-go which seems to work for me. I can create a PR if you are accepting contributions. You may have a look at it here. thanks

axw commented 1 year ago

@sohaibomr nice work! Thanks for the offer, will discuss with the team. If nothing else, we might point to your repo from some docs.