Auto instrument your Java application using opentelemetry-java-instrumentation and send traces to Aspecto's collector.
Download the latest Java agent 'JAR' from the official repo in github and copy the opentelemetry-javaagent-all.jar
file to your project.
You'll need to set up the following environment variables to export traces to Aspecto:
OTEL_SERVICE_NAME
- set to the name of the serviceOTEL_EXPORTER_OTLP_HEADERS
- set toAuthorization=${YOUR_ASPECTO_TOKEN}
. You can get your token here.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
- set tohttps://otelcol.aspecto.io:4317
Once finished, load the agent to your application using the -javaagent
option:
java -javaagent:/path/to/the/downloaded/opentelemetry-javaagent-all.jar -jar your-app.jar