- Load the dashboard alert from
alert
table and create rules in thealert_rule
table- Translate conditions and queries into SSE for the
alert_rule
row - Translate other settings like NoData,FOR,Interval,alertRuleTags,(notifications?) for
alert_rule
row - Match Permissions of dashboard alert (create folders as needed):
- Alerts will not have permissions, Folders will
- If alert's dashboard has permissions, create corresponding folder to match permissions
- Translate conditions and queries into SSE for the
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT http://admin:admin@localhost:3000/api/alert-definitions/HH7cv0yMk | |
Content-Type: application/json | |
{ | |
"id": 24, | |
"orgId": 1, | |
"title": "First CC Alert", | |
"condition": "B", | |
"data": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xclip -o -selection clipboard | jq '.conditions | { "conditions": . }' | curl -H 'Content-Type: application/json' -X POST --data-binary @- http://admin:admin@localhost:3000/api/alert-definitions/evalOld | jq -r '.instances[0]' | base64 -d > ~/tmp/af && arrow-cat ~/tmp/af |

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://admin:admin@localhost:3000/ruler/grafana/api/v1/rules/ng-alert-demo | |
Content-Type: application/json | |
{ | |
"name": "test-group", | |
"interval": "10s", | |
"rules": [ | |
{ | |
"grafana_alert": { | |
"title": "prom query with SSE classic condition", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://admin:admin@localhost:3000/ruler/grafana/api/v1/rules/ng-alert-demo | |
Content-Type: application/json | |
{ | |
"name": "test-group2", | |
"interval": "10s", | |
"rules": [ | |
{ | |
"grafana_alert": { | |
"title": "pp query with SSE classic condition", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://admin:admin@localhost:3000/api/alert-definitions/ | |
Content-Type: application/json | |
{ | |
"title": "classic many", | |
"condition": "G", | |
"data": [ | |
{ | |
"refId": "A", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template_files": {}, | |
"alertmanager_config": { | |
"route": { | |
"receiver": "webhook_test", | |
"group_by": [ | |
"alertname" | |
] | |
}, | |
"templates": [], |
In order to figure what is going on with Grafana managed alerts generic issue, we can use (or need) the following information.
Less may be needed depending how far along in the pipeline the issue is (if it is at the end like notifications, then can need all the stuff that takes us to that point).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dataframe is a columnar table made up of fields | |
#Dataframe: { | |
Name: string, | |
Fields: [...#Field] | |
_fieldLen: int | |
// all fields must be the same length | |
// error message may be like "missMatchedLen._fieldLen: conflicting values 2 and 3" if an instance of | |
// Dataframe. This is because _fieldLen does not collacse to the same value |