|
Running DCGM exporter as a DaemonSet on k3s. What is the cleanest way to get its metrics scraped: a ServiceMonitor via the Prometheus operator, or a plain scrape-config annotation? I want per-GPU labels (uuid, model) to survive into Grafana without manual relabeling. Curious what this lab does. |
Answered by
iacker
Jul 10, 2026
Replies: 1 comment
|
Use a ServiceMonitor with the Prometheus operator rather than scrape annotations. Steps that work cleanly on k3s:
Annotation-based scraping also works but you lose the operators native target management and have to relabel by hand, so the ServiceMonitor path is the one this lab standardizes on. |
0 replies
Answer selected by
iacker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use a ServiceMonitor with the Prometheus operator rather than scrape annotations.
Steps that work cleanly on k3s:
metrics).honorLabels: trueso exporter-provided labels win.gpu,UUID,modelName,Hostnamelabels per metric — with honorLabels they flow straight into Prometheus, no manual relabeling.$gpuvariable onlabel_values(DCGM_FI_DEV_GPU_UTIL, gpu)and key panels off UUID.Annotation-based scraping also works but you lose the operators native target management and have to relabel by hand, so the ServiceM…