mirror of https://github.com/grafana/grafana.git
What is this feature?
Adds an API endpoint to create alert rules with mimirtool:
- POST /convert/prometheus/config/v1/rules/{NamespaceTitle} - Accepts a single rule group in a Prometheus YAML format and creates or updates a Grafana rule group from it.
The endpoint uses the conversion package from #100224.
Key parts
The API works similarly to the provisioning API. If the rule does not exist, it will be created, otherwise updated. Any rules not present in the new group will be deleted, ensuring the group is fully synchronized with the provided configuration.
Since the API works with namespace titles (folders), the handler automatically creates a folder in the root based on the provided title if it does not exist. It also requires a special header, X-Grafana-Alerting-Datasource-UID. This header specifies which datasource to use for the new rules.
If the rule group's evaluation interval is not specified, it uses the DefaultRuleEvaluationInterval from settings.
|
||
|---|---|---|
| .. | ||
| app | ||
| dashboards | ||
| emails | ||
| fonts | ||
| gazetteer | ||
| img | ||
| lib | ||
| locales | ||
| maps | ||
| sass | ||
| swagger | ||
| test | ||
| vendor | ||
| views | ||
| api-enterprise-spec.json | ||
| api-merged.json | ||
| openapi3.json | ||
| robots.txt | ||