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

GCP tracing documentation discrepancy and dependency mismatch #1068

Open
turneand opened this issue Mar 5, 2024 · 0 comments
Open

GCP tracing documentation discrepancy and dependency mismatch #1068

turneand opened this issue Mar 5, 2024 · 0 comments

Comments

@turneand
Copy link

turneand commented Mar 5, 2024

Expected Behavior

Documentation should be consistent, and work without issue

Actual Behaviour

We're trying to implement tracing in a GCP deployed application and have hit two related issues (can raise as separate tickets if that helps?)

The documentation on https://micronaut-projects.github.io/micronaut-gcp/latest/guide/#tracing indicates to use "micronaut-gcp-tracing", which we had working for http methods but not self-defined ones (presumed some annotation processor missing), so tried to follow through to the guide linked from those docs -> https://guides.micronaut.io/latest/micronaut-cloud-trace-google.html but this defines a completely different implementation using the otel libraries plus googles exporter-auto library.

So, which one should be used, as new implementation would rather not follow an approach if it's due to be removed? Can the documentation be updated to make it clearer?

The second issue was when following the guide, we had incompatibilities flagged up due to the guava versions imported.

Exception in thread "BaseSpanProcessor_WorkerThread-1" java.lang.IncompatibleClassChangeError: Class com.google.common.base.Suppliers$NonSerializableMemoizingSupplier does not implement the requested interface java.util.function.Suppliers$NonSerializableMemoizingSupplier
    at com.google.cloud.opentelemetry.trace.TraceExporter.export(TraceExporter.java:93)
	at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.exportCurrentBatch(BatchSpanProcessor.java:327)
	at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.run(BatchSpanProcessor.java:245)

It took a while, but ultimately the issue is because we had the following defined in our dependencies, which ultimately puts guava 32.0.0-android on the classpath. In order to workaround we've had to explicitly define guava to be a jre version to fix the above issue, as unfortunately also bring in things like cloud-sql-connector-r2dbc-postgres which also brings in guava android version. Can anything be done to ensure the jre version of guava is always imported rather than the android version?

<dependencies>
  <dependency>
    <groupId>io.micronaut.gcp</groupId>
	<artifactId>micronaut-gcp-logging</artifactId>
	<!-- this exposes guava 32.0.0-android -->
  </dependency>

  <dependency>
    <groupId>com.google.cloud.opentelemetry</groupId>
	<artifactId>exporter-auto</artifactId>
	<!-- this exposes guava 32.1.3-jre -->
  </dependency>
</dependencies>

Steps To Reproduce

See Actual Behaviour section above

Environment Information

Windows/Unix

Example Application

n/a

Version

4.3.4

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