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 relabel ignored #2961

Open
milosgajdos opened this issue May 16, 2024 · 1 comment
Open

Metric relabel ignored #2961

milosgajdos opened this issue May 16, 2024 · 1 comment

Comments

@milosgajdos
Copy link

Component(s)

collector

Describe the issue you're reporting

We have a small EKS cluster that runs kube-state-metrics for reporting the metrics from it.

The metrics are scraped by adot collector which has the following scrape config (the rest of the config is omitted):

receivers:
  prometheus:
    config:
      global:
        scrape_interval: 1m
        scrape_timeout: 40s

      scrape_configs:
      - job_name: 'kube-state-metrics'
        kubernetes_sd_configs:
          - role: endpoints
        relabel_configs:
          - source_labels: [__meta_kubernetes_service_name]
            regex: kube-state-metrics
            action: keep
          - target_label: cluster
            replacement: our-cluster-name

This should add cluter="cluster-name" label to every metric scraped from kube-state-metrics job alas, it's completely ignored for some reason.

Other things we've tried:

          scrape_configs:
          - job_name: 'kube-state-metrics'
            kubernetes_sd_configs:
              - role: endpoints
            relabel_configs:
              - source_labels: [__meta_kubernetes_service_name]
                regex: kube-state-metrics
                action: keep
            metric_relabel_configs:
              - target_label: cluster
                replacement: our-cluster-name

I am not sure if this is a bug or if we are missing something here, but this seems like it should work as it works for other prometheus scrapers. Equally, if you check https://relabeler.promlabs.com/ this should add the cluster label in. If anyone has any ideas that'd be greatly appreciated!

@pavolloffay
Copy link
Member

This might be a bug in the prometheus receiver which should be reported in https://github.com/open-telemetry/opentelemetry-collector-contrib/

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