Include recent log message in alert?

In Grafana Cloud, I setup an alert rule to send me an email when any errors are logged in Loki, for example: sum by(level, service_name) (rate({service_name="myservice", level="error"} [$__auto])).

So the email alerts include the level and service_name tags, but this isn’t very helpful to identify what the problem actually is. Is there some way to include the log message itself in there?

1 Like