From 44f064392d414f0dec48c162882726bd4a496bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 13 Oct 2016 15:22:54 +0200 Subject: [PATCH] feat(alerting): different colored lines/icons for alert annotations based on state, #6244 --- public/app/plugins/panel/graph/graph.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index a07701cef65..7e19d00251f 100755 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -384,10 +384,32 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) { if (!annotations || annotations.length === 0) { return; } + console.log(annotations); var types = {}; + types['$__alerting'] = { + color: 'rgba(237, 46, 24, 1)', + position: 'BOTTOM', + markerSize: 5, + }; + types['$__ok'] = { + color: 'rgba(11, 237, 50, 1)', + position: 'BOTTOM', + markerSize: 5, + }; + types['$__nodata'] = { + color: 'rgba(150, 150, 150, 1)', + position: 'BOTTOM', + markerSize: 5, + }; + for (var i = 0; i < annotations.length; i++) { var item = annotations[i]; + if (item.newState) { + console.log(item.newState); + item.eventType = '$__' + item.newState; + continue; + } if (!types[item.source.name]) { types[item.source.name] = {