OpenTelemetry mode
OpenTelemetry mode periodically collects metrics and pushes them to an OpenTelemetry endpoint.
java -javaagent:jmx_prometheus_javaagent-<VERSION>.jar=<EXPORTER.YAML> -jar <YOUR_APPLICATION.JAR>
java -javaagent:jmx_prometheus_javaagent-1.1.0.jar=exporter.yaml -jar <YOUR_APPLICATION.JAR>
Notes
- No
<HOSTNAME>
or<PORT>
is used
exporter.yaml
openTelemetry:
endpoint: http://prometheus:9090/api/v1/otlp
protocol: http/protobuf
interval: 60
rules:
- pattern: ".*"
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: ".*"
Run your application.
Access OpenTelemetry metrics using your OpenTelemetry platform.
Integration tests provide complex/concrete examples of application and YAML configuration files.