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

metrics name changes #30223

Closed
rootofevils opened this issue Dec 27, 2023 · 8 comments
Closed

metrics name changes #30223

rootofevils opened this issue Dec 27, 2023 · 8 comments

Comments

@rootofevils
Copy link

Component(s)

No response

Describe the issue you're reporting

I'm using promtheus jmx_exporter to monitor jmx
my otelcol config

extensions:
  health_check:

receivers:
  prometheus/jmx:
    config:
      scrape_configs:
        - job_name: 'jmx_exporter'
          scrape_interval: 15s
          static_configs:
            - targets: ["127.0.0.1:12345"]
              labels:
                metric_type: "jmx"

exporters:
  prometheus/01:
    endpoint: "0.0.0.0:8091"
    const_labels:
      host_name: "r02"

service:
  pipelines:
    metrics/01:
      receivers: [prometheus/jmx]
      exporters: [prometheus/01]

When I visit http://127.0.0.1:12345/metrics (jvm_exporter), I can find the metrics named jvm_info
image

But when I visit http://127.0.0.1:8091/metrics, what I find is the metrics named jvm.
image

I suspect otelcol processed the data, although I did not configure processors

By the way, the version of my otelcol is
otelcol-contrib version 0.91.0

@rootofevils rootofevils added the needs triage New item requiring triage label Dec 27, 2023
@Frapschen Frapschen added the receiver/jmx JMX Receiver label Dec 29, 2023
Copy link
Contributor

Pinging code owners for receiver/jmx: @rmfitzpatrick. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@Frapschen Frapschen added receiver/prometheus Prometheus receiver and removed receiver/jmx JMX Receiver labels Dec 29, 2023
Copy link
Contributor

Pinging code owners for receiver/prometheus: @Aneurysm9 @dashpole. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@Frapschen
Copy link
Contributor

I can reproduce this. I add a bug label and wait for the code owner to deep look into it.

@Frapschen Frapschen added the bug Something isn't working label Dec 29, 2023
Copy link
Contributor

github-actions bot commented Jan 2, 2024

Pinging code owners for exporter/prometheus: @Aneurysm9. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@cmergenthaler
Copy link
Contributor

I think this is expected due to normalization of prometheus metrics. If you want to disable the behaviour and keep metric names as they are, try setting add_metric_suffixes = false

@crobert-1 crobert-1 added waiting for author and removed needs triage New item requiring triage bug Something isn't working labels Jan 9, 2024
@dashpole
Copy link
Contributor

I wonder if the endpoint is scraped with OpenMetrics, rather than prometheus?

Can you try curl -H 'Accept: application/openmetrics-text' localhost:12345/metrics?

It is possible the metric name is just "jvm" in OpenMetrics.

If that is the case, you can update the prometheus config to only use the prometheus format:

global:
    scrape_protocols: [ PrometheusText0.0.4 ]

@dashpole dashpole self-assigned this Jan 31, 2024
Copy link
Contributor

github-actions bot commented Apr 1, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Apr 1, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
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

5 participants