Reputation: 3212
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:
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.
Upvotes: 2
Views: 930
Reputation: 5115
I created the following git gist (which is basically a public permalink)
https://gist.github.com/neoakris/bfc67fef83fecde6384ab4f8afe5fc95
It covers how to troubleshoot GMP, and it includes 3 different ways of how to run PromQL Queries against Prometheus metrics.
It shows
Upvotes: 0