mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Add: Custom tags and prefix in Prometheus Mixin (#8287)
* Add: custom tags and prefix Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com> * Fix: fmt Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
This commit is contained in:
parent
8dc53c2218
commit
aa1ca13025
|
@ -37,5 +37,12 @@
|
||||||
// expression is matched against the `alertmanager` label.
|
// expression is matched against the `alertmanager` label.
|
||||||
// Example: @'http://test-alertmanager\..*'
|
// Example: @'http://test-alertmanager\..*'
|
||||||
nonNotifyingAlertmanagerRegEx: @'',
|
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+:: {
|
grafanaDashboards+:: {
|
||||||
'prometheus.json':
|
'prometheus.json':
|
||||||
g.dashboard('Prometheus Overview')
|
g.dashboard(
|
||||||
|
'%(prefix)sOverview' % $._config.grafana
|
||||||
|
)
|
||||||
.addMultiTemplate('job', 'prometheus_build_info', 'job')
|
.addMultiTemplate('job', 'prometheus_build_info', 'job')
|
||||||
.addMultiTemplate('instance', 'prometheus_build_info', 'instance')
|
.addMultiTemplate('instance', 'prometheus_build_info', 'instance')
|
||||||
.addRow(
|
.addRow(
|
||||||
|
@ -96,7 +98,10 @@ local template = grafana.template;
|
||||||
{ yaxes: g.yaxes('ms') } +
|
{ yaxes: g.yaxes('ms') } +
|
||||||
g.stack,
|
g.stack,
|
||||||
)
|
)
|
||||||
),
|
) + {
|
||||||
|
tags: $._config.grafana.tags,
|
||||||
|
refresh: $._config.grafana.refresh,
|
||||||
|
},
|
||||||
// Remote write specific dashboard.
|
// Remote write specific dashboard.
|
||||||
'prometheus-remote-write.json':
|
'prometheus-remote-write.json':
|
||||||
local timestampComparison =
|
local timestampComparison =
|
||||||
|
@ -287,8 +292,10 @@ local template = grafana.template;
|
||||||
legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}'
|
legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}'
|
||||||
));
|
));
|
||||||
|
|
||||||
dashboard.new('Prometheus Remote Write',
|
dashboard.new(
|
||||||
editable=true)
|
title='%(prefix)sRemote Write' % $._config.grafana,
|
||||||
|
editable=true
|
||||||
|
)
|
||||||
.addTemplate(
|
.addTemplate(
|
||||||
{
|
{
|
||||||
hide: 0,
|
hide: 0,
|
||||||
|
@ -372,6 +379,9 @@ local template = grafana.template;
|
||||||
.addPanel(failedSamples)
|
.addPanel(failedSamples)
|
||||||
.addPanel(retriedSamples)
|
.addPanel(retriedSamples)
|
||||||
.addPanel(enqueueRetries)
|
.addPanel(enqueueRetries)
|
||||||
),
|
) + {
|
||||||
|
tags: $._config.grafana.tags,
|
||||||
|
refresh: $._config.grafana.refresh,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue