diff --git a/lib/plugins/grafana/index.js b/lib/plugins/grafana/index.js index dcb0549c8..7771ea2c1 100644 --- a/lib/plugins/grafana/index.js +++ b/lib/plugins/grafana/index.js @@ -13,6 +13,7 @@ module.exports = { this.annotationType = 'webpagetest.pageSummary'; this.tsdbType = 'graphite'; this.make = context.messageMaker('grafana').make; + this.alias = {}; }, processMessage(message, queue) { // First catch if we are running Browsertime and/or WebPageTest @@ -29,6 +30,8 @@ module.exports = { this.useScreenshots = message.data.screenshot; this.screenshotType = message.data.screenshotType; } + } else if (message.type === 'browsertime.alias') { + this.alias[message.url] = message.data; } else if ( message.type === this.annotationType && this.resultUrls.hasBaseUrl() @@ -44,6 +47,7 @@ module.exports = { this.screenshotType, this.timestamp, this.tsdbType, + this.alias, this.options ); } diff --git a/lib/plugins/grafana/send-annotation.js b/lib/plugins/grafana/send-annotation.js index 4d8b503dc..17ce6f896 100644 --- a/lib/plugins/grafana/send-annotation.js +++ b/lib/plugins/grafana/send-annotation.js @@ -15,6 +15,7 @@ module.exports = { screenshotType, time, tsdbType, + alias, options ) { // The tags make it possible for the dashboard to use the @@ -32,7 +33,8 @@ module.exports = { url, tsdbType === 'graphite' ? options.graphite.includeQueryParams - : options.influxdb.includeQueryParams + : options.influxdb.includeQueryParams, + alias ) .split('.'); diff --git a/lib/plugins/graphite/index.js b/lib/plugins/graphite/index.js index 3fd74e4bd..10b4af077 100644 --- a/lib/plugins/graphite/index.js +++ b/lib/plugins/graphite/index.js @@ -116,6 +116,7 @@ module.exports = { this.useScreenshots, this.screenshotType, this.timestamp, + this.alias, this.options ); } diff --git a/lib/plugins/graphite/send-annotation.js b/lib/plugins/graphite/send-annotation.js index 40e33925b..b018c0a92 100644 --- a/lib/plugins/graphite/send-annotation.js +++ b/lib/plugins/graphite/send-annotation.js @@ -14,6 +14,7 @@ module.exports = { screenShotsEnabledInBrowsertime, screenshotType, time, + alias, options ) { // The tags make it possible for the dashboard to use the @@ -24,7 +25,13 @@ module.exports = { const browser = options.browser; const namespace = options.graphite.namespace.split('.'); const urlAndGroup = graphiteUtil - .getURLAndGroup(options, group, url, options.graphite.includeQueryParams) + .getURLAndGroup( + options, + group, + url, + options.graphite.includeQueryParams, + alias + ) .split('.'); const tags = [ connectivity, diff --git a/lib/plugins/influxdb/index.js b/lib/plugins/influxdb/index.js index a107c62a4..c3aa8ffb7 100644 --- a/lib/plugins/influxdb/index.js +++ b/lib/plugins/influxdb/index.js @@ -111,6 +111,7 @@ module.exports = { this.useScreenshots, this.screenshotType, this.timestamp, + this.alias, this.options ); } diff --git a/lib/plugins/influxdb/send-annotation.js b/lib/plugins/influxdb/send-annotation.js index 40e2cce00..8beecafe3 100644 --- a/lib/plugins/influxdb/send-annotation.js +++ b/lib/plugins/influxdb/send-annotation.js @@ -15,6 +15,7 @@ module.exports = { screenShotsEnabledInBrowsertime, screenshotType, time, + alias, options ) { // The tags make it possible for the dashboard to use the @@ -24,7 +25,13 @@ module.exports = { const connectivity = tsdbUtil.getConnectivity(options); const browser = options.browser; const urlAndGroup = tsdbUtil - .getURLAndGroup(options, group, url, options.influxdb.includeQueryParams) + .getURLAndGroup( + options, + group, + url, + options.influxdb.includeQueryParams, + alias + ) .split('.'); let tags = [connectivity, browser, urlAndGroup[0], urlAndGroup[1]];