Closed MateuszGawel closed 3 weeks ago
Hi @MateuszGawel,
io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: Unrecognized value for otel.metrics.exporter: google_cloud_monitoring
Would mean that the auto-exporter jar is not being loaded properly as an agent extension by the process.
I believe the issue here is that the auto-exporter shaded dependency is being downloaded in a different location and when you provide it using
-Dotel.javaagent.extensions=opentelemetry-operations-java-auto.jar
In this case, it's looking for a jar named opentelemetry-operations-java-auto
in the current directory and probably not finding it.
I think you might have to copy this downloaded dependency to a specific location and then you can provide it as an argument to the Java command.
I have not used maven in a while, but the way you would do this in gradle is shown in autoinstrument example.
Notice the copyAgent task that copies both the OpenTelemetry Java Agent and GCP Auto Exporter extension into a directory named otelagent
.
Then the jib
task includes this otelagent
directory as an extraDirectory within the container image, making the contents available within the image.
jib
is a gradle plugin (also available for Maven) that builds optimized docker images for your Java applications. You can try using it in your case and eliminate the need of a Dockerfile entirely.
Note: jib
sets the default entrypoint as the Java command, but allows you to override it though in your case you may not require it.
Marking this issue as fixed, assuming the information in the comment above has resolved the question.
Please feel free to re-open the issue if that is not the case.
I followed https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/blob/6455156e9d97eb882f9cca020387ad3cdb525b2e/exporters/auto/README.md
and in GCP I still see:
io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: Unrecognized value for otel.metrics.exporter: google_cloud_monitoring
when I manuall add: