MyObservability

Automatic Instrumentation

Without being required to modify the source code you can collect telemetry from an application using automatic instrumentation.

Zero-code instrumentation adds the OpenTelemetry API and SDK capabilities to your application typically as an agent or agent-like installation.

Ex:Java Based Application instrumentation

Step:1 - Download OpenTelemetry Java Agent

opentelemetry-javaagent.jar from Releases of the pentelemetry-java-instrumentation repository and place the JAR in your preferred directory. The JAR file contains the agent and instrumentation libraries.

Step:2 - Configuring the agent

You can pass configuration properties via the -D flag.

java -javaagent:path/to/opentelemetry-javaagent.jar \
     -Dotel.service.name=your-service-name \
     -Dotel.traces.exporter=zipkin \
     -jar myapp.jar

————————- OR —————————-

You can also environment variables to configure the agent:

  1. Configure Environment variable
export OTEL_LOGS_EXPORTER="none"
export OTEL_METRICS_EXPORTER="none"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_SERVICE_NAME=your-service-name \
export OTEL_TRACES_EXPORTER=zipkin
  1. Configure agent: java -javaagent:path/to/opentelemetry-javaagent.jar -jar myapp.jar

Next Chapter: Sampling

Main Page: Click Here