1

We are using OTEL Java agent as follow

java -javaagent:path/to/opentelemetry-javaagent.jar \
     -Dotel.resource.attributes=service.name=your-service-name \
     -Dotel.traces.exporter=jaeger\
     -Dotel.exporter.jaeger.endpoint=<IP>
     -jar myapp.jar

whenever Dotel.exporter.jaeger.endpoint is not reachable or for any other issues, it will print out the error messages

example:

otel.javaagent 2022-04-27 17:44:59:056 +0530] [OkHttp http://localhost:55680/...] ERROR io.opentelemetry.exporter.otlp.internal.grpc.OkHttpGrpcExporter - Failed to export spans. The request could not be executed.

Can we disable the logging for OTEL Java Agent or set log level for OTEL Java Agent?

Nitesh S
  • 13
  • 2

2 Answers2

1

You can simply switch off the logging completely for the OpenTelemetry Java Agent with this command line argument on starting the JVM:

-Dio.opentelemetry.javaagent.slf4j.simpleLogger.defaultLogLevel=off

This will suppress the otel.javaagent messages on missing exporter endpoint.

Jens Vagts
  • 595
  • 4
  • 7
0

You can use a command line argument to change the log level but since this is an error it will still be written to the console.

I'm not sure why you would want to - but you could create a custom agent that does not log this issue, or logs it with a lower level.

Stephen Dunne
  • 419
  • 1
  • 5
  • 13