opentelemetry-java-instrumentation
opentelemetry-java-instrumentation copied to clipboard
add debug log confirming what is loaded by OTEL_JAVAAGENT_EXTENSIONS
Describe the bug
I have built a custom Sampler that I have placed in a jar. Following the docs, I am starting my application with OTEL_JAVAAGENT_EXTENSIONS env variable, pointing to the jar where my custom sampler and its provider are, but at startup, my sampler is not found, and I get very little information, even with debug enabled :
[otel.javaagent 2024-06-17 21:17:10:976 -0400] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 2.1.0 [otel.javaagent 2024-06-17 21:17:10:976 -0400] [main] DEBUG io.opentelemetry.javaagent.tooling.VersionLogger - Running on Java 17.0.8.1. JVM OpenJDK 64-Bit Server VM - Eclipse Adoptium - 17.0.8.1+1 [otel.javaagent 2024-06-17 21:17:10:976 -0400] [main] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller - io.opentelemetry.javaagent.tooling.AgentInstaller loaded on io.opentelemetry.javaagent.bootstrap.AgentClassLoader@73ad2d6 [otel.javaagent 2024-06-17 21:17:16:037 -0400] [main] DEBUG io.opentelemetry.sdk.internal.JavaVersionSpecific - Using the APIs optimized for: Java 9+ [otel.javaagent 2024-06-17 21:17:16:044 -0400] [main] INFO io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder - Error encountered during autoconfiguration. Closing partially configured components. [otel.javaagent 2024-06-17 21:17:16:044 -0400] [main] DEBUG io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder - Closing io.opentelemetry.sdk.metrics.SdkMeterProvider OpenTelemetry Javaagent failed to start io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: Unrecognized value for otel.traces.sampler: mySampler at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureSampler(TracerProviderConfiguration.java:201) at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:52)
Steps to reproduce
launch your application with OTEL_JAVAAGENT_EXTENSIONS env variable pointing to something that doesn't exist : you won't get any particular warning in the logs.
Expected behavior
It would be useful to get more infos in debug logs :
- is
OTEL_JAVAAGENT_EXTENSIONSvalue taken into account ? and/or is it pointing to something that is invalid ? - if it is provided and pointing to something valid, what gets loaded out of it ?
Actual behavior
no particular infos in debug logs, pertaining to whether the provided configuration is correct/useful or not.
Javaagent or library instrumentation version
2.1.0
Environment
JDK: Eclipse Adoptium - 17.0.8.1+1 OS: MacOs
Additional context
No response
launch your application with
OTEL_JAVAAGENT_EXTENSIONSenv variable pointing to something that doesn't exist : you won't get any particular warning in the logs.
logging a warning in this case makes sense to me
Since there has been no activity on this enhancement for the past year we are closing it to help maintain our backlog. Anyone who would like to work on it is still welcome to do so, and we can re-open it at that time.