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

OpenTelemetry Java Agent fails to start with AWS Resource Provider in 2.13.0 #13412

Closed
hluotola-paf opened this issue Feb 27, 2025 · 5 comments
Closed
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@hluotola-paf
Copy link

Describe the bug

When upgrading the OpenTelemetry Java agent from 2.12.0 to 2.13.0 (or 2.13.1), the following exception occurs, causing the agent to fail during startup:

OpenTelemetry Javaagent failed to start
at io.opentelemetry.javaagent.bootstrap.AgentInitializer$1.run(AgentInitializer.java:54)
at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:101)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:110)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:160)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installOpenTelemetrySdk(OpenTelemetryInstaller.java:29)
at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:439)
at io.opentelemetry.sdk.autoconfigure.ResourceConfiguration.configureResource(ResourceConfiguration.java:142)
at io.opentelemetry.contrib.aws.resource.EcsResourceProvider.createResource(EcsResourceProvider.java:16)
at io.opentelemetry.contrib.aws.resource.EcsResource.<clinit>(EcsResource.java:58)
at io.opentelemetry.contrib.aws.resource.EcsResource.buildResource(EcsResource.java:69)
at io.opentelemetry.contrib.aws.resource.EcsResource.buildResource(EcsResource.java:79)
at io.opentelemetry.contrib.aws.resource.EcsResource.fetchMetadata(EcsResource.java:100)
at io.opentelemetry.contrib.aws.resource.EcsResource.parseResponse(EcsResource.java:196)
java.lang.NoClassDefFoundError: io/opentelemetry/javaagent/shaded/io/opentelemetry/semconv/ResourceAttributes
... 22 more
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at io.opentelemetry.javaagent.bootstrap.AgentClassLoader.loadClass(AgentClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
Caused by: java.lang.ClassNotFoundException: io.opentelemetry.javaagent.shaded.io.opentelemetry.semconv.ResourceAttributes
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:572)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:560)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:45)
at io.opentelemetry.javaagent.OpenTelemetryAgent.startAgent(OpenTelemetryAgent.java:57)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:47)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.execute(AgentInitializer.java:70)

The issue only occurs when the AWS Resource Provider is enabled (via system property otel.resource.providers.aws.enabled or env variable OTEL_RESOURCE_PROVIDERS_AWS_ENABLED).

Steps to reproduce

Use java-agent 2.13.0 or 2.13.1 and enable AWS Resource Provider via system property or environment variable.

Expected behavior

The agent should start normally.

Actual behavior

The agent fails to start, and no telemetry signals (traces, metrics, logs) are sent.

Javaagent or library instrumentation version

v2.13.0, v2.13.1

Environment

amazoncorretto/amazoncorretto:21.0.6-al2023-headless, spring-boot 3.4.3.

Additional context

No response

@hluotola-paf hluotola-paf added bug Something isn't working needs triage New issue that requires triage labels Feb 27, 2025
@laurit
Copy link
Contributor

laurit commented Feb 27, 2025

This looks like a problem with the aws resource provider not the agent. Please use a newer version of the aws resource provider.

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Feb 27, 2025
@hluotola-paf
Copy link
Author

This looks like a problem with the aws resource provider not the agent. Please use a newer version of the aws resource provider.

How to do that? It seems to be bundled in tested agent.jar: https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.13.1/opentelemetry-javaagent.jar.

@github-actions github-actions bot removed the needs author feedback Waiting for additional feedback from the author label Feb 27, 2025
@laurit
Copy link
Contributor

laurit commented Feb 27, 2025

How to do that? It seems to be bundled in tested agent.jar: https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.13.1/opentelemetry-javaagent.jar.

Sorry, for some reason I thought that this had to be added as an extension. We'll have to do a patch release to fix it by including an updated aws resource provider in the agent. cc @trask

@trask
Copy link
Member

trask commented Feb 28, 2025

I kicked off the backport: #13420

Let's leave this issue open until we have a chance to add some kind of a test for this.

@hluotola-paf
Copy link
Author

Confirmed. v2.13.3 is working as expected.

@trask trask closed this as completed Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

3 participants