API for getting all the alert rules

  • What Grafana version and what operating system are you using?
    Grafana cloud

  • What are you trying to achieve?
    Get the list of rules, both grafana as well as loki managed rules.

  • How are you trying to achieve it?
    loki/api/v1/rules - gives loki managed rules
    api/ruler/grafana/api/v1/rules - gives grafana managed rules

looking for an api which can give all rules, be it grafana or loki managed.
Problem with getting it separately is loki doesnt support the same api key as grafana, so you need 2 set of credentials, one for grafana and one for loki.

  • What happened?
    The above apis work fine, looking a way to get the combined list from a single api

  • What did you expect to happen?
    Cant find a single api

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?