I’d like to reactivate this subject. I think I catch the idea of merging metrics:
Let me proof that:
- I specify my app port and path for scraping, e.g.
annotations:
prometheus.io/path: "/metrics"
prometheus.io/port: "2112"
- Istio Mutating Admission Webhook does the magic:
- sets env var: ISTIO_PROMETHEUS_ANNOTATIONS to
{"scrape":"","path":"/metrics","port":"2112"}
- sets again
prometheus.io
annotations to:
prometheus.io/path: /stats/prometheus
prometheus.io/port: "15020"
Ok, but that’s all. Now the “chaos” is coming:
Trying to curl
the metrics from another workload in the mesh ends with:
/ $ curl http://prombin:15020/stats/prometheus
curl: (56) Recv failure: Connection reset by peer
where prombin
is a simple server generating counter metric on 0.0.0.0:2112/metrics
endpoint.
The istio-sidecar log on the client/downstream side:
[2022-07-21T08:44:32.313Z] "- - -" 0 UH - - "-" 0 0 0 - "-" "-" "-" "-" "-" BlackHoleCluster - 100.113.27.186:15020 100.113.24.220:35186 - -
Looking at the listeners of the upstream (prom-bin) gives no result:
istioctl pc listener -n test-istio deploy/prombin | grep 15020
Looking at clusters on the client/downstream side:
istioctl pc cluster -n test-istio deploy/sleep | grep -E '2112|15020'
prombin.test-istio.svc.cluster.local 2112 - outbound EDS
So the question is: Could anyone explain to me how to use merged metrics?
EDITED:
I think I got it but I do not understand it yet:
If I curl
via POD IP from outside the mesh (in STRICT mode) I get the metrics:
curl http://100.113.25.28:15020/stats/prometheus | grep mlk
# HELP mlk_counter The total number of processed events
# TYPE mlk_counter counter
mlk_counter 2392
That’s what I meant.
Now I must dig into iptables and envoy config_dump to understand the rest of that.