Skip to content

Commit

Permalink
Merge pull request grafana#85 from efritz/master
Browse files Browse the repository at this point in the history
Make time_series default for prometheus format (closes grafana#84).
  • Loading branch information
roidelapluie authored Sep 21, 2018
2 parents 6458d12 + e6f9438 commit 64147da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grafonnet/prometheus.libsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
target(
expr,
format='time_series',
intervalFactor=2,
legendFormat='',
datasource=null,
Expand All @@ -9,7 +10,7 @@
):: {
[if datasource != null then 'datasource']: datasource,
expr: expr,
format: 'time_series',
format: format,
intervalFactor: intervalFactor,
legendFormat: legendFormat,
[if interval != null then 'interval']: interval,
Expand Down
4 changes: 4 additions & 0 deletions tests/prometheus/test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ local prometheus = grafana.prometheus;
interval='1m',
legendFormat='{{instance}}'
),
heatmap: prometheus.target(
'heatmap',
format='heatmap',
),
}
6 changes: 6 additions & 0 deletions tests/prometheus/test_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"format": "time_series",
"intervalFactor": 2,
"legendFormat": ""
},
"heatmap": {
"expr": "heatmap",
"format": "heatmap",
"intervalFactor": 2,
"legendFormat": ""
}
}

0 comments on commit 64147da

Please sign in to comment.