Issue
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?
Solution
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.
Answered By - Stephen Dunne
Answer Checked By - Candace Johnson (JavaFixing Volunteer)