prometheusgrafana-loki

How to use recording rules from Loki


I'm trying to use Loki new Recording Rules without alerting.

What is not clear to me is where would the result of the rule evaluation be available?

Can the ruler be scraped for the metrics values or they have to be pushed to something like Prometheus Pushgateway?


Solution

  • Accordingly, to the Loki documentation, metrics must be pushed to Prometheus, Cortex, or Thanos:

    With recording rules, you can run these metric queries continually on an interval and have the resulting metrics written to a Prometheus-compatible remote-write endpoint. They produce Prometheus metrics from log entries.

    At the time of writing, these are the compatible backends that support this:

    • Prometheus (>=v2.25.0)
    • Cortex
    • Thanos (Receiver)