Skip to main content

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

  1. Download opentelemetry-javaagent.jar from opentelemetry-java Releases.

  2. Download mesmer-otel-extension.jar from mesmer Releases.

  3. 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.jar

    If you starting your application using sbt run you also can update your build.sbt with the following settings:

    run / fork := true
    run / javaOptions ++= Seq(
  4. 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