You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only affects the JavaScript OpenTelemetry library
This may affect other libraries, but I would like to get opinions here first
I’ve been working on improving the kafkajs instrumentation by adding support for capturing the Kafka broker address as an attribute.
The Kafka broker address can be extracted from the brokerAddress property in kafkajs — however, this property only exists from kafkajs v1.4.1 onwards.
Current situation
The current instrumentation supports kafkajs >=0.3.0 <3.
Adding server.address would be a valuable enhancement, but would require narrowing the supported range to >=1.4.1 <3.
Proposed change
Update the instrumentation to add brokerAddress (ATTR_SERVER_ADDRESS) (for producer spans at this time).
Adjust the supported versions in the instrumentation to >=1.4.1 <3.
This means the impact of narrowing the supported range will be minimal and unlikely to affect most users.
Benefits
Aligns with OpenTelemetry semantic conventions for messaging systems.
Provides more granular and valuable telemetry data for tracing Kafka communications.
Questions for maintainers
Are you open to narrowing the supported range as part of this enhancement?
If yes, would you like me to open a PR with the changes and the version range adjustment?
My current progress
I already have a working local implementation that:
Patches the appropriate kafkajs internals
Adds the broker address as a span attribute
Handles injection and context propagation properly
Happy to polish it and contribute if this direction makes sense!
The text was updated successfully, but these errors were encountered:
AvihuHenya
changed the title
@opentelemetry/instrumentation-kafkajs: Add server.address attribute support (requires narrowing supported versions)
@opentelemetry/instrumentation-kafkajs: Add brokerAddress attribute support (requires narrowing supported versions)
Mar 24, 2025
according to npm, the relevant versions which will be affected are very few 7 years old releases with 188-311 downloads, compared to the recent version with 1,126,007 downloads.
I find it hard to believe anyone that is instrumenting with opentelemetry and using those very old version, so I support this change.
disclaimer: I am working with @AvihuHenya and am personally interested in seeing this enhancement move forward.
Uh oh!
There was an error while loading. Please reload this page.
I’ve been working on improving the kafkajs instrumentation by adding support for capturing the Kafka broker address as an attribute.
The Kafka broker address can be extracted from the brokerAddress property in kafkajs — however, this property only exists from kafkajs v1.4.1 onwards.
Current situation
Proposed change
Why this should be safe
Benefits
Questions for maintainers
Are you open to narrowing the supported range as part of this enhancement?
If yes, would you like me to open a PR with the changes and the version range adjustment?
My current progress
I already have a working local implementation that:
Happy to polish it and contribute if this direction makes sense!
The text was updated successfully, but these errors were encountered: