Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric name "_info" suffix gets trimmed #982

Open
iagotomas opened this issue Jun 29, 2024 · 2 comments
Open

Metric name "_info" suffix gets trimmed #982

iagotomas opened this issue Jun 29, 2024 · 2 comments
Assignees

Comments

@iagotomas
Copy link

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?

@dhoard dhoard self-assigned this Jul 1, 2024
@dhoard
Copy link
Collaborator

dhoard commented Jul 1, 2024

The relevant code is here...

PrometheusNaming.sanitizeMetricName(this.name),

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

@dhoard
Copy link
Collaborator

dhoard commented Oct 31, 2024

@fstab The code change was introduced as part of metric name collision work.

Do you remember the specifics?
Is it necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants