Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add debug log confirming what is loaded by OTEL_JAVAAGENT_EXTENSIONS #11616

Open
vincent-fuchs opened this issue Jun 18, 2024 · 1 comment
Open
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request

Comments

@vincent-fuchs
Copy link

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_EXTENSIONS value 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

@vincent-fuchs vincent-fuchs added bug Something isn't working needs triage New issue that requires triage labels Jun 18, 2024
@trask
Copy link
Member

trask commented Jun 18, 2024

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.

logging a warning in this case makes sense to me

@trask trask added enhancement New feature or request contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome and removed bug Something isn't working needs triage New issue that requires triage labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants