Hi @melori.arellano ,
Thanks for the reply.
I was able to progress provisioning my alert rules via yaml / config map.
Doing a quick test now, I’m still getting the error. I configured a very simple alert in the UI, exported to json and then tried to post back. The json I get is below. I think I originally used a for of 0, but in this test I used the default 5m.
Thanks,
Tom
alert rule json:
{
"id": 3,
"uid": "3T0zXkhVz",
"orgID": 1,
"folderUID": "ODXFj154k",
"ruleGroup": "test",
"title": "test",
"condition": "C",
"data": [
{
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "prometheus",
"model": {
"editorMode": "code",
"expr": "vector(0)",
"hide": false,
"intervalMs": 1000,
"legendFormat": "__auto",
"maxDataPoints": 43200,
"range": true,
"refId": "A"
}
},
{
"refId": "B",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "-100",
"model": {
"conditions": [
{
"evaluator": {
"params": [],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"B"
]
},
"reducer": {
"params": [],
"type": "last"
},
"type": "query"
}
],
"datasource": {
"type": "__expr__",
"uid": "-100"
},
"expression": "A",
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"reducer": "last",
"refId": "B",
"type": "reduce"
}
},
{
"refId": "C",
"queryType": "",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "-100",
"model": {
"conditions": [
{
"evaluator": {
"params": [
0
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"C"
]
},
"reducer": {
"params": [],
"type": "last"
},
"type": "query"
}
],
"datasource": {
"type": "__expr__",
"uid": "-100"
},
"expression": "B",
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "C",
"type": "threshold"
}
}
],
"updated": "2023-01-04T19:05:31Z",
"noDataState": "NoData",
"execErrState": "Error",
"for": "5m"
}