-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More and proper tags for observation spans #2609
Comments
Contributions are welcome. |
I'll create a PR for that soon :) |
I believe previously it was |
No problem, I will just change that. Do you know if it is possible to get the name of the broker (+ port) for the consumed/produced message somehow? |
Well, no problem with Re. broker name. Quoting that OTEL docs:
It might be great if they give us some hint what they talk about. So, probably we just can take that property from config. |
I think it does not make sense to specify all brokers from Maybe in the future a configurable cluster name or something would be benefical for that, from the docs: |
Right, so, that's probably what a |
I would like to call out something if I may: I think adding extra data is a great idea but we should be comfortable enough with the names to keep them even if OTel changes the specifications. |
Thanks, @jonatan-ivanov , for feedback! So, probably a middle ground could be like this:
Everyone who's eager to follow the current spec with our current version feels free to use this API:
to modify our tags to the target expectations. Looks like the same mentioned
Probably that
|
Sounds good! |
I suggested something similar here #2616 (comment) Just provide OTEL convention implementations that the user can choose to use instead of the default ones. |
Sure! That's your call. |
Fixes: #2609 * Improved observation tags to follow Opentelemetry standard (Listener) * Otel conform tags for kafka sender * Moved partition and offset to high-cardinality keys and revert publish -> send * author and formatting * * fix review. * polish `ObservationTests`. * add @author. * add doc in `whats-new.adoc`. * * fix review. * add javadoc for `KafkaRecordReceiverContext` construct method. * * fix review. --------- Co-authored-by: Christian Mergenthaler <[email protected]>
Expected Behavior
The current tags for tracing spans are very limited and contain only a few relevant information. Opentelemetry defines all the recommended and required attributes a single message span should include. It would be nice to have them predefined by spring-kafka automatically instead of using the customizer explicitly. Even though customizing might work, we lack a few information on the customizer to follow otel standardization properly (used broker, consumergroup, partition for producer, etc.).
Current Behavior
The only tags currently included are spring related tags (e.g.
spring.kafka.template
) and do not follow any standard. There are other spring projects that already have proper otel tags defined (e.g. spring-data-mongodb).I think it would be beneficial to have consistent standard support over different spring projects.
Context
To workaround this one can implement their own KafkaTemplateObservationConvention and define the necessary tags:
As you can see some required/recommended information is missing on the customizer.
The text was updated successfully, but these errors were encountered: