Skip to content

Commit 44f0643

Browse files
committed
feat(alerting): different colored lines/icons for alert annotations based on state, grafana#6244
1 parent fa492c6 commit 44f0643

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

public/app/plugins/panel/graph/graph.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,32 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
384384
if (!annotations || annotations.length === 0) {
385385
return;
386386
}
387+
console.log(annotations);
387388

388389
var types = {};
390+
types['$__alerting'] = {
391+
color: 'rgba(237, 46, 24, 1)',
392+
position: 'BOTTOM',
393+
markerSize: 5,
394+
};
395+
types['$__ok'] = {
396+
color: 'rgba(11, 237, 50, 1)',
397+
position: 'BOTTOM',
398+
markerSize: 5,
399+
};
400+
types['$__nodata'] = {
401+
color: 'rgba(150, 150, 150, 1)',
402+
position: 'BOTTOM',
403+
markerSize: 5,
404+
};
405+
389406
for (var i = 0; i < annotations.length; i++) {
390407
var item = annotations[i];
408+
if (item.newState) {
409+
console.log(item.newState);
410+
item.eventType = '$__' + item.newState;
411+
continue;
412+
}
391413

392414
if (!types[item.source.name]) {
393415
types[item.source.name] = {

0 commit comments

Comments
 (0)