aiokafka icon indicating copy to clipboard operation
aiokafka copied to clipboard

Add compability with OpenTelemetry

Open Corfucinas opened this issue 3 years ago • 3 comments

Describe the solution you'd like Currently, there's no clear way to export metrics or traces running directly from the program. Opentelemetry allows auto instrumentation with this python package. If we use sync kafka-python it's possible to export traces by just adding KafkaInstrumentor().instrument(), in Jaeger this is how they look.

image

However, this will not work with the current implementation of aiokafka

I could start the conversation over there as well, however, I think they won't be able to include aiokafka since it -unfortunately- does not exposed metrics

Corfucinas avatar Oct 25 '22 06:10 Corfucinas

Hi!! Any news on this?

marcosschroh avatar Jan 26 '23 14:01 marcosschroh

What features do you miss on aiokafka side? KafkaInstrumentor from the link above just monkey-patches two methods of producer and consumer, I see no problem to do the same for aiokafka's producer and consumer.

ods avatar Jan 27 '23 07:01 ods

Hello

Had the same issue at my company today. Decide to adapt the interceptor for aio. Please note that I have just started it this afternoon and it may not work in all cases: https://github.com/socotecio/opentelemetry-instrumentation-aiokafka

Will transform this to a real package when time but you can download it and use it since now.

AMontagu avatar Feb 21 '23 19:02 AMontagu