Skip to main content
Next

OpenTelemetry

OpenTelemetry export is enabled when the exporter YAML contains an openTelemetry section. If the section is absent, no OpenTelemetry exporter is started.

Configuration fields​

FieldDescription
endpointOptional URL for the OpenTelemetry endpoint.
protocolOptional protocol string passed to the OpenTelemetry exporter.
intervalOptional export interval in seconds. Must be greater than zero.
timeoutSecondsOptional timeout in seconds. Must be greater than zero.
headersOptional map of string headers.
resourceAttributesOptional map of string resource attributes.
serviceInstanceIdOptional non-blank service instance id.
serviceNamespaceOptional non-blank service namespace.
serviceNameOptional non-blank service name.
serviceVersionOptional non-blank service version.
preserveNamesOptional boolean. When true, metric names are preserved as-is (including _total suffixes). When false (the default), standard OpenTelemetry name normalization is applied.

OpenTelemetry-only Java agent​

java -javaagent:jmx_prometheus_javaagent-1.7.0.jar=exporter.yaml -jar your-application.jar
openTelemetry:
endpoint: http://localhost:4317
protocol: grpc
interval: 60
timeoutSeconds: 30
rules:
- pattern: ".*"

OpenTelemetry-only standalone​

java -jar jmx_prometheus_standalone-1.7.0.jar exporter.yaml
hostPort: application.example.com:9999
openTelemetry:
endpoint: http://localhost:4317
rules:
- pattern: ".*"

Combined mode​

java -javaagent:jmx_prometheus_javaagent-1.7.0.jar=9404:exporter.yaml -jar your-application.jar
openTelemetry:
endpoint: http://localhost:4317
protocol: grpc
headers:
Authorization: Bearer token
resourceAttributes:
service.name: jmx-exporter
serviceInstanceId: instance-001
serviceNamespace: prometheus
serviceName: jmx-exporter
serviceVersion: "1.7.0"
rules:
- pattern: ".*"