Move node-mixin into docs directory
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
61bcc5b468
commit
2df034c055
12 changed files with 0 additions and 0 deletions
60
docs/node-mixin/lib/promgrafonnet/gauge.libsonnet
Normal file
60
docs/node-mixin/lib/promgrafonnet/gauge.libsonnet
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
local grafana = import 'grafonnet/grafana.libsonnet';
|
||||
local singlestat = grafana.singlestat;
|
||||
local prometheus = grafana.prometheus;
|
||||
|
||||
{
|
||||
new(title, query)::
|
||||
singlestat.new(
|
||||
title,
|
||||
datasource='$datasource',
|
||||
span=3,
|
||||
format='percentunit',
|
||||
valueName='current',
|
||||
colors=[
|
||||
'rgba(245, 54, 54, 0.9)',
|
||||
'rgba(237, 129, 40, 0.89)',
|
||||
'rgba(50, 172, 45, 0.97)',
|
||||
],
|
||||
thresholds='50, 80',
|
||||
valueMaps=[
|
||||
{
|
||||
op: '=',
|
||||
text: 'N/A',
|
||||
value: 'null',
|
||||
},
|
||||
],
|
||||
)
|
||||
.addTarget(
|
||||
prometheus.target(
|
||||
query
|
||||
)
|
||||
) + {
|
||||
gauge: {
|
||||
maxValue: 100,
|
||||
minValue: 0,
|
||||
show: true,
|
||||
thresholdLabels: false,
|
||||
thresholdMarkers: true,
|
||||
},
|
||||
withTextNullValue(text):: self {
|
||||
valueMaps: [
|
||||
{
|
||||
op: '=',
|
||||
text: text,
|
||||
value: 'null',
|
||||
},
|
||||
],
|
||||
},
|
||||
withSpanSize(size):: self {
|
||||
span: size,
|
||||
},
|
||||
withLowerBeingBetter():: self {
|
||||
colors: [
|
||||
'rgba(50, 172, 45, 0.97)',
|
||||
'rgba(237, 129, 40, 0.89)',
|
||||
'rgba(245, 54, 54, 0.9)',
|
||||
],
|
||||
thresholds: '80, 90',
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Reference in a new issue