Skip to content

Commit

Permalink
singlestat: allow overriding min_span, height, and description
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie committed Dec 15, 2017
1 parent 29b93d5 commit 3e1d417
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grafonnet/singlestat.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
title,
id=null,
format="none",
description="",
interval=null,
height=null,
datasource=null,
span=12,
min_span=null,
decimals=null,
valueName="avg",
valueFontSize="80%",
Expand Down Expand Up @@ -36,7 +39,10 @@
)::
{
[if id != null then "id"]: id,
[if height != null then "height"]: height,
[if description != "" then "description"]: description,
[if transparent != null then "transparent"]: transparent,
[if min_span != null then "minSpan"]: min_span,
title: title,
span: span,
type: "singlestat",
Expand Down
3 changes: 3 additions & 0 deletions tests/singlestat/test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ local singlestat = grafana.singlestat;
id=1,
format="s",
interval="10s",
height="42px",
description="mystat",
min_span=6,
decimals=2,
datasource="prom1",
span=1,
Expand Down
3 changes: 3 additions & 0 deletions tests/singlestat/test_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"datasource": "prom1",
"decimals": 2,
"description": "mystat",
"format": "s",
"gauge": {
"maxValue": 100,
Expand All @@ -18,6 +19,7 @@
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "42px",
"id": 1,
"interval": "10s",
"links": [ ],
Expand All @@ -33,6 +35,7 @@
}
],
"maxDataPoints": 100,
"minSpan": 6,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
Expand Down

0 comments on commit 3e1d417

Please sign in to comment.