Google managed Prometheus query doesn't return any metric

Viewed 122

I have configured Prometheus according to doc. But when I am doing query it doesn't return any metric. How can I understand why metrics scrapping doesn't work?

Configuration details:

I have updated existing cluster in cloud console. Prometheus service is Enabled: Prometheus enabled

Then I have deployed PodMonitoring resource to enable metric scraping:

apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
  name: test
spec:
  selector:
    matchLabels:
      app: test
  endpoints:
    - port: test
      path: /test/metrics
      interval: 30s

And here is how kubectl describe svc test looks like:

Name:              test
Namespace:         default
Labels:            app=test
Annotations:       service.alpha.kubernetes.io/tolerate-unready-endpoints: true
Selector:          app=test
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                $IP
IPs:               $IP
Port:              test  $PORT_DIGIT/TCP
TargetPort:        $PORT_DIGIT/TCP
Endpoints:         $IP:$PORT_DIGIT
Session Affinity:  None
Events:            <none>

I also have self managed prometheus - it works fine with test service.

0 Answers
Related