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

Version mismatch in gcp-common and google.cloud.opentelemetry:exporter-auto #1127

Closed
debrutal opened this issue May 30, 2024 · 0 comments
Closed

Comments

@debrutal
Copy link

debrutal commented May 30, 2024

Expected Behavior

Using Micronaut Platform version 4.4.3 with Open Telemetry exporters as described here using

<dependency>
    <groupId>com.google.cloud.opentelemetry</groupId>
    <artifactId>exporter-auto</artifactId>
</dependency>

should work as expected and not throw an exception.

Actual Behaviour

Application starts as expected.
After a few seconds it renders the following Exception:

Exception in thread "BatchSpanProcessor_WorkerThread-1" java.lang.AbstractMethodError: Receiver class com.google.api.gax.grpc.GrpcCallContext does not define or inherit an implementation of the resolved method 'abstract com.google.api.gax.rpc.ApiCallContext withEndpointContext(com.google.api.gax.rpc.EndpointContext)' of interface com.google.api.gax.rpc.ApiCallContext.
	at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:233)
	at com.google.cloud.trace.v2.stub.GrpcTraceServiceStub.create(GrpcTraceServiceStub.java:71)
	at com.google.cloud.trace.v2.stub.TraceServiceStubSettings.createStub(TraceServiceStubSettings.java:112)
	at com.google.cloud.trace.v2.TraceServiceClient.<init>(TraceServiceClient.java:160)
	at com.google.cloud.trace.v2.TraceServiceClient.create(TraceServiceClient.java:142)
	at com.google.cloud.opentelemetry.trace.InternalTraceExporter.createWithConfiguration(InternalTraceExporter.java:103)
	at com.google.cloud.opentelemetry.trace.TraceExporter.lambda$new$0(TraceExporter.java:41)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:186)
	at com.google.cloud.opentelemetry.trace.TraceExporter.export(TraceExporter.java:93)
	at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.exportCurrentBatch(BatchSpanProcessor.java:331)
	at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.run(BatchSpanProcessor.java:249)
	at java.base/java.lang.Thread.run(Thread.java:840)

This is due to a mismatch in transitive dependencies of

com.google.api:gax-grpc micronaut-projects/micronaut-core # 2.37.0
com.google.api:gax # 2.46.1

gax contains an Interface(ApiCallContext) that implements the mentioned method. gax-grpc contains a class (GrpcCallContext) implementing that interface. Due to the old version, it does not implement the method.

Dependency tree:

+- com.google.cloud.opentelemetry:exporter-auto:jar:0.29.0-alpha:compile
   +- com.google.cloud.opentelemetry:exporter-metrics:jar:0.29.0:runtime
      +- com.google.cloud:google-cloud-monitoring:jar:3.31.0:runtime
         +- com.google.api:gax-grpc:jar:2.37.0:runtime
io.micronaut.gcp:micronaut-gcp-common:jar:5.5.0:compile
  +- com.google.cloud:google-cloud-core:jar:2.36.1:compile
     +- com.google.api:gax:jar:2.46.1:compile        # 2.46.1

Steps To Reproduce

For some reason i cannot reproduce this behaviour in a default micronaut setup.

The closest i can imagine that is needed to do it is this. No matter the reproducibility, the mismatch existst

mvn cli:

applicationType: default
defaultPackage: com.example
testFramework: junit
sourceLanguage: java
buildTool: maven
features: [app-name, gcp-cloud-trace, http-client-test, java, java-application, junit, logback, maven, maven-enforcer-plugin, micronaut-aot, micronaut-http-validation, netty-server, properties, readme, serialization-jackson, shade, static-resources, tracing-opentelemetry-annotations, tracing-opentelemetry-exporter-gcp, tracing-opentelemetry-gcp, tracing-opentelemetry-http]

plus the mentioned exporter

com.google.cloud.opentelemetry exporter-auto

Environment Information

No response

Example Application

No response

Version

4.4.3

@debrutal debrutal changed the title Version mismatch in gcp-common and Version mismatch in gcp-common and google.cloud.opentelemetry:exporter-auto May 30, 2024
@graemerocher graemerocher transferred this issue from micronaut-projects/micronaut-core May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant