Hi,all:
My alert history exists, but cannot view the alter rule added via http provisioning API . The rule can also be found via http API, but how can the alert rule be found via UI?
version: grafana-10.0.3
The alert rule had been added successfully by the curl command. The request body refer to one rule yaml exported.
curl localhost:3000/api/v1/provisioning/alert-rules -X POST --insecure -H "X-Disable-Provenance:true" -H "Authorization: Bearer eyJrIjoiUWkzWmdOU05FSDhPbmc3SUFDVnZOMjdlanpmNWd1QkoiLCJuIjoiYXBpa2V5Y3VybCIsImlkIjoyfQ==" -H "Content-Type: application/json" -d '{
"title": "alert_test0904_01",
"orgID":1,
"condition": "A",
"folderUID": "alter_rule_test_folder",
"ruleGroup": "alter_rule_test_group",
"data": [
{
"refId": "A",
"relativeTimeRange": {
"from": 1800,
"to": 0
},
"datasourceUid": "f3349557-2edd-4c21-8c5e-27bde72dca0c",
"model": {
"datasource": {
"type": "prometheus",
"uid": "f3349557-2edd-4c21-8c5e-27bde72dca0c"
},
"editorMode": "builder",
"expr": "prometheus_http_requests_total{job=\"prometheus\"}",
"hide": false,
"instant": true,
"intervalMs": 1000,
"maxDataPoints": 43200,
"range": false,
"refId": "A"
}
},
{
"refId": "B",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "__expr__",
"model": {
"conditions": [
{
"evaluator": {
"params": [
0,
0
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": []
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"datasource": {
"name": "Expression",
"type": "__expr__",
"uid": "__expr__"
},
"expression": "A",
"intervalMs": 1000,
"maxDataPoints": 43200,
"reducer": "max",
"refId": "B",
"type": "reduce"
}
},
{
"refId": "C",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "__expr__",
"model": {
"conditions": [
{
"evaluator": {
"params": [
3
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"C"
]
},
"reducer": {
"params": [],
"type": "last"
},
"type": "query"
}
],
"datasource": {
"type": "__expr__",
"uid": "__expr__"
},
"expression": "B",
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "C",
"type": "threshold"
}
}
],
"noDataState": "NoData",
"execErrState": "Error",
"for": "1m",
"isPaused": false
}'