Grafana Cloud sum by use string instead of int

  Kiến thức lập trình

On Grafana Cloud, I’m trying to create a graph which retrieve a field “metric” from logs, to display this by range of 1 hour. This seems very easy but the sumby doesn’t seems to understand the field as int.

This is my query : sum by(metric) (rate({filename="/var/log/sms-meeting/combined.log"} |= 'production' | json | metric >= 0 [1h]))

And this is how it display:

As you can see, it seems to understand “metric” as a string field and not a number which can be summed. After many hours searching on Google I tried to convert metric to integer (even if it’s already integer) by using transformation tab, but this is not available on cloud.

Do you have any idea ?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website