-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add Headers as Attributes for Otel traces #673
base: master
Are you sure you want to change the base?
Conversation
src/main/java/org/mule/extension/http/api/listener/server/HttpListenerConfig.java
Outdated
Show resolved
Hide resolved
...le/extension/http/internal/listener/profiling/tracing/HttpListenerCurrentSpanCustomizer.java
Show resolved
Hide resolved
@@ -41,16 +46,24 @@ public class HttpListenerCurrentSpanCustomizer extends HttpCurrentSpanCustomizer | |||
private final String host; | |||
private final int port; | |||
|
|||
private HttpListenerCurrentSpanCustomizer(HttpRequestAttributes attributes, String host, int port) { | |||
//W-12558102 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the comment for the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Should I remove all the other similar comments?
...le/extension/http/internal/listener/profiling/tracing/HttpListenerCurrentSpanCustomizer.java
Outdated
Show resolved
Hide resolved
Thanks very much for the PR, @panizzag! |
...le/extension/http/internal/listener/profiling/tracing/HttpListenerCurrentSpanCustomizer.java
Outdated
Show resolved
Hide resolved
Thanks, @fsgonz for the review and suggestions. I have expanded the existing test case to include the new features. I'd appreciate it if the team can give it a new look as there might be coding guidelines and styles that I'm not used to. Thanks |
Thanks very much. We'll also have to verify if we follow the semantics conventions |
GUS Associated: W-12558102
This commit adds the possibility that the headers processed by the HTTP listener and by the HTTP requester are added as attributes of the spans initialized during the Otel implementation. This new feature takes into account the option of omitting headers that you do not want to register by using a property that is configured at the config element level of both components. An example of use is as follows:
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="f83efe45-479a-498f-adc1-8848f33ed380" skipHeadersOnTracing="client_id, client_secret">
<http:request-config name="HTTP_Request_configuration" doc:name="HTTP Request configuration" doc:id="3a18fe34-e53b-4ca4-80e2-229cb386f1bb" preserveHeadersCase="true" skipHeadersOnTracing="client_id, client_secret">
curl --location --request GET 'localhost:8081/test' \ --header 'X-Example-Header: Test' \ --header 'client_id: thisIsAnExampleClientID' \ --header 'client_secret: thisIsAnExampleClientSecret'
The final result is the following:
Before the change - Attributes registered for the example call
After the change - Attributes registered for the example call
Listener
Requester