kube-prometheus: Make grafana dashboards non-editable

This commit is contained in:
Frederic Branczyk
2018-01-11 10:56:07 +01:00
parent 5392443721
commit d05a3ac486
9 changed files with 199 additions and 145 deletions

View File

@@ -20,18 +20,17 @@ def Dashboard(
'pluginId': 'prometheus',
'pluginName': 'Prometheus'
},
], rows=rows, graphTooltip=graphTooltip, **optional_args,
], rows=rows, graphTooltip=graphTooltip, editable=False, **optional_args,
)
def Row(
panels, height=None, title='Dashboard Row', showTitle=False,
editable=None
panels, height=None, title='Dashboard Row', showTitle=False
):
assert isinstance(height, (type(None), int))
return core.Row(
panels=panels, height=height, title=title, showTitle=showTitle,
titleSize='h6', editable=editable,
titleSize='h6', editable=False,
)
@@ -61,7 +60,7 @@ def SingleStat(
mappingTypes=mappingTypes, targets=targets,
mappingType=mappingType, format=format, colors=colors, span=span,
postfix=postfix, sparkline=sparkline, prefixFontSize=prefixFontSize,
hideTimeOverride=None, transparent=transparent,
hideTimeOverride=None, transparent=transparent, editable=False,
)
@@ -82,7 +81,7 @@ def Graph(
return core.Graph(
id=id, title=title, dashLength=dashLength, dashes=dashes,
spaceLength=spaceLength, targets=targets, xAxis=xAxis, yAxes=yAxes,
dataSource='${DS_PROMETHEUS}', nullPointMode=nullPointMode,
dataSource='${DS_PROMETHEUS}', nullPointMode=nullPointMode, editable=False,
)

View File

@@ -7,6 +7,7 @@ dashboard = Dashboard(
gnetId=22,
graphTooltip=0,
refresh=False,
editable=False,
schemaVersion=14,
time=Time(start='now-1h'),
timezone='browser',
@@ -22,7 +23,7 @@ dashboard = Dashboard(
],
rows=[
Row(
height=250, title='New Row', showTitle=False,
height=250, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Idle CPU',
@@ -31,6 +32,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=6,
tooltip=Tooltip(msResolution=False),
@@ -57,6 +59,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=6,
tooltip=Tooltip(msResolution=False),
@@ -94,7 +97,7 @@ dashboard = Dashboard(
],
),
Row(
height=250, title='New Row', showTitle=False,
height=250, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Memory Usage',
@@ -103,6 +106,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=9,
stack=True,
@@ -171,6 +175,7 @@ dashboard = Dashboard(
format='percent',
span=3,
gauge=Gauge(show=True),
editable=False,
thresholds='80, 90',
valueMaps=[
{
@@ -203,7 +208,7 @@ dashboard = Dashboard(
],
),
Row(
height=246, title='New Row', showTitle=False,
height=246, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Disk I/O',
@@ -212,6 +217,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=9,
tooltip=Tooltip(msResolution=False),
@@ -264,6 +270,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
id=12,
span=3,
editable=False,
format='percentunit',
valueName='current',
gauge=Gauge(
@@ -301,7 +308,7 @@ dashboard = Dashboard(
]
),
Row(
height=250, title='New Row', showTitle=False,
height=250, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Network Received',
@@ -310,6 +317,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=6,
tooltip=Tooltip(msResolution=False),
@@ -343,6 +351,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=6,
tooltip=Tooltip(msResolution=False),
@@ -372,7 +381,7 @@ dashboard = Dashboard(
],
),
Row(
height=276, title='New Row', showTitle=False,
height=276, title='New Row', showTitle=False, editable=False,
titleSize='h6',
panels=[
Graph(
@@ -381,6 +390,7 @@ dashboard = Dashboard(
id=11,
span=9,
dashes=False,
editable=False,
spaceLength=11,
tooltip=Tooltip(
msResolution=False,
@@ -413,6 +423,7 @@ dashboard = Dashboard(
title='Pod Utilization',
dataSource='${DS_PROMETHEUS}',
id=7,
editable=False,
span=3,
format='percent',
rangeMaps=[

View File

@@ -6,6 +6,7 @@ dashboard = Dashboard(
version=9,
graphTooltip=0,
schemaVersion=14,
editable=False,
time=Time(start='now-6h'),
timezone='browser',
inputs=[
@@ -20,7 +21,7 @@ dashboard = Dashboard(
],
rows=[
Row(
height=254, title='Row', showTitle=False,
height=254, title='Row', showTitle=False, editable=False,
titleSize='h6', panels=[
SingleStat(
title='Control Plane Components Down',
@@ -30,6 +31,7 @@ dashboard = Dashboard(
span=3,
thresholds='1, 3',
colorValue=True,
editable=False,
rangeMaps=[
{
'from': 'null',
@@ -77,6 +79,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='1, 3',
@@ -122,6 +125,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='3, 5',
@@ -167,6 +171,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='1, 3',
@@ -209,7 +214,7 @@ dashboard = Dashboard(
],
),
Row(
height=250, title='Row', showTitle=False,
height=250, title='Row', showTitle=False, editable=False,
titleSize='h6', panels=[
SingleStat(
title='Node Not Ready',
@@ -217,6 +222,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='1, 3',
@@ -262,6 +268,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='1, 3',
@@ -307,6 +314,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='1, 3',
@@ -352,6 +360,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
gauge=Gauge(),
colorValue=True,
editable=False,
span=3,
valueName='current',
thresholds='1, 3',

View File

@@ -8,6 +8,7 @@ dashboard = Dashboard(
time=Time(start='now-6h'),
timezone='browser',
refresh=None,
editable=False,
inputs=[
{
'name': 'DS_PROMETHEUS',
@@ -20,12 +21,13 @@ dashboard = Dashboard(
],
rows=[
Row(
title='Dashboard Row', showTitle=False, titleSize='h6',
title='Dashboard Row', showTitle=False, titleSize='h6', editable=False,
panels=[
SingleStat(
title='API Servers UP',
dataSource='${DS_PROMETHEUS}',
format='percent',
editable=False,
gauge=Gauge(
show=True,
),
@@ -76,6 +78,7 @@ dashboard = Dashboard(
title='Controller Managers UP',
dataSource='${DS_PROMETHEUS}',
format='percent',
editable=False,
gauge=Gauge(
show=True,
),
@@ -127,6 +130,7 @@ dashboard = Dashboard(
title='Schedulers UP',
dataSource='${DS_PROMETHEUS}',
format='percent',
editable=False,
gauge=Gauge(
show=True,
),
@@ -177,6 +181,7 @@ dashboard = Dashboard(
title='API Server Request Error Rate',
dataSource='${DS_PROMETHEUS}',
format='percent',
editable=False,
gauge=Gauge(
show=True,
),
@@ -224,7 +229,7 @@ dashboard = Dashboard(
],
),
Row(
title='Dashboard Row', showTitle=False, titleSize='h6',
title='Dashboard Row', showTitle=False, titleSize='h6', editable=False,
panels=[
Graph(
title='API Server Request Latency',
@@ -233,6 +238,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
lineWidth=1,
nullPointMode='null',
tooltip=Tooltip(
@@ -258,13 +264,14 @@ dashboard = Dashboard(
],
),
Row(
title='Dashboard Row', showTitle=False, titleSize='h6',
title='Dashboard Row', showTitle=False, titleSize='h6', editable=False,
panels=[
Graph(
title='End to End Scheduling Latency',
id=5,
dataSource='${DS_PROMETHEUS}',
isNew=False,
editable=False,
dashLength=10,
lineWidth=1,
nullPointMode="null",
@@ -295,6 +302,7 @@ dashboard = Dashboard(
id=6,
dataSource='${DS_PROMETHEUS}',
isNew=False,
editable=False,
dashLength=10,
lineWidth=1,
nullPointMode="null",

View File

@@ -6,6 +6,7 @@ dashboard = Dashboard(
version=2,
graphTooltip=0,
refresh=False,
editable=False,
schemaVersion=14,
time=Time(start='now-3h'),
timezone='browser',
@@ -21,7 +22,7 @@ dashboard = Dashboard(
],
rows=[
Row(
height=300, title='CPU Cores', showTitle=False,
height=300, title='CPU Cores', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='CPU Cores',
@@ -37,6 +38,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
lineWidth=1,
spaceLength=10,
nullPointMode='null',
@@ -74,6 +76,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
id=2,
format='percent',
editable=False,
span=3,
gauge=Gauge(show=True),
sparkline=SparkLine(show=True),
@@ -109,7 +112,7 @@ dashboard = Dashboard(
],
),
Row(
height=300, title='Memory', showTitle=False,
height=300, title='Memory', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Memory',
@@ -126,6 +129,7 @@ dashboard = Dashboard(
dashes=False,
lineWidth=1,
isNew=False,
editable=False,
spaceLength=10,
span=9,
nullPointMode='null',
@@ -165,6 +169,7 @@ dashboard = Dashboard(
span=3,
gauge=Gauge(show=True),
sparkline=SparkLine(show=True),
editable=False,
valueFontSize='110%',
thresholds='80, 90',
valueMaps=[

View File

@@ -8,6 +8,7 @@ dashboard = Dashboard(
gnetId=22,
graphTooltip=0,
refresh=False,
editable=False,
schemaVersion=14,
time=Time(start='now-1h'),
timezone='browser',
@@ -45,13 +46,14 @@ dashboard = Dashboard(
]),
rows=[
Row(
height=250, title='New Row', showTitle=False,
height=250, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Idle CPU',
dataSource='${DS_PROMETHEUS}',
id=3,
isNew=False,
editable=False,
spaceLength=10,
span=6,
dashLength=10,
@@ -83,6 +85,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
id=9,
isNew=False,
editable=False,
spaceLength=10,
span=6,
dashLength=10,
@@ -122,13 +125,14 @@ dashboard = Dashboard(
],
),
Row(
height=250, title='New Row', showTitle=False,
height=250, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Memory Usage',
dataSource='${DS_PROMETHEUS}',
id=4,
isNew=False,
editable=False,
spaceLength=10,
span=9,
stack=True,
@@ -198,6 +202,7 @@ dashboard = Dashboard(
id=5,
format='percent',
gauge=Gauge(show=True),
editable=False,
span=3,
rangeMaps=[
{
@@ -232,7 +237,7 @@ dashboard = Dashboard(
],
),
Row(
height=250, titleSize='h6', title='New Row',
height=250, titleSize='h6', title='New Row', editable=False,
showTitle=False, panels=[
Graph(
title='Disk I/O',
@@ -240,6 +245,7 @@ dashboard = Dashboard(
id=6,
dashLength=10,
dashes=False,
editable=False,
spaceLength=10,
span=9,
tooltip=Tooltip(msResolution=False),
@@ -301,6 +307,7 @@ dashboard = Dashboard(
dataSource='${DS_PROMETHEUS}',
id=7,
thresholds='0.75, 0.9',
editable=False,
valueName='current',
format='percentunit',
span=3,
@@ -340,7 +347,7 @@ dashboard = Dashboard(
),
Row(
height=250, title='New Row', titleSize='h6',
showTitle=False,
showTitle=False, editable=False,
panels=[
Graph(
title='Network Received',
@@ -349,6 +356,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=6,
tooltip=Tooltip(msResolution=False),
@@ -382,6 +390,7 @@ dashboard = Dashboard(
dashLength=10,
dashes=False,
isNew=False,
editable=False,
spaceLength=10,
span=6,
tooltip=Tooltip(msResolution=False),

View File

@@ -6,6 +6,7 @@ dashboard = Dashboard(
version=1,
graphTooltip=1,
refresh=False,
editable=False,
schemaVersion=14,
time=Time(start='now-6h'),
timezone='browser',
@@ -85,13 +86,14 @@ dashboard = Dashboard(
]),
rows=[
Row(
height=250, title='Row', showTitle=False,
height=250, title='Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Memory Usage',
dataSource='${DS_PROMETHEUS}',
id=1,
isNew=False,
editable=False,
spaceLength=10,
span=12,
dashLength=10,
@@ -149,13 +151,14 @@ dashboard = Dashboard(
],
),
Row(
height=250, title='Row', showTitle=False,
height=250, title='Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='CPU Usage',
dataSource='${DS_PROMETHEUS}',
id=2,
isNew=False,
editable=False,
spaceLength=10,
span=12,
dashLength=10,
@@ -211,13 +214,14 @@ dashboard = Dashboard(
],
),
Row(
height=250, title='New Row', showTitle=False,
height=250, title='New Row', showTitle=False, editable=False,
titleSize='h6', panels=[
Graph(
title='Network I/O',
dataSource='${DS_PROMETHEUS}',
id=3,
isNew=False,
editable=False,
spaceLength=10,
span=12,
dashLength=10,

View File

@@ -39,7 +39,7 @@
"list": []
},
"description": "etcd sample Grafana dashboard with Prometheus",
"editable": true,
"editable": false,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
@@ -61,7 +61,7 @@
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"format": "none",
"gauge": {
@@ -137,7 +137,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"id": 23,
@@ -226,7 +226,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"id": 41,
@@ -328,7 +328,7 @@
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"decimals": null,
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"grid": {},
@@ -409,7 +409,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"grid": {},
@@ -498,7 +498,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"id": 29,
@@ -590,7 +590,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 5,
"id": 22,
@@ -670,7 +670,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 5,
"id": 21,
@@ -750,7 +750,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"id": 20,
@@ -831,7 +831,7 @@
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"decimals": null,
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"grid": {},
@@ -924,7 +924,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"id": 40,
@@ -1031,7 +1031,7 @@
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"decimals": 0,
"editable": true,
"editable": false,
"error": false,
"fill": 0,
"id": 19,