kubernetes-sigs / prometheus-adapter

An implementation of the custom.metrics.k8s.io API using Prometheus
Apache License 2.0
1.9k stars 551 forks source link

Custom metric does not get loaded into k8s/api not available #666

Open fontexD opened 2 months ago

fontexD commented 2 months ago

[What] happened?:

Trying to add custom metric from prometheus, verified data and series is availaable.

What did you expect to happen?: i expetced the metric to be available inside k8s and useable by hpa, it seems that adapter is getting data all good, but after that nothing, not collectable/viewable from kubectl nor the hpa deploy

Please provide the prometheus-adapter config:

prometheus-adapter config

apiVersion: v1 kind: ConfigMap metadata: name: adapter-config namespace: ops-services data: config.yaml: | rules:

Please provide the HPA resource used for autoscaling:

HPA yaml apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: nginx-hpa namespace: default spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: nginx minReplicas: 1 maxReplicas: 10 metrics: - type: Pods pods: metric: name: rabbitmq_queue_messages target: type: AverageValue averageValue: 1

Please provide the HPA status: dosent really matter i cant even kubectl and show the metric, so ofc not even hpa is able to se it aither .. Please provide the prometheus-adapter logs with -v=6 around the time the issue happened:

prometheus-adapter logs i addded picture with logs, and adapter seems to be 100% working correct or 99% since the data is not "uploaded" into k8s/api so not accessable beside inside the adapter logs

Anything else we need to know?:

Environment:

bug4

dgrisonnet commented 2 months ago

/kind support /triage accepted

Arv1nt3 commented 1 month ago

I have the same issue, it is detailed here: https://stackoverflow.com/questions/78787075/kubernetes-hpa-unable-to-fetch-custom-metrics-from-prometheus-adapter