Reputation: 548
I created some Dashboards in Grafana to monitor the logs of the Kubernetes Pods. Below is a screenshot taken from a part of the Dashboard. So it basically shows "Fail" logs in red color as below. But I need something alerting to be done whenever if a "Fail" log occured.
It doesn't show me to add "Alerts" under this Dashboard. I need a solution that Alerts Fail logs. Can someone tell me how can I accomplish this task?
Upvotes: 6
Views: 10409
Reputation: 2075
Here's an explainer video - while in that video they use Loki as prometheus
type data source, it works just as well when using loki
type.
count_over_time(
{app="bot"}[15m]
|= "ERROR"
)
This rule will return a graph of the count of log lines containing ERROR within 15 minutes
If you need the total count, wrap it with sum(...)
Upvotes: 9