CAMEL-23312: Add SpanKind support to OpenTelemetry2 component#22653
CAMEL-23312: Add SpanKind support to OpenTelemetry2 component#22653JiriOndrusek wants to merge 1 commit intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
9af0c9d to
e632ee2
Compare
|
🧪 CI tested the following changed modules:
All tested modules (11 modules)
|
squakez
left a comment
There was a problem hiding this comment.
Good work! A few notes to improve the overall readability of the code but the structure is good and compliant with the design.
e632ee2 to
948f06a
Compare
|
LGTM |
| @@ -21,7 +21,7 @@ | |||
| */ | |||
| public interface SpanLifecycleManager { | |||
|
|
|||
| Span create(String spanName, Span parent, SpanContextPropagationExtractor extractor); | |||
| Span create(String spanName, String spanKind, Span parent, SpanContextPropagationExtractor extractor); | |||
There was a problem hiding this comment.
I think it is not but just to double-check: this interface is not supposed ot be used outside of camel core?
If yes, would need to add a note in the upgrade guide
There was a problem hiding this comment.
Good point, although I doubt anybody is implementing any custom component. However to be consistent we need to add a minor note as you suggest, but more important, we need to change the documentation in https://camel.apache.org/components/next/others/telemetry.html#_implementation_specific_abstraction to include the new param.
fixes https://issues.apache.org/jira/browse/CAMEL-23312
superseeds #22612
Adds SpanKind parameter to the Camel telemetry API to enable proper span type classification (CLIENT, SERVER, PRODUCER, CONSUMER, INTERNAL) across different observability backends.
Changes
getSpanKind(String operation)method to allow decorators to specify appropriate span kinds based on operation typecreate()signature to accept spanKind parameterSpanKindenumAbstractHttpSpanDecorator: Returns CLIENT for EVENT_SENT, SERVER for EVENT_RECEIVEDAbstractMessagingSpanDecorator: Returns PRODUCER for EVENT_SENT, CONSUMER for EVENT_RECEIVEDAbstractSpanDecorator: Returns INTERNAL as defaultTarget
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.