5

I'm using the open telemetry java agent as documented here to instrument a Java Spring Boot application and export the traces to Google Cloud Trace.

My command is :

java \
  -javaagent:/opentelemetry/opentelemetry-javaagent.jar \
  -Dotel.javaagent.extensions=/opentelemetry/exporter-auto-0.22.0-alpha.jar \
  -Dotel.traces.exporter=google_cloud_trace \
  -Dotel.metrics.exporter=none \
  -jar \
  /app.jar

It works.

However since I'm deploying my application under kubernetes with a liveness probe the agent also records traces for the /actuator/health endpoint.

I'd like to filter out these calls so that they are not recorded by the agent and sent to the collector.

The agent configuration documentation doesn't seem to cover this use case.

Is it possible to filter the traces by http calls but not yet documented ? Is it a planned feature ?

singe3
  • 2,065
  • 4
  • 30
  • 48
  • Probably it would be useful to review the [agent’s feature requests](https://github.com/open-telemetry/oteps/issues) to see if this feature has been proposed, and if that is not the case, you may want to propose it. – Alex Nunez Priego Jun 17 '22 at 17:28
  • I think this feature is not there ,but for workaround you can use RuleBasedRouting sampler and drop spans based on condition. https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/samplers/src/main/java/io/opentelemetry/contrib/sampler/RuleBasedRoutingSamplerBuilder.java – Gaurang Apr 26 '23 at 06:46

0 Answers0