prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metric name "_info" suffix gets trimmed

iagotomas opened this issue · comments

Hi,
trying to implement a ruleset for some service, running jmx_exporter 1.0.1 as standalone I'm facing a weird issue which I'm not sure I understand.
I have the following rule for which the "_info" suffix in the name gets dropped. If I employ another suffix or add additional characters to the suffix "_info" it remains.

rules:
  #metrics:name=jvmInfo.runtime.{runtime}.vendor.{vendor}.version.{version},type=gauges
  - pattern: 'metrics<name=jvmInfo\.runtime\.(.+)\.vendor\.(.+)\.version\.(.*), type=gauges><>Value'
    labels:
      runtime: $1
      vendor: $2
      version: $3
    type: UNTYPED
    name: jvm_runtime_info
    help: "JVM info"

Resulting metric name:
jvm_runtime{runtime="OpenJDK_Runtime_Environment",vendor="Amazon.com_Inc.",version="17.0.7+7-LTS"} 1.0

Why does "_info" get removed from the name?

The relevant code is here...

PrometheusNaming.sanitizeMetricName(this.name),

@fstab, do you remember the specifics around why we sanitize the name?