0

I want to filter some endpoints and omit them from telemetry. I put opentelemetry-javaagent.jar in project folder and specify path in JAVA_OPTS variable. I run my application with next parameters:

JAVA_OPTS = -javaagent:/Users/...../Desktop/myProject/opentelemetry-javaagent.jar -Dotel.service.name\=MyApp -Dotel.tracer.exporter\=logging -Dotel.metrics.exporter\=logging -Dconfig.file=/Users/...../Desktop/myProject/config.yaml

All works fine, I see all requests in Graphana, but I want to exclude some endpoints from telemetry. I specify these endpoints in config.yaml and specify path to it in JAVA_OPTS. config.yaml is next:

processors:
  filter:
    spans:
      exclude:
        match_type: regexp
        services:
          - MyApp
        span_names:
          - *

After I run my app it still trace all endpoints but I expect that nothing will be traced. Looks like config.yaml doesn't accepted. What's wrong in my config? Thnks.

Valeriy K.
  • 2,616
  • 1
  • 30
  • 53

1 Answers1

0

According to the official docs, yaml configuration is not supported for java auto-instrumentation. You can use .properties file by providing this option: -Dotel.javaagent.configuration-file=path/to/properties/file.properties.

A list of the supported properties can be found here.

Please note, that there is no filter processor mentioned in the Java docs. So you probably should add filtering logic to the OpenTelemetry Collector configuration.

Igor Morozov
  • 194
  • 1
  • 6