Alerting: Support query_offset in the Prometheus conversion (#102499)

Adds support for rule group-level query_offset in Prometheus to Grafana rule conversion. It allows specifying a time offset for rule evaluation, which gets applied and saved during the conversion.
This commit is contained in:
Alexander Akhmetov
2025-03-20 18:05:55 +01:00
committed by GitHub
parent 0845c781ae
commit ad71270ee0
11 changed files with 160 additions and 28 deletions
+24 -1
View File
@@ -208,6 +208,9 @@
"isPaused": {
"type": "boolean"
},
"keepFiringFor": {
"$ref": "#/definitions/Duration"
},
"labels": {
"additionalProperties": {
"type": "string"
@@ -468,6 +471,10 @@
"health": {
"type": "string"
},
"keepFiringFor": {
"format": "double",
"type": "number"
},
"labels": {
"$ref": "#/definitions/Labels"
},
@@ -3012,9 +3019,22 @@
"Interval": {
"$ref": "#/definitions/Duration"
},
"Labels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"Limit": {
"format": "int64",
"type": "integer"
},
"Name": {
"type": "string"
},
"QueryOffset": {
"type": "string"
},
"Rules": {
"items": {
"$ref": "#/definitions/PrometheusRule"
@@ -3117,6 +3137,10 @@
"example": false,
"type": "boolean"
},
"keep_firing_for": {
"format": "duration",
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
@@ -4952,7 +4976,6 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert",
"type": "object"