Re: inquiry on integrating jaeger tracer on kafka consumer

48 views
Skip to first unread message

Ben Sigelman

unread,
Sep 17, 2018, 3:35:15 PM9/17/18
to Luis Gabriel, opent...@googlegroups.com
(Adding a different list that may be more helpful – Luis, where did you find the comm...@opentracing.io address, btw? I'm moving it to bcc.)

On Mon, Sep 17, 2018 at 8:02 AM 'Luis Gabriel' via opentracing.io emails <opent...@lightstep.com> wrote:
Hi Community,
I'm working on doing an integration similar to this java solution (https://github.com/jeqo/post-kafka-opentracing). I'm being tasked to use the jaeger tracer to trace kafka consumers. I'm being asked to implement  this in Python. I'm having difficulty finding a solution to convert this portion of java code into Python.
final TracingKafkaConsumer<String, String> tracingKafkaConsumer =
        new TracingKafkaConsumer<>(kafkaConsumer, tracer);

    //Define Runnable Handler
    final KafkaGreetingsHandler greetingsHandler =
        new KafkaGreetingsHandler(tracingKafkaConsumer)

I'm able to create the tracer fine, its the connection between the tracer and the consumer in python where I'm not sure the syntax of. Could you assist? Or if not, could you possibly lead me to the right direction as to where I should be looking? The information as it is online is scarce.

Hope to hear back from you.


aus...@lightstep.com

unread,
Sep 17, 2018, 3:47:11 PM9/17/18
to OpenTracing
I believe this is using the Kafka OpenTracing client (https://github.com/opentracing-contrib/java-kafka-client) which provides a KafkaConsumer wrapped with tracing. I don't know if there's an equivalent for Python, but maybe someone else could chime in?

Carlos Alberto Cortez

unread,
Sep 19, 2018, 10:34:04 AM9/19/18
to OpenTracing
Hey,

So a good place to start looking is https://github.com/opentracing-contrib/python-sqlalchemy as this is OpenTracing instrumentation (Jaeger compatible) for Python's SqlAlchemy.

The usual approach for Python is to either a) Use a middleware or library hooks to create/finish Spans, or b) Patch the library. For Java, usually you create a wrapper if there are not hooks (as it's done in the example you showed).

Feel free to come and talk in https://gitter.im/opentracing/opentracing-python ;)
Reply all
Reply to author
Forward
0 new messages