Send Java application data to Observe

Compatibility

Java 8+

Get the Observe Agent

Install the Observe agent in your environment.

Add the OpenTelemetry zero-code instrumentation for Java

The instrumentation is packaged as a JAR file which dynamically injects bytecode to capture telemetry from your Java applications:

curl -L -O https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar

Configure the instrumentation

Set the following environment variables:

Environment variable

Value

OTEL_SERVICE_NAME

your service name

JAVA_TOOL_OPTIONS

-javaagent:path/to/opentelemetry-javaagent.jar

Run your instrumented app

java -jar /path/to/myapp.jar

Next steps

Troubleshooting

If your data is not showing up in Observe, first verify that Observe Agent is receiving data from your application. See Troubleshooting the Observe Agent.

Common reasons why the Observe agent is not receiving traces from your application:

Default exporter settings override

By default, OpenTelemetry instrumentation exports data using standard OTLP settings, which are automatically compatible with the Observe Agent’s default receiver configuration.

This means that data from your application might not be reaching the Observe Agent if you have overridden the following environment variables with non-default settings:

  • OTEL_EXPORTER_OTLP_ENDPOINT

  • OTEL_EXPORTER_OTLP_TRACES_ENDPOINT

  • OTEL_EXPORTER_OTLP_METRICS_ENDPOINT

  • OTEL_EXPORTER_OTLP_LOGS_ENDPOINT

Ensure these variables are unset or set to the correct endpoint (e.g., http://localhost:4317 for gRPC or http://localhost:4318 for HTTP).

Ports blocked by firewall

Ensure that any firewalls within the same network as your app and collector are configured to allow traffic on ports 4317 and 4318. The application instrumentation uses these ports to communicate with the Observe agent.