Questions tagged [kube-state-metrics]
50 questions
                    
                    17
                    
            votes
                
                1 answer
            
        Kube-state-metrics error: Failed to create client: ... i/o timeout
I'm running Kubernetes in virtual machines and going through the basic tutorials, currently Add logging and metrics to the PHP / Redis Guestbook example. I'm trying to install kube-state-metrics:
git clone…
        
        Rafał G.
        
- 1,529
 - 22
 - 35
 
                    15
                    
            votes
                
                2 answers
            
        Omit labels from series results PromQL
Suppose I write a basic PromQL query like this 
Query:
kube_deployment_spec_replicas{}…
        
        Edward
        
- 153
 - 1
 - 1
 - 6
 
                    5
                    
            votes
                
                3 answers
            
        PromQL to graph number of Kubernetes PODs created per Hour
I'm using Kubernetes with kube-state-metrics and Prometheus/grafana to graph various metrics of the Kubernetes Cluster.
Now I'd like to Graph how many new PODs have been created per Hour over Time.
The Metric kube_pod_created contains the…
        
        powo
        
- 460
 - 1
 - 6
 - 17
 
                    4
                    
            votes
                
                1 answer
            
        What is the difference among kubernetes_sd_config (within prometheus) and metrics-server and kube-state-metrics?
I've read some pages about monitoring k8s, and I found kubernetes_sd_config (within prometheus), metrics-server (took the place of heapster) and kube-state-metrics. All of them could provides metrics, but what's the difference? 
Does…
        
        woshilaiceshide
        
- 43
 - 1
 - 5
 
                    4
                    
            votes
                
                1 answer
            
        How to calculate cpu usage of pod in kube state metrics?
I monitor the eks cluster using both the kubernetes api and the kube state metrics remotely using prometheus.
in Kubernetes api we have a metrics container_cpu_usage_seconds_total which gives the cpu usage of the pod.
is there a similar metrics in…
        
        Amjad Hussain Syed
        
- 994
 - 2
 - 11
 - 23
 
                    3
                    
            votes
                
                0 answers
            
        Using Kube-state-metrics in prometheus to get the total number of containers running on a node
kube-state-metrics allows me to find the number of pods running on each node by running 
sum by (node) (kube_pod_info)
I can get the number of containers in every pod by running 
sum by (pod) (kube_pod_container_info)
However, the…
        
        Jatinshravan
        
- 435
 - 3
 - 16
 
                    3
                    
            votes
                
                1 answer
            
        Duplicate metrics with multiple instances of kube-state-metrics
Problem:
Duplicate data when querying from prometheus for metrics from kube-state-metrics.
Sample query and result with 3 instances of kube-state-metrics…
        
        Shinto C V
        
- 714
 - 1
 - 9
 - 16
 
                    3
                    
            votes
                
                1 answer
            
        How to install and configure kube-state-metrics for external prometheus serverto monitor kubernetes
How to install and configure kube-state-metrics to monitor kubernetes on external/separate/centralized prometheus server.
I came across some articles that pointed me to kube-state-metrics but am not sure where i need to run the kube-state-metrics 
I…
        
        sri05
        
- 185
 - 3
 - 12
 
                    3
                    
            votes
                
                1 answer
            
        alert when pod is restarted: Prometheus on windows containers
I have Prometheus setup for Windows containers which scrapes the metrics supported by the wmi_exporter. But I wanted some metrics that track the pod restarts, etc which are not part of that. I believe kube-state-metrics offers this functionality.…
        
        sai guru datt manchikanti
        
- 129
 - 1
 - 11
 
                    3
                    
            votes
                
                5 answers
            
        Prometheus many-to-many problem for kube cronjobs
Hy there,
I'm trying to configure Kubernetes Cronjobs monitoring & alerts with Prometheus. I found this helpful guide
But I always get a many-to-many matching not allowed: matching labels must be unique on one side error. 
For example, this is the…
        
        hajowieland
        
- 41
 - 1
 - 6
 
                    3
                    
            votes
                
                1 answer
            
        Prometheus kube_pod_container_status_waiting_reason not capturing pod CrashLoopBackOff reason
By definition, kube_pod_container_status_waiting_reason is supposed to capture  reasons for a pod in Waiting status.
I have several pods in my kubernetes cluster which are in CrashLoopBackOff but I dont see that reason captured by…
        
        Preeti V
        
- 93
 - 2
 - 9
 
                    2
                    
            votes
                
                0 answers
            
        AWS CloudWatch Metric and Kube state metric, list pod in failed phase
I run Kube under EKS on AWS. I wish to alert when enough pod under from a deployement are in a failed phase. I do have prometheus, but I need the alerte to be in CloudWatch, therefore I am exporting the metric to CloudWatch thanks to the CW Agent.
I…
        
        Djoby
        
- 602
 - 1
 - 6
 - 22
 
                    2
                    
            votes
                
                2 answers
            
        How can we include custom labels/annotations of K8s objects in Prometheus metrics?
For example I have StatefulSet with custom labels/annotations applied on it.
Everyone mentions these two metrics should be used, because kube-state-metrics should generate labels/annotations as…
        
        Ivan Aracki
        
- 4,861
 - 11
 - 59
 - 73
 
                    2
                    
            votes
                
                0 answers
            
        Missing Kube State Metrics in remote write with Prometheus
Hey I'm currently trying to determine uptime of a pod with kube state metrics, specifically when a pod has started or stopped. I am using a Prometheus Deployment with Kube State metrics in order to determine when a pod has been started and…
        
        Daniel Wasserlauf
        
- 33
 - 6
 
                    2
                    
            votes
                
                0 answers
            
        How to display only positive change in Grafana graph?
I am using kube-stats-metrics with kube_pod_container_status_last_terminated_reason as a gauge. The gauge can be reporter for few minutes even hours. But I just want to see the change when it goes from 0 or nothing to 1.
I tried in the…
        
        Mio
        
- 1,412
 - 2
 - 19
 - 41