未验证 提交 aa1ca130 编写于 作者: N Nicolas Lamirault 提交者: GitHub

Add: Custom tags and prefix in Prometheus Mixin (#8287)

* Add: custom tags and prefix
Signed-off-by: NNicolas Lamirault <nicolas.lamirault@gmail.com>

* Fix: fmt
Signed-off-by: NNicolas Lamirault <nicolas.lamirault@gmail.com>
上级 8dc53c22
......@@ -37,5 +37,12 @@
// expression is matched against the `alertmanager` label.
// Example: @'http://test-alertmanager\..*'
nonNotifyingAlertmanagerRegEx: @'',
grafana: {
prefix: 'Prometheus / ',
tags: ['prometheus-mixin'],
// The default refresh time for all dashboards, default to 60s
refresh: '60s',
},
},
}
......@@ -10,7 +10,9 @@ local template = grafana.template;
{
grafanaDashboards+:: {
'prometheus.json':
g.dashboard('Prometheus Overview')
g.dashboard(
'%(prefix)sOverview' % $._config.grafana
)
.addMultiTemplate('job', 'prometheus_build_info', 'job')
.addMultiTemplate('instance', 'prometheus_build_info', 'instance')
.addRow(
......@@ -96,7 +98,10 @@ local template = grafana.template;
{ yaxes: g.yaxes('ms') } +
g.stack,
)
),
) + {
tags: $._config.grafana.tags,
refresh: $._config.grafana.refresh,
},
// Remote write specific dashboard.
'prometheus-remote-write.json':
local timestampComparison =
......@@ -287,8 +292,10 @@ local template = grafana.template;
legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}'
));
dashboard.new('Prometheus Remote Write',
editable=true)
dashboard.new(
title='%(prefix)sRemote Write' % $._config.grafana,
editable=true
)
.addTemplate(
{
hide: 0,
......@@ -372,6 +379,9 @@ local template = grafana.template;
.addPanel(failedSamples)
.addPanel(retriedSamples)
.addPanel(enqueueRetries)
),
) + {
tags: $._config.grafana.tags,
refresh: $._config.grafana.refresh,
},
},
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册