"value": "response.code" - is just for example, I plan to use a more meaningful attribute, just trying to make it work with something simple first.
I also tried "value": "1.1" - no luck.
I don’t see the metric in Prometheus by querying "{__name__=~".*my_custom_metric.*"}".
And nothing in kubectl exec $MY_PODNAME -c istio-proxy -- curl 'localhost:15000/stats/prometheus' | grep 'my_custom_metric'
While I see that my_custom_tag in either of the places, so adding custom tag works, but custom metrics does not.
And no metrics-related errors in Envoy logs kubectl logs $MY_PODNAME -c istio-proxy | grep -e "Config Error" -e "envoy wasm"
That worked! However, I was having the extraStatTags annotation set and it was working at least partially, I understand - because I was getting that tag in Prometheus for the built-in requests_total metric.
So, then… how to be able to have a custom, not built-in tag, for a custom metric?
Also, you mean it’s not possible to have a metric with just a name and without the dimensions?
The extra stat tag requires a proxy restart, so perhaps, the relevant proxy was just stale? The case of a metric without dimensions is a corner case, so I assume it gets filtered out somewhere in istio or envoy pipeline.
(the Envoy proxy, right?)
no… I’m doing the restarts of the relevant pods after adding sidecar.istio.io/extraStatTags, anyway I additionally did kubectl rollout restart deployments/myapp - no luck.
That’s interesting. Perhaps, you can try query envoy admin port :15000/stats and share what it looks like for my_custom_metric? Also, can you get the config dump from envoy (especially bootstrap) to make sure the custom tag actually makes it there?
I did 2 requests before adding my_custom_tag - we see it’s working.
Then I add my_custom_tag, did some more requests but the counter stopped growing, and if I restart the pod - then nothing is returned from /stats.
I think 1.6.3 has a nasty segfault that causes envoy to restart on a configuration change for configurable metrics (see https://github.com/envoyproxy/envoy-wasm/pull/547). That has been fixed on master and I think made it to 1.6.4.
I think it didn’t make it to 1.6.4 since CVE fixes took precedence. 1.6.5 should be coming soon, and I believe it should have it. For now, using MeshConfig extraStatTags during installation and modifying EnvoyFilter during installation works.