Open sarasensible opened 1 year ago
For some context I have been using metrics-server for cpu utilization however we are seeing behavior that the cpu reported by the HPA is much lower than that reported by Prometheus. As a result I am looking to get the Prometheus reported value directly into the HPA via a custom metric.
/kind support /triage accepted
/assign
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
/triage accepted
(org members only)/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted
What happened?: I am trying to create a custom metric for process_cpu_seconds_total. I see the metric in the api raw response however I'm unable to query it:
What did you expect to happen?: I expected to be able to query my metric.
Please provide the prometheus-adapter config: prometheus-adapter config:
Please provide the HPA resource used for autoscaling: N/A
Please provide the HPA status: N/A
Please provide the prometheus-adapter logs with -v=6 around the time the issue happened:
prometheus-adapter logs
``` I0510 19:54:39.977398 1 api.go:76] GET http://prometheus-stack-1-kube-pr-prometheus.monitoring.svc.cluster.local:9090/api/v1/query?query=rate%28process_cpu_seconds_total%7Bnamespace%3D%22weather%22%2Cpod%3D%22%2A%22%7D%5B1m%5D%29+by+%28pod%29&time=1683748479.975&timeout= 400 Bad Request E0510 19:54:39.977516 1 provider.go:150] unable to fetch metrics from prometheus: bad_data: invalid parameter "query": 1:97: parse error: unexpectedAnything else we need to know?: I tried playing around with the metric configuration by using kubernetes_namespace/kubernetes_pod_name and just pod_name in the overrides however this only resulted in the metric not showing up in the api query at all.
Environment:
Version: 0.9.1 Installed with Helm
kubectl version
): v1.25