Skip to main content
1.4.0

Rules

Rules convert scraped JMX attributes into Prometheus metric names, labels, values, and types.

Rule fields

KeyDescription
patternRegex pattern matched against the formatted MBean and attribute input. Required when name is set.
nameMetric name. Capture groups can be referenced with $1, $2, and so on.
valueStatic value or capture-group expression.
valueFactorNumeric multiplier. Default 1.0.
labelsLabel map. Requires name.
helpHelp text. Requires name.
cacheCache rule match and mismatch results. Default false.
typeGAUGE, COUNTER, or UNTYPED.
attrNameSnakeCaseConvert attribute names to snake case. Default false.
excludeJvmMetricsExclude built-in JVM MBeans from collection when set to true.

Pattern input

Rule patterns match a generated string built from the MBean ObjectName, attribute name, and value path. Use exact examples from scraped output when building production rules.

Default format

If no rule matches, attributes are exported using the default JMX Exporter naming behavior.

Example

rules:
- pattern: "java.lang<type=Memory><HeapMemoryUsage>Used"
name: jvm_memory_heap_used_bytes
type: GAUGE