-
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
Support @Traceless
for suppressing traces from application URI
#44733
Comments
/cc @brunobat (opentelemetry), @radcortez (opentelemetry) |
Thanks for starting this discussion. First of all, I would like to ask @brunobat if there is currently anyway other than the use of |
Sampler is the right approach, per spec. There are flags in the context that flag if a span is sampled or not but I will have to dig on that. |
Honestly, whether the annotation applies to the class only class or also to the methods, makes almost no difference in the proper implementation. If we have a way to mark the current span as ignored, then I can take care of this |
I read and commented on that PR because I remember the pain it was to make it clear when security annotations are applied and assert that. And even though it is documented, there are still people who use it differently, I fixed such reported "bug" just this month. I am just worried you will get feedback from people that won't get it. Anyway, IMHO the decision is yours.
Resource class methods still can share paths with other resources that differ in stuff like HTTP methods etc.
so please include into the docs that other resources that are not annotated may be affected as well. My opinion is that advantage of annotation is that it can clearly mark what is disabled (like the annotated endpoint), unlike configuration approach, but it will be bit less clear with this |
I understand your concerns, @michalvavrik. Let's split the problem in 2 and leave the This is simpler and probably what was implemented on that part can be re-used. |
Tha's already in, no? |
We only reverted the annotation, the config property is still there |
cool |
@brunobat this comment is addressed to you :) |
I know. It's on my queue. |
👌🏽 |
These are the key points about sampling. There are 2 types of sampling, head sampling and tail sampling. What we do in Quarkus is head sampling where the sampling behaviour is set upon span creation. Tail sampling is quite complex and happens after the entire trace (multiple spans) are collected and requires buffering inside the span processor (different from exporter). An analysis of the collected data decides if the trace should be sampled or not. The OTel SDK doesn't support this out of the box. According to the spec, the sampling decision, "the SDK must call the Later, the part of the SDK spec about sampling states that " Long story short: Sampling cannot be changed after the span is created. Some things can happen now:
Any suggestions? |
Can't we add some kind of special attribute that when we added means that in the end, the span should be "discarded" (i.e. not sent to or not processed by the exporter)? |
No, unfortunately that attribute must be present in the moment of creation of the span. |
But we can add whatever attribute we want to a span, no? |
yes, but it will take a lot of work to do that at the moment of creation for all instrumentations. Everywhere. It's brittle and, sincerely, this feature should not take so much effort. |
In my opinion we should have sampling according to what we already do with resources sampling:
How to specify this in the annotation? I'm open to suggestions. We probably want to implement the annotation inheritance, though. |
I am actually proposing the opposite.
then before we send the span to the exporter check:
If we can do that, then the code to handle |
This won't work in JAX-RS / Jakarta REST as an annotation on a Resource Method means that the method is not identifiable by a path only. |
That can work but we need to create our processor or our own exporter... This idea can work but it's a lot of work, but at least will provide other benefits. I like it. |
We already have our own exporters though? Or what am I missing? :) |
Or do you mean |
We actually have |
We still need the On the exporter side I see a place to work here: https://github.com/quarkusio/quarkus/blob/6c87887923bd855bab7824ecb5c0d87933296598/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/tracing/VertxGrpcSpanExporter.java#L20-L19 On the SpanProcessor side we can work here: Line 45 in 95fea0b
This last one seems better because will generate less work. |
Kk, I'll see if I can put a prototype together next week |
If we do this, we will be bypassing the sampling system. |
This currently only works for Quarkus REST Resolves: quarkusio#44733
#44872 is what we need from a Quarkus REST perspective. I'll let you continue the work on hardening the Opentelemetry part and add whatever other tests you would like |
Thanks @geoand, will do. |
👌🏽 |
Sorry. Will not have bandwidth until the end of Jan. to work on this. If someone else wants to grab it, I'm fine with it. |
After this discussion on #43885 pull request, we decided to remove the annotation and to work only with the
quarkus.otel.traces.suppress-application-uris
property.Rever PR: #44724
To give a better implementation we need to be sure that:
Discussion's resume
Clarify Annotation Behavior
@Traceless
and different HTTP methods (@GET
,@PUT
, etc.) on the same@Path
.Validate Subresource Handling
Handle Inheritance
@Path
is defined on a parent class or interface.Distinguish Endpoints vs. Paths
@Traceless
is applied to REST clients with@Path
.Test and Validate Use Cases
@Path
.@Traceless
annotation.Request Expert Review
Improve Error Messages
@Path
annotation requirement.cc: @michalvavrik @geoand @brunobat
The text was updated successfully, but these errors were encountered: