mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-23 12:30:46 +01:00
Add UIDs to dashboards (#3042)
Automatically add a uid to each dashboard. This prevents changing URLs when restarting a grafana pod and re-importing the dashboards via ConfigMaps. Signed-off-by: Stefan Andres <sandres@anaconda.com>
This commit is contained in:
parent
e11a4f0309
commit
fe71568130
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
local nodemixin = import '../lib/prom-mixin.libsonnet',
|
local nodemixin = import '../lib/prom-mixin.libsonnet',
|
||||||
grafanaDashboards+:: {
|
grafanaDashboards+:: {
|
||||||
'nodes.json': nodemixin.new(config=$._config, platform='Linux').dashboard,
|
'nodes.json': nodemixin.new(config=$._config, platform='Linux', uid=std.md5('nodes.json')).dashboard,
|
||||||
'nodes-darwin.json': nodemixin.new(config=$._config, platform='Darwin').dashboard,
|
'nodes-darwin.json': nodemixin.new(config=$._config, platform='Darwin', uid=std.md5('nodes-darwin.json')).dashboard,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,8 @@ local diskSpaceUtilisation =
|
|||||||
tags=($._config.dashboardTags),
|
tags=($._config.dashboardTags),
|
||||||
timezone='utc',
|
timezone='utc',
|
||||||
refresh='30s',
|
refresh='30s',
|
||||||
graphTooltip='shared_crosshair'
|
graphTooltip='shared_crosshair',
|
||||||
|
uid=std.md5('node-rsrc-use.json')
|
||||||
)
|
)
|
||||||
.addTemplate(datasourceTemplate)
|
.addTemplate(datasourceTemplate)
|
||||||
.addTemplate($._clusterTemplate)
|
.addTemplate($._clusterTemplate)
|
||||||
@ -215,7 +216,8 @@ local diskSpaceUtilisation =
|
|||||||
tags=($._config.dashboardTags),
|
tags=($._config.dashboardTags),
|
||||||
timezone='utc',
|
timezone='utc',
|
||||||
refresh='30s',
|
refresh='30s',
|
||||||
graphTooltip='shared_crosshair'
|
graphTooltip='shared_crosshair',
|
||||||
|
uid=std.md5('node-cluster-rsrc-use.json')
|
||||||
)
|
)
|
||||||
.addTemplate(datasourceTemplate)
|
.addTemplate(datasourceTemplate)
|
||||||
.addTemplate($._clusterTemplate)
|
.addTemplate($._clusterTemplate)
|
||||||
@ -326,7 +328,8 @@ local diskSpaceUtilisation =
|
|||||||
tags=($._config.dashboardTags),
|
tags=($._config.dashboardTags),
|
||||||
timezone='utc',
|
timezone='utc',
|
||||||
refresh='30s',
|
refresh='30s',
|
||||||
graphTooltip='shared_crosshair'
|
graphTooltip='shared_crosshair',
|
||||||
|
uid=std.md5('node-multicluster-rsrc-use.json')
|
||||||
)
|
)
|
||||||
.addTemplate(datasourceTemplate)
|
.addTemplate(datasourceTemplate)
|
||||||
.addRow(
|
.addRow(
|
||||||
|
@ -10,7 +10,7 @@ local table = grafana70.panel.table;
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
new(config=null, platform=null):: {
|
new(config=null, platform=null, uid=null):: {
|
||||||
|
|
||||||
local prometheusDatasourceTemplate = {
|
local prometheusDatasourceTemplate = {
|
||||||
current: {
|
current: {
|
||||||
@ -501,7 +501,8 @@ local table = grafana70.panel.table;
|
|||||||
tags=(config.dashboardTags),
|
tags=(config.dashboardTags),
|
||||||
timezone='utc',
|
timezone='utc',
|
||||||
refresh='30s',
|
refresh='30s',
|
||||||
graphTooltip='shared_crosshair'
|
graphTooltip='shared_crosshair',
|
||||||
|
uid=std.md5(uid)
|
||||||
)
|
)
|
||||||
.addTemplates(templates)
|
.addTemplates(templates)
|
||||||
.addRows(rows)
|
.addRows(rows)
|
||||||
@ -512,7 +513,8 @@ local table = grafana70.panel.table;
|
|||||||
tags=(config.dashboardTags),
|
tags=(config.dashboardTags),
|
||||||
timezone='utc',
|
timezone='utc',
|
||||||
refresh='30s',
|
refresh='30s',
|
||||||
graphTooltip='shared_crosshair'
|
graphTooltip='shared_crosshair',
|
||||||
|
uid=std.md5(uid)
|
||||||
)
|
)
|
||||||
.addTemplates(templates)
|
.addTemplates(templates)
|
||||||
.addRows(rows),
|
.addRows(rows),
|
||||||
|
Loading…
Reference in New Issue
Block a user