From ae64cf8b9c9bba4666273aba191dca70ca05b9d2 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Mon, 11 Apr 2022 14:33:45 +0200 Subject: [PATCH] Make it possible to disable annotations for Graphite. (#3625) https://github.com/sitespeedio/sitespeed.io/issues/3624 --- lib/plugins/graphite/cli.js | 7 +++++++ lib/plugins/graphite/index.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/plugins/graphite/cli.js b/lib/plugins/graphite/cli.js index 734ed357b..84043b101 100644 --- a/lib/plugins/graphite/cli.js +++ b/lib/plugins/graphite/cli.js @@ -59,6 +59,13 @@ module.exports = { 'Include screenshot (from Browsertime/WebPageTest) in the annotation. You need to specify a --resultBaseURL for this to work.', group: 'Graphite' }, + sendAnnotation: { + default: true, + type: 'boolean', + describe: + 'Send annotations when a run is finished. You need to specify a --resultBaseURL for this to work. However if you for example use a Prometheus exporter, you may want to make sure annotations are not sent, then set it to false.', + group: 'Graphite' + }, annotationRetentionMinutes: { type: 'number', describe: diff --git a/lib/plugins/graphite/index.js b/lib/plugins/graphite/index.js index 2f4173e84..d87f5b0a1 100644 --- a/lib/plugins/graphite/index.js +++ b/lib/plugins/graphite/index.js @@ -60,7 +60,7 @@ module.exports = { this.messageTypesToFireAnnotations = []; this.receivedTypesThatFireAnnotations = {}; this.make = context.messageMaker('graphite').make; - this.sendAnnotation = true; + this.sendAnnotation = opts.sendAnnotation || true; this.alias = {}; this.wptExtras = {}; this.usingBrowsertime = false;