From 62bc755733ecd3b3bf9bc279a92c8e4c8f476d1c Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Wed, 30 Dec 2020 17:47:04 +0100 Subject: [PATCH] mixin: Scope grafana config In its current form this configuration clashes in one of the most widely used configurations (kube-prometheus). This patch scopes the configuration to prevent this. Signed-off-by: Frederic Branczyk --- documentation/prometheus-mixin/config.libsonnet | 2 +- documentation/prometheus-mixin/dashboards.libsonnet | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/prometheus-mixin/config.libsonnet b/documentation/prometheus-mixin/config.libsonnet index 85a2048e01..6b96a31429 100644 --- a/documentation/prometheus-mixin/config.libsonnet +++ b/documentation/prometheus-mixin/config.libsonnet @@ -38,7 +38,7 @@ // Example: @'http://test-alertmanager\..*' nonNotifyingAlertmanagerRegEx: @'', - grafana: { + grafanaPrometheus: { prefix: 'Prometheus / ', tags: ['prometheus-mixin'], // The default refresh time for all dashboards, default to 60s diff --git a/documentation/prometheus-mixin/dashboards.libsonnet b/documentation/prometheus-mixin/dashboards.libsonnet index e5f7cc5c06..c1336cd183 100644 --- a/documentation/prometheus-mixin/dashboards.libsonnet +++ b/documentation/prometheus-mixin/dashboards.libsonnet @@ -11,7 +11,7 @@ local template = grafana.template; grafanaDashboards+:: { 'prometheus.json': g.dashboard( - '%(prefix)sOverview' % $._config.grafana + '%(prefix)sOverview' % $._config.grafanaPrometheus ) .addMultiTemplate('job', 'prometheus_build_info', 'job') .addMultiTemplate('instance', 'prometheus_build_info', 'instance') @@ -99,8 +99,8 @@ local template = grafana.template; g.stack, ) ) + { - tags: $._config.grafana.tags, - refresh: $._config.grafana.refresh, + tags: $._config.grafanaPrometheus.tags, + refresh: $._config.grafanaPrometheus.refresh, }, // Remote write specific dashboard. 'prometheus-remote-write.json': @@ -293,7 +293,7 @@ local template = grafana.template; )); dashboard.new( - title='%(prefix)sRemote Write' % $._config.grafana, + title='%(prefix)sRemote Write' % $._config.grafanaPrometheus, editable=true ) .addTemplate( @@ -380,8 +380,8 @@ local template = grafana.template; .addPanel(retriedSamples) .addPanel(enqueueRetries) ) + { - tags: $._config.grafana.tags, - refresh: $._config.grafana.refresh, + tags: $._config.grafanaPrometheus.tags, + refresh: $._config.grafanaPrometheus.refresh, }, }, }