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.