Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Added gauge libsonnet (#162)
Browse files Browse the repository at this point in the history
* Added gauge libsonnet
  • Loading branch information
RyuCaelum committed Jan 29, 2020
1 parent f3ee1d8 commit c459106
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions grafonnet/gauge.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
new(
title,
datasource=null,
calc='mean',
description='',
height=null,
transparent=null,
)::
{
[if description != '' then 'description']: description,
[if height != null then 'height']: height,
[if transparent != null then 'transparent']: transparent,
title: title,
type: 'gauge',
datasource: datasource,
options: {
fieldOptions: {
calcs: [
calc,
],
},
},
_nextTarget:: 0,
addTarget(target):: self {
local nextTarget = super._nextTarget,
_nextTarget: nextTarget + 1,
targets+: [target { refId: std.char(std.codepoint('A') + nextTarget) }],
},
},

}
1 change: 1 addition & 0 deletions grafonnet/grafana.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
cloudwatch:: import 'cloudwatch.libsonnet',
elasticsearch:: import 'elasticsearch.libsonnet',
heatmapPanel:: import 'heatmap_panel.libsonnet',
gauge:: import 'gauge.libsonnet',
}

0 comments on commit c459106

Please sign in to comment.