I am trying to match the response_code
that are 4.*
. But getting a Expected type 'String' but got 'Int'.
in the MQL editor. I am able to match strings with regex, just the int doesn't work. Is there a way i could convert the metric type int to a string? Or am I doing it wrong?
fetch istio_canonical_service
| metric 'istio.io/service/client/request_count'
| filter (metric.response_code =~ '4.*')
| group_by 1m, [value_request_count_mean: mean(value.request_count)]
| every 1m
| group_by [metric.response_code],
[value_request_count_mean_aggregate: aggregate(value_request_count_mean)]
As per Chandra's answer above, the following workaround worked: