opentracing-contrib / java-kafka-client

OpenTracing Instrumentation for Apache Kafka Client
Apache License 2.0
125 stars 64 forks source link

Override tracing kafka producing and reading span tags #66

Closed lopezzlaura closed 4 years ago

lopezzlaura commented 5 years ago

Hi,

I am using your contrib in my projects, it is working quite nicely but I have found the need to add my own tags to the producing and reading spans. Right now the default tags are set by the SpanDecorator class with methods onSend() and onResponse(). An example of my problem is I would like to be able to know which of my services produces the message or consumes it to trace my distributed systems and later generate a dependency graph. But for now "peer.service" is always set to "kafka" and there is no way of changing this value, which I can understand in a way but in some case is not helping.

So I thought of an idea to make custom tags possible by doing the following :

I have already locally developed this version of the contrib and it is working quite well. Also, doing this will not impact user's current use of the contrib because I'm keeping the current constructors and just adding a package-private one called by the builders. But if you like the idea, maybe we could just gradually replace the current producer and consumer constructors by the builder only. What would you think of this instrumentation ?

malafeev commented 5 years ago

@lopezzlaura I would be happy to see your PR

malafeev commented 5 years ago

let's start with

keeping the current constructors and just adding a package-private one called by the builders

cykl commented 4 years ago

Hi @malafeev, it seems that #67 solved that issue. Would it be possible to cut a release including this work?

malafeev commented 4 years ago

version 0.1.9 is released

lyca commented 4 years ago

Hi @malafeev, do you see any chance to cut a release including the merged changes from #69?

malafeev commented 4 years ago

@lyca version 0.1.10 is released, will be available soon.