How to assign named evaluation groups using the new App Platform Alert API (v0alpha1)?

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

    • Grafana Version: 13.1

    • OS: Docker

  • What are you trying to achieve? I am trying to create and assign Grafana-managed alert rules to a named evaluation group (e.g., "Trial Group Name" with a specific interval) using the newer App Platform API (/apis/rules.alerting.grafana.app/v0alpha1/...), as the legacy provisioning API endpoints are deprecated.

  • How are you trying to achieve it? Not sure how to achieve. I know how to create alert. What happened? The rule is successfully created, but Grafana’s backend treats it as an isolated resource and assigns it to an auto-generated fallback container named no_group_for_rule_<uid>.... Trying to pass custom group annotations (like grafana.app/rule-group) is ignored by the API.

  • What did you expect to happen? I expected to be able to specify a named evaluation group via the new v0alpha1 API so that multiple rules can share a named evaluation group in the UI, similar to how the legacy rule-group provisioning endpoints worked. Or create evaluation group in the new API.

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

    Bash

    curl -X POST \
      'http://localhost:3000/apis/rules.alerting.grafana.app/v0alpha1/namespaces/default/alertrules' \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer <YOUR_TOKEN>' \
      -d '{
      "kind": "AlertRule",
      "metadata": {
        "annotations": {
          "grafana.app/folder": "afop9zjuuaewwb",
          "grafana.app/rule-group": "Trial Group Name"
        }
      },
      "spec": {
        "title": "gi-tt > 1",
        "forDuration": "5m",
        "trigger": {
          "interval": "1m"
        },
        "expressions": { ... }
      }
    }'
    
    
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were? No explicit error code is returned by the API (201 Created), but in the UI and backend management, the rule ends up isolated under the no_group_for_rule_<uid> grouping schema.

  • Did you follow any online instructions? If so, what is the URL? Grafana OpenAPI/App Platform documentation for rules.alerting.grafana.app/v0alpha1.

Hi,

This isn’t a problem with your request. Grafana is moving away from rule groups.
In the new API, each AlertRule has its own evaluation interval (spec.trigger.interval), so grafana.app/rule-group doesn’t assign it to a named group.
That likely explains the no_group_for_rule_<uid> name you’re seeing.

The nearest new option is RuleSequence, a separate resource in the same API (alpha). It groups existing alert and recording rules so they are evaluated in order at a shared interval, and all the rules must be in the same folder as the sequence. The endpoint should be:

/apis/rules.alerting.grafana.app/v0alpha1/namespaces/{namespace}/rulesequences

If you specifically need a legacy named rule group, the old provisioning endpoint is the other option, but the legacy provisioning API is deprecated, so I’d avoid building on it:

PUT /api/v1/provisioning/folder/:folderUid/rule-groups/:group