How to scrape and use kube-state-metrics #997
Unanswered
fischerman
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hey 👋 Do you mean scrapping kube-state-metrics if it's shared with multiple replicas/instances? Maybe you can clarify the use case here, thank you! |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I haven't found a good reference on scraping from kube-state-metrics. kube-prometheus uses a service monitor which scrapes all the endpoints of the service. Hence, if kube-state-metrics runs replicated the metrics are scraped multiple times with different instance labels. Even with one replica the instance label changes over time. How do I write queries and alerts without having to constantly (pseudo-)aggregate over all instances?
kube-state-metrics exposes service-level metrics and therefore I would also scrape them through a service (i.e. one instance per Kubernetes cluster backed by multiple pods for HA). Or is there a good reason to scrape directly from the pods? Scraping from services is possible in Prometheus but AFAIK not that easy using the Prometheus operator. Despite it's name a service monitor doesn't scrape a service.
Beta Was this translation helpful? Give feedback.
All reactions