Getting started
Here you will find instructions on how to add OpenTelemetry Agent with Mesmer extension to your application and make it export metrics to your chosen backend service.
OpenTelemetry supports exporting telemetry data with multiple different protocols. You will find the list of exporters and their configuration options here.
This guide presents steps for Prometheus and OTEL (native OpenTelemetry protocol) exporters.
Basic setup
Download opentelemetry-javaagent.jar from
opentelemetry-java
Releases.Download mesmer-otel-extension.jar from
mesmer
Releases.Run your application with OT Agent
-javaagent
and Mesmer extension-Dotel.javaagent.extensions
attached.java -javaagent:path/to/opentelemetry-javaagent.jar \
-Dotel.javaagent.extensions=path/to/mesmer-otel-extension.jar \
-jar your-app.jarIf you starting your application using
sbt run
you also can update yourbuild.sbt
with the following settings:run / fork := true
run / javaOptions ++= Seq(
"-javaagent:path/to/opentelemetry-javaagent.jar",
"-Dotel.javaagent.extensions=path/to/mesmer-otel-extension.jar",
)By default the agent configured to use OTLP exporter which pushes metrics to the OpenTelemetry collector running at
http://localhost:4317
. See the collector documentation for the configuration options.Alternatively you can configure the agent to expose the metrics with Prometheus exporter
-Dotel.metrics.exporter=prometheus
. This will make metrics available for scrapping over HTTP at default port 9464.curl -i http://localhost:9464