JMX Exporter
GitHubToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

OpenTelemetry mode

OpenTelemetry mode periodically collects metrics and pushes them to an OpenTelemetry endpoint.

Installation

Example

java -javaagent:jmx_prometheus_javaagent-<VERSION>.jar=<EXPORTER.YAML> -jar <YOUR_APPLICATION.JAR>

Concrete Example

java -javaagent:jmx_prometheus_javaagent-1.1.0.jar=exporter.yaml -jar <YOUR_APPLICATION.JAR>

Notes

  • No <HOSTNAME> or <PORT> is used

Basic YAML Configuration

exporter.yaml

openTelemetry:
  endpoint: http://prometheus:9090/api/v1/otlp
  protocol: http/protobuf
  interval: 60
rules:
- pattern: ".*"

Advanced YAML Configuration

OpenTelemetry mode also supports the use of OTEL environment variables.

exporter.yaml

openTelemetry:
  # endpoint defined via environment variable "OTEL_EXPORTER_OTLP_ENDPOINT"
  # protocol defined via environment variable "OTEL_EXPORTER_OTLP_PROTOCOL"
  # interval defined via environment variable "OTEL_METRIC_EXPORT_INTERVAL"
rules:
- pattern: ".*"

Output

Run your application.

Access OpenTelemetry metrics using your OpenTelemetry platform.

Complex YAML Configuration Examples

Integration tests provide complex/concrete examples of application and YAML configuration files.