prometheus-adapter icon indicating copy to clipboard operation
prometheus-adapter copied to clipboard

Adapter Unable to export ping_request_count{instance="172.30.27.146:8090", job="sample_go_server"}

Open sibendu opened this issue 2 years ago • 2 comments

What happened?: I am trying to handle a custom metric: ping_request_count{instance="172.30.27.146:8090", job="sample_go_server"}

It is generated and published into prometheus by a program running outside, not in a k8s pod

What did you expect to happen?: I expected that prometheus adapter will make it available via custom api with configuration as given below. But that is not happening. I have tried several variations, but failed to make it work.

Unable to see the metric mapped by using command: kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/" | jq

Please provide the prometheus-adapter config:

prometheus-adapter config
- seriesQuery: 'ping_request_count'
  resources:
    overrides:
  name:
    matches: "ping_request_count"
    as: "ping_request_count"
  metricsQuery: sum(<<.Series>>)

Please provide the HPA resource used for autoscaling:

HPA yaml

Please provide the HPA status:

Please provide the prometheus-adapter logs with -v=6 around the time the issue happened:

prometheus-adapter logs

Anything else we need to know?: Does the adapter work only for custom metrics published from pods running within k8s, having following mapping :

resources: overrides: kubernetes_namespace: {resource: "namespace"} kubernetes_pod_name: {resource: "pod"}

Environment:

  • prometheus-adapter version: v0.10.0
  • prometheus version: latest image
  • Kubernetes version (use kubectl version): v1.23.1
  • Cloud provider or hardware configuration: Ubuntu WSL2
  • Other info: Microk8s running on Ubuntu WSL2 on Windows 10

sibendu avatar Apr 27 '23 19:04 sibendu

/kind support /remove-kind bug /triage accepted /assign

dgrisonnet avatar Jun 29 '23 16:06 dgrisonnet

hello,i meet the same problem and i wonder how did you solve this problem thank u

CRISPpp avatar May 17 '24 05:05 CRISPpp