Closed induslevel closed 8 months ago
Hi @induslevel,
Thank you for providing the configuration details along with the stacktrace.
To answer your questions,
OpenTelemetry Java Agent by default only recognizes a few values for -Dotel.traces.exporter
flag. The recognized exporters are mentioned on the OpenTelemetry documentation. As you can see, google_cloud_trace
is not one of the known exporters. To export your traces using the google_cloud_trace
exporter, you need to first add it as an extension to the agent. This is explained in the Autoinstrumentation setup instructions. (This step is further expanded upon in the answer to your third question).
At the time of writing the documentation for our exporters, the OpenTelemetry Java agent was published with -all
suffix. For instance, look at the assets published along with the release of v1.5.0 of the opentelemetry-java-instrumentation. We will update the documentation to reflect the change to the name of published agent artifact.
This argument configures the OpenTelemetry Java Agent to use the Google Cloud Auto-exporter as a Java agent extension. Extensions allow us to modify or override the agent's capability in some fashion. In short, adding Google Cloud Auto-Exporter
jar as an extension to the Java Agent provides the agent with the capability to export to Google Cloud.
google_cloud_trace
as a recognized value in -Dotel.traces.exporter
) For your arguments being passed to the agent, could you try adding -Dotel.javaagent.extensions=<path to the auto-exporter shaded jar>
?
The instructions for this are mentioned in the README for auto exporter.
@induslevel is this working for you now?
Yes. I was able to see exported trace.
java -javaagent:opentelemetry-2.1.0.jar \
-Dotel.javaagent.extensions=exporter-auto-0.26.0-alpha-shaded.jar \
-Dotel.traces.exporter=google_cloud_trace \
-Dotel.metrics.exporter=google_cloud_monitoring \
-DGOOGLE_CLOUD_PROJECT=XXXXXXXX \
-DGOOGLE_APPLICATION_CREDENTIALS=/root/.config/gcloud/application_default_credentials.json \
-Dotel.javaagent.debug=true \
-Dhelloworld.port=8000 \
-jar HelloWorld.jar
You can mark this issue as resolved. Thank you so much for your support.
I am following the public documentation to setup auto instrumentation of a test application.
I am getting Error Unrecognized value for otel.traces.exporter: google_cloud_trace
Here are the arguments that I am using for running the jar file
I am getting the following error
Questions: Q1: Is there any step missing in documentation to configure the application to send traces to Cloud trace?
Q2: The documentation mentioned "opentelemetry-javaagent--all.jar" whereas official link [8] downloads the agent with name "opentelemetry-javaagent.jar" (i.e. without -all)
Is this gap in documentation or is there any other link/repo from where we can download this agent?
Q3: What is the purpose of following argument in the documentation