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

not getting all the labels when using alloy for scraping metrics w.r.t pods #2895

Open
navnitkum opened this issue Mar 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@navnitkum
Copy link

What's wrong?

hi team
i need some help
i am using https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.cadvisor/
but when i am trying to see the metrics
container_cpu_usage_seconds_total
i am getting metrics as below
{name="container_cpu_usage_seconds_total", cluster_name="lip-mgmt-sre", cpu="total", environment="mgmt", id="/kubepods.slice/kubepods-besteffort.slice/kubepods-besteffort-pod0775ee54_2271_484a_a9fe_e3a717250b9e.slice", instance="gke-lip-mgmt-sre-clu-sre-1-30-11-gke--26d5377f-vioe", job="integrations/cadvisor"}
which doesnt contain the pod name
can anyone help how to get the pod name??
prometheus.exporter.cadvisor "pods" {}

// Configure a prometheus.scrape component to collect cadvisor metrics.
prometheus.scrape "scraper" {
targets = prometheus.exporter.cadvisor.pods.targets
forward_to = [ prometheus.relabel.default.receiver ]
}
above is my config

Steps to reproduce

deploy alloy with the below config

prometheus.exporter.cadvisor "pods" {}

// Configure a prometheus.scrape component to collect cadvisor metrics.
prometheus.scrape "scraper" {
  targets    = prometheus.exporter.cadvisor.pods.targets
  forward_to = [ prometheus.relabel.default.receiver ]
}

System information

No response

Software version

No response

Configuration


Logs


@navnitkum navnitkum added the bug Something isn't working label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant