Blake
Blake

Reputation: 68

Grouping like errors from Loki ineffective due to variables

I have a Grafana dashboard that includes a panel which groups like error messages from Loki to display the most common errors. However, I get a lot of like messages that are not grouped due to variable data. For example: "User ID '123456' is of a type that is not found in the DB". If this error occurs for 50 users, I want to report it as 50 occurrences of the same error but instead, it shows it as 50 separate errors because the User ID is unique for each.

My current LogQL query is:

topk(10, sum(count_over_time({cluster=~"${cluster:regex}", namespace=~"${namespace:regex}"} [$__range] | json | __error__ = "" ) ) by (MessageTemplate))

Upvotes: 1

Views: 201

Answers (0)

Related Questions