You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two ways to disable tracing for a specific REST endpoint.
596
+
597
+
You can use the `@io.quarkus.opentelemetry.runtime.tracing.Traceless` (or simply `@Traceless`) annotation to disable tracing for a specific endpoint.
598
+
599
+
Examples:
600
+
601
+
==== `@Traceless` annotation on a class
602
+
603
+
[source,java]
604
+
.PingResource.java
605
+
----
606
+
@Path("/health")
607
+
public class PingResource {
608
+
609
+
@Path("/ping")
610
+
public String ping() {
611
+
return "pong";
612
+
}
613
+
}
614
+
----
615
+
616
+
When the `@Traceless` annotation is placed on a class, all methods annotated with `@Path` will be excluded from tracing.
617
+
618
+
==== `@Traceless` annotation on a method
619
+
620
+
[source,java]
621
+
.TraceResource.java
622
+
----
623
+
@Path("/trace")
624
+
@Traceless
625
+
public class TraceResource {
626
+
627
+
@Path("/no")
628
+
@GET
629
+
@Traceless
630
+
public String noTrace() {
631
+
return "no";
632
+
}
633
+
634
+
@Path("/yes")
635
+
@GET
636
+
public String withTrace() {
637
+
return "yes";
638
+
}
639
+
}
640
+
----
641
+
642
+
In the example above, only `GET /trace/yes` will be included in tracing.
643
+
644
+
==== Disable using configuration
645
+
646
+
If you do not want to modify the source code, you can use your `application.properties` to disable a specific endpoint through the `quarkus.otel.traces.suppress-application-uris` property.
- Disable tracing for the `/people` URI and all other URIs under it, e.g., `/people/1`, `/people/1/cars`.
661
+
662
+
[NOTE]
663
+
====
664
+
If you are using `quarkus.http.root-path`, you need to remember to include the root path in the configuration. Unlike `@Traceless`, this configuration does not automatically add the root path.
Copy file name to clipboardExpand all lines: extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/TracerProcessor.java
0 commit comments