Skip to content

Kafka instrumentation should record server attributes when possible #10647

@lmolkova

Description

@lmolkova

Is your feature request related to a problem? Please describe.

Existing Kafka instrumentation does not capture any server/network details.

So in case I have multiple kafka clusters in my application, I cannot differentiate between them.
I also don't know which node operation was done against.

I think kafka instrumentation should record cluster-id as a server.address or node host if it can retrieve them. Will bring it up in messaging semconv to decide which one.

Describe the solution you'd like

Kafka instrumentation should do the best effort collecting server.* attributes and if it's not possible should collect some network.* attributes.

Publish/consume spans should (as they already are) be created on the public api surface and cover duration of logical operation (with all retries).

In case multiple server.addresses (or network.peer.addresses) are available (e.g. tried one node and fell back to a different one), we want to report only the last node contacted on the logical operation.

Network-level kafka instrumentation is not covered by messaging semconv and there is no guidance on how/if to instrument it at this point.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

contribution welcomeRequest makes sense, maintainers probably won't have time, contribution would be welcomeenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions