-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow restricting propagation of OpenTelemetry trace headers #31656
Comments
/cc @brunobat (opentelemetry,tracing), @radcortez (opentelemetry,tracing) |
You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip
|
@hacst can you please provide an example of how this should work? |
Currently there is a way of creating your own propagator, and you can set your own rules, you do something like this: With that ^, you will be able to create a custom propagator and load it in Quarkus, as Quarkus uses the SDK autoconfigure SPI to load the propagator =] Regarding the spec, maybe it should be better to open an upstream issue (https://github.com/open-telemetry/opentelemetry-java) so OTEL supports the spec, as the trace-context and baggage propagators comes from the OTEL lib and not from Quarkus. |
I agree with @luneo7 that this should be better supported by OTel and an issue should by filed on them. However, given that is currently quite cumbersome to filter out those sensible headers I think we should keep this issue in our backlog. |
Thanks for the responses. I'll report the issue upstream as suggested and link it here once I've done so. |
I think there will be some time until OTel provides a solution to this... Added a comment there. |
Where in our code is In any case, I think that a perfectly usable solution (and in line with what we do in other extensions) would be add: @Target({ TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface TenantFeature {
/**
* Returns the name of this propagator, which can be specified with the {@code otel.propagators}
* property to enable it. If the name is the same as any other defined propagator name, it is
* undefined which will be used.
*/
String name();
} which users would add to their implementations of WDYT? |
I agree we should add a Quarkus feature for this but I think we should base our implementation on a propagation customiser. In the
We could include a Quarkus property to filter out certain headers. |
Hm... The customizer takes an already created |
There are a bunch of propagators in the wild:
The default is W3C, the one using TRACE_CONTEXT and is implemented out of the box in the OTel SDK. If we create a custom propagator we will be an island. If we use the customiser we can affect any content on all the already existing propagators. |
Gotcha, thanks. So in that case all we need is to define some kind interface that users will implement and mark as a bean. |
Yes, a bean that would expose the customisation for the user to override, would be optimal. |
#34920 is what I have in mind. WDYT? If that seems reasonable, I'll go ahead and add a test. |
If I understand correctly I would use this to create a wrapper around the propagator. On inject I would then introspect the carrier to see if it is a known type and whether it is OK to propagate according to my configuration and only then do the actual inject? If that is possible then it should allow the kind of filtering I was trying to do. It is a bit unfortunate that this will have to rely on knowledge of the type and internals of the carriers, but as long as it allows handling normal framework http requests that will cover a lot already. |
@brunobat I don't suppose OTel 1.28 changes anything in this APO does it? |
No, there are no changes in the autocunfigure API or on the propagation side. |
Introduce a way to customize OTel TextMapPropagator
Description
As described in the w3c trace-context and baggage specifications tracing headers might carry sensitive information. Currently once a propagator is configured it unconditionally propagates regardless of who the service is talking to. If a service calls out to an untrusted system/third party this would expose the information.
As the headers being propagated might come from another applications call, it is very hard to ensure no sensitive data is present in the application actually making the request. The only safe solution is to prevent the information from being propagated to untrusted systems in the first place.
Currently there does not seem to be any way to restrict or customize this propagation behavior while using the quarkus-opentelemetry extension (zulip).
As a developer it would be great to be able to whitelist URL patterns (and/or IP ranges) for propagation in the quarkus-opentelemetry configuration. This would allow safe configuration of who the information is transmitted to without much effort. The default would whitelist everything to retain compatibility.
Another, less safe, option would be some option to explicitly block propagation for certain URLs or rest clients through configuration/annotation.
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: