diff --git a/public/app/directives/annotationTooltip.js b/public/app/directives/annotationTooltip.js index f84df88dd26..25059d08274 100644 --- a/public/app/directives/annotationTooltip.js +++ b/public/app/directives/annotationTooltip.js @@ -3,7 +3,7 @@ define([ 'jquery', 'lodash' ], -function (angular, $) { +function (angular, $, _) { 'use strict'; angular @@ -23,8 +23,17 @@ function (angular, $) { tooltip += text.replace(/\n/g, '
') + '
'; } - if (event.tags && event.tags.length > 0) { - tooltip += '{{tag}}
'; + var tags = event.tags; + if (_.isString(event.tags)) { + tags = event.tags.split(','); + if (tags.length === 1) { + tags = event.tags.split(' '); + } + } + + if (tags && tags.length) { + scope.tags = tags; + tooltip += '{{tag}}
'; } tooltip += ""; diff --git a/public/app/plugins/datasource/graphite/datasource.js b/public/app/plugins/datasource/graphite/datasource.js index 3697cade07b..9315b5a5b33 100644 --- a/public/app/plugins/datasource/graphite/datasource.js +++ b/public/app/plugins/datasource/graphite/datasource.js @@ -111,19 +111,12 @@ function (angular, _, $, config, kbn, moment) { var list = []; for (var i = 0; i < results.data.length; i++) { var e = results.data[i]; - var tags = []; - if (e.tags) { - tags = e.tags.split(','); - if (tags.length === 1) { - tags = e.tags.split(' '); - } - } list.push({ annotation: annotation, time: e.when * 1000, title: e.what, - tags: tags, + tags: e.tags, text: e.data }); }