Help Docs

Instrument Java application for OpenTelemetry

To monitor your Java application with Site24x7 OpenTelemetry, follow the steps below.

Step 1:
Download the opentelemetry-collector.jar file. This jar file contains the agent and all instrumentation packages.

Step 2:
Export the agent through JAVA_OPTS by adding the following code snippet to the application's startup file.

export JAVA_OPTS= "$JAVA_OPTS \
-Dotel.traces.exporter=otlp \
-Dotel.exporter.otlp.traces.endpoint=https://otel.site24x7rum.com:4318 \
-Dotel.metrics.exporter=otlp \
-Dotel.resource.attributes="service.name=<service_name>" \
-Dotel.javaagent.debug=false \
-javaagent:PATH/TO/opentelemetry-javaagent.jar"
Note

  • Replace the service_name with the name of your application.
  • Define the correct endpoint and license key to make sure your data arrives where it should be.

Step 3:
Run your application.

You are all set. Now the agent will start sending the performance metrics to your Site24x7 web client portal.

Was this document helpful?

Would you like to help us improve our documents? Tell us what you think we could do better.


We're sorry to hear that you're not satisfied with the document. We'd love to learn what we could do to improve the experience.


Thanks for taking the time to share your feedback. We'll use your feedback to improve our online help resources.

Shortlink has been copied!