Alerts to Slack

I’m having trouble sending Loki based Slack alerts via the UI.

  1. I’ve created an alert rule and I see that it’s status is “Normal”.
    When looking at its graph, I can see that there are results.
    This is its expression:
sum by (namespace) (count_over_time({namespace="api"} | json | __error__ != "JSONParserErr" | level="ERROR"[1m])) > 0
  1. I’ve created a “Contact point” for slack and verified that it works (tested and received a dummy alert).

  2. Now I don’t really understand how to “connect” between the alert rule and the contact point.
    I tried creating a “Notification policy” in which I added the Slack contact point, but I don’t understand how to connect it to my specific alert rule (attached image)
    What does the “Matcher” mean? Am I supposed to connect to the alert rule via some label?
    If so, which one?


The notification policy works on matching labels, you are correct. Have you checked out the documentation for this? There’s an example in there, as well as an explanation of how the matching works.