Questions tagged [kube-state-metrics]

50 questions
2
votes
1 answer

Drop or rename scrape_config label

I'd love to rename or drop a label from a /metrics endpoint within my metric. The metric itself is from the kube-state-metrics application, so nothing extraordinary. The metric looks like…
zokkker13
  • 161
  • 10
2
votes
1 answer

Enable endpoints for kube-controller-manager & kube-scheduler

I am new to the kubernetes world and I am currently stuck with figuring out how to enable endpoints for kube-controller-manager & kube-scheduler. In some future, I'll be using the helm kube-prometheus-stack to scrape those endpoints for metrics.…
MaryCoding
  • 624
  • 1
  • 9
  • 31
2
votes
0 answers

How to join 2 sets of Prometheus metrics?

AKS = 1.17.9 Prometheus = 2.16.0 kube-state-metrics = 1.8.0 My use case: I want to alert when 1 of my persistent volumes are not in a "Bound" phase and only when this falls within a predefined set of namespaces. This got me to my first…
2
votes
2 answers

How to cleanup failed CronJob spawned Jobs once a more recent job passes

I am running management tasks using Kubernetes CronJobs and have Prometheus alerting on when one of the spawned Jobs fails using kube-state-metrics: kube_job_status_failed{job="kube-state-metrics"} > 0 I want to have it so that when a more recent…
2
votes
1 answer

Are Kube-state-metrics new or well formatted metrics?

I am fairly new to Kubernetes and had a question concerning kube-state-metrics. When I simply monitor Kubernetes using Prometheus I obtain a set of metrics from the cAdvisor, the nodes (node exporter), the pods, etc. When I include the…
Tony.H
  • 631
  • 1
  • 6
  • 14
2
votes
1 answer

What does _condition_ mean in metric?

In kube-state-metrics there is a metric for pods - kube_pod_status_ready that has 3 attributes pod= namespace= condition= What does condition attribute stand for? I can't find it's definition anywhere…
Ryan-Neal Mes
  • 6,003
  • 7
  • 52
  • 77
1
vote
0 answers

All the pod metrics to automatically include labels from kube_pod_labels?

I've added custom labels for kube-state-metrics by adding: --metric-labels-allowlist=deployments=[team],pods=[team] which means I can see the "label_team" label within kube_pod_labels and kube_deployment_labels metrics. Now, if I'd like to use…
Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
1
vote
0 answers

Prometheus --> Getting "Server returned HTTP status 400 Bad Request" attempting scraping

I have a Grafana Agent with Kube State Metrics in an EKS cluster and I am getting this error attempting to scrape a kubelet. Any reason why such error can appear? ts=2022-11-14T19:42:49.643418574Z caller=scrape.go:1302 level=debug agent=prometheus…
1
vote
1 answer

Is there a way to get actual Pod hostname in Prometheus

kube_pod_labels does populates pod_label_node_name and pod_label_host_ip for the given pod however the values don't correspond to the actual node name and ip of the pod. Instead it represents the node name and ip for kube-state-metrics/node-exporter…
1
vote
1 answer

kube-state-metrics not sending metrics using service monitor

I have deployed kube-state-metrics into kube-system namespace and in the same cluster we are having prometheus-operator running I've written the below service monitor file for sending metrics to prometheus but it is not working. Please find the…
1
vote
0 answers

Can kube state metrics scrape pod annotations?

have a question, can KSM get pod annotations? I need it for dynamic alert emailing. So i can't use email in pod label which is scraped by KSM. I found in github that it probably can scrape pod annotation, but i don't have this metric in my KSM, so…
Eithenhard
  • 11
  • 2
1
vote
2 answers

Is there a way to find out which container miss the specific metric

I'm trying to find all containers that does not have any resources spec in the cluster and make an alert for that. Now I'm thinking about use all container and pod label in kube_pod_container_info query and do an absent query for…
Xiang.Bao
  • 21
  • 3
1
vote
2 answers

Can't find replicaset kube state metrics in Prometheus

I'm trying to set some alarms based on replica set metrics but Prometheus cannot find replicaset kube state metrics while browsing expressions. What would be the problem with that? On Prometheus dashboard, I can see lots of metrics, which is in kube…
cosmos-1905-14
  • 783
  • 2
  • 12
  • 23
1
vote
1 answer

Helm not able finding local charts to update the dependency

I am installing Prometheus on my vanilla k8s cluster using helm 3. Prometheus comes with kube-state-metrics chart dependency. My machine is completely locked out from internet so all my development is local. I have installed chart museum which does…
unitom
  • 129
  • 6
1
vote
1 answer

Unable to understand GCP bill for Stackdriver Monitoring usage

We have implemented kube-state metrics (by following the steps mentioned in this article section 4.4.1 Install monitoring components) on one of our kubernetes clusters on GCP. So basically it created 3 new deployments node-exporter, prometheus-k8s…
Hemal
  • 33
  • 1
  • 3