-
Notifications
You must be signed in to change notification settings - Fork 99
Description
The following line uses a deprecated / moved dependency.
https://github.com/googleapis/java-pubsub/blob/main/google-cloud-pubsub/pom.xml#L113
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-semconv</artifactId>
</dependency>
which should be
<dependency>
<groupId>io.opentelemetry.semconv</groupId>
<artifactId>opentelemetry-semconv</artifactId>
</dependency>
also internally some resources changed, so Classes like ResourceAttributes has been moved from
package io.opentelemetry.semconv.resource.attributes;
More infos can be seen on maven-central
This leads to issues in other frameworks like Micronaut using micronaut-gcp-common and micronaut-gcp-pubsub to NoClassDefFoundErrors
Environment details
- Specify the API at the beginning of the title. For example, "BigQuery: ...").
General, Core, and Other are also allowed as types - OS type and version: Any ( Cloud Run instance)
- Java version: java 21.0.5 2024-10-15 LTS
- version(s): v1.142.0
Steps to reproduce
I could not dense it down to a direct library use.
- Create a new Micronaut project
2. micronaut.io/launch -> features: gcp-commons, gcp-cloud-trace, gcp-pubsub - let it run inside a cloud run instance
- upon metric send this error should occur
Code example
Using Micronaut implicitly calls the tracing part. Not sure how.
Stack trace
like
java.lang.NoClassDefFoundError: io/opentelemetry/semconv/ResourceAttributes
at com.google.cloud.opentelemetry.trace.TraceVersions.readSdkVersion ( com/google.cloud.opentelemetry.trace/TraceVersions.java:32 )
at com.google.cloud.opentelemetry.trace.TraceVersions.<clinit> ( com/google.cloud.opentelemetry.trace/TraceVersions.java:27 )
at com.google.cloud.opentelemetry.trace.InternalTraceExporter.<clinit> ( com/google.cloud.opentelemetry.trace/InternalTraceExporter.java:56 )
at com.google.cloud.opentelemetry.trace.TraceExporter.lambda$new$0 ( com/google.cloud.opentelemetry.trace/TraceExporter.java:41 )
at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get ( com/google.common.base/Suppliers.java:200 )
at com.google.cloud.opentelemetry.trace.TraceExporter.export ( com/google.cloud.opentelemetry.trace/TraceExporter.java:93 )
at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.exportCurrentBatch ( io/opentelemetry.sdk.trace.export/BatchSpanProcessor.java:340 )
at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.run ( io/opentelemetry.sdk.trace.export/BatchSpanProcessor.java:258 )
at java.lang.Thread.run ( java/lang/Thread.java:1583 )
Caused by: java.lang.ClassNotFoundException
at jdk.internal.loader.BuiltinClassLoader.loadClass ( BuiltinClassLoader.java:641 )
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass ( ClassLoaders.java:188 )
at java.lang.ClassLoader.loadClass ( ClassLoader.java:526 )
External references such as API reference guides
Any additional information below
I could not get into how exactly micronaut is using gcp libraries. Since there is some dynamic invocation (probably some dynamic proxies or something), it is hard to say where exactly the Class ResourceAttributes is actually used/in