Istio 1.5 resource annotation sidecar.istio.io/extraStatTags

I have a metric that has the following name:
redis.outbound|6379||redisdb.my-redis.default.svc.cluster.local.command.hget.latency

I’m trying to have the Redis command as a label when I export the stats in prometheus format so I’ve annotated the pod template with the following annotations:
sidecar.istio.io/extraStatTags: command

The problem is that the generated /etc/istio/proxy/envoy-rev0.json file in my sidecar ends up with the following stats_tags configuration for the command tag:

{
      "regex": "(command=\\.=(.*?);\\.;)",
      "tag_name": "command"
},

Clearly the generated regex won’t match my metric’s name and therefore won’t extract the command as a prometheus label.

So I’m wondering whether there is problem with the envoy template file here:

I feel that the generated regex should be like this: "({{ $tag }}\\.(.+?)\\.)"

Any thoughts?

I’m currently testing with Istio 1.5.0-beta4

Thanks,
JF

Hi, that annotation is meant to be used in conjunction with https://github.com/istio/istio/wiki/Configurable-V2-Metrics. I think you’re looking for the standard stats inclusion/exclusion list.