Skip to content

Commit c8d3101

Browse files
dashboard: use auto decimal scaling
Use auto decimal scaling for most panels. The main motivation is bad scaling for low value panels with decimalsY1=0. After the patch, scaling for low values should be good enough. At the same time, if values became high, there shouldn't be any excessive decimals. The drawback is that sometimes Grafana auto scaling is aesthetically weird, like mixing 2 s, 1.5 s and 500 ms on the same axis.
1 parent bd68364 commit c8d3101

31 files changed

+235
-11324
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Changed
10+
- Use auto decimal scaling for most panels (PR #213)
11+
12+
### Fixed
13+
- Scaling for some low values panels (PR #213)
14+
15+
716
## [2.1.0] - 2023-05-23
817
Grafana revisions: [InfluxDB revision 17](https://grafana.com/api/dashboards/12567/revisions/17/download), [Prometheus revision 17](https://grafana.com/api/dashboards/13054/revisions/17/download), [InfluxDB TDG revision 6](https://grafana.com/api/dashboards/16405/revisions/6/download), [Prometheus TDG revision 6](https://grafana.com/api/dashboards/16406/revisions/6/download).
918

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ You can add your own custom panels to the bottom of the template dashboard.
194194
min, # (optional) Min of the Y axes
195195
max, # (optional) Max of the Y axes
196196
labelY1, # (optional) Label of the left Y axis
197-
decimals, # (default 3) Override automatic decimal precision for legend and tooltip
198-
decimalsY1, # (default 0) Override automatic decimal precision for the left Y axis
197+
decimals, # (default null) Override automatic decimal precision for legend and tooltip
198+
decimalsY1, # (default null) Override automatic decimal precision for the left Y axis
199199
legend_avg, # (default true) Show average in legend
200200
legend_max, # (default true) Show max in legend
201201
panel_height, # (default 8) Panel heigth in grid units

dashboard/panels/cluster.libsonnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ local prometheus = grafana.prometheus;
320320
title=title,
321321
description=description,
322322
min=0,
323-
decimals=0,
324323
legend_avg=false,
325324
legend_max=false,
326325
panel_height=6,

dashboard/panels/common.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ local influxdb_query_filters(filters) = std.join(' AND ', std.map(
3535
max=null,
3636
labelY1=null,
3737
fill=0,
38-
decimals=2,
39-
decimalsY1=0,
38+
decimals=null,
39+
decimalsY1=null,
4040
legend_avg=true,
4141
legend_max=true,
4242
legend_rightSide=false,

dashboard/panels/cpu.libsonnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ local prometheus = grafana.prometheus;
7171
description=description,
7272
labelY1='ticks per second',
7373
min=0,
74-
decimalsY1=2,
7574
panel_width=12,
7675
).addTarget(
7776
common.target(

dashboard/panels/crud.libsonnet

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ local operation_rps_template(
4545
description=description,
4646
min=0,
4747
labelY1='requests per second',
48-
decimals=2,
49-
decimalsY1=2,
5048
panel_height=8,
5149
panel_width=6,
5250
).addTarget(
@@ -90,8 +88,6 @@ local operation_latency_template(
9088
format='s',
9189
min=0,
9290
labelY1='99th percentile',
93-
decimals=2,
94-
decimalsY1=2,
9591
panel_height=8,
9692
panel_width=6,
9793
).addTarget(

dashboard/panels/http.libsonnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ local prometheus = grafana.prometheus;
9999
description=description,
100100
format='s',
101101
labelY1=label,
102-
decimalsY1=null,
103102
).addTarget(
104103
common.target(
105104
cfg,

dashboard/panels/mvcc.libsonnet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ local prometheus = grafana.prometheus;
383383
description=description,
384384
format='none',
385385
labelY1='tuples',
386+
decimals=0,
386387
panel_width=6,
387388
).addTarget(
388389
mvcc_target(cfg, 'tnt_memtx_mvcc_tuples_used_stories', 'count')
@@ -413,6 +414,7 @@ local prometheus = grafana.prometheus;
413414
description=description,
414415
format='none',
415416
labelY1='tuples',
417+
decimals=0,
416418
panel_width=6,
417419
).addTarget(
418420
mvcc_target(cfg, 'tnt_memtx_mvcc_tuples_used_retained', 'count')
@@ -443,6 +445,7 @@ local prometheus = grafana.prometheus;
443445
description=description,
444446
format='none',
445447
labelY1='tuples',
448+
decimals=0,
446449
panel_width=6,
447450
).addTarget(
448451
mvcc_target(cfg, 'tnt_memtx_mvcc_tuples_read_view_stories', 'count')
@@ -473,6 +476,7 @@ local prometheus = grafana.prometheus;
473476
description=description,
474477
format='none',
475478
labelY1='tuples',
479+
decimals=0,
476480
panel_width=6,
477481
).addTarget(
478482
mvcc_target(cfg, 'tnt_memtx_mvcc_tuples_read_view_retained', 'count')
@@ -503,6 +507,7 @@ local prometheus = grafana.prometheus;
503507
description=description,
504508
format='none',
505509
labelY1='tuples',
510+
decimals=0,
506511
panel_width=6,
507512
).addTarget(
508513
mvcc_target(cfg, 'tnt_memtx_mvcc_tuples_tracking_stories', 'count')
@@ -533,6 +538,7 @@ local prometheus = grafana.prometheus;
533538
description=description,
534539
format='none',
535540
labelY1='tuples',
541+
decimals=0,
536542
panel_width=6,
537543
).addTarget(
538544
mvcc_target(cfg, 'tnt_memtx_mvcc_tuples_tracking_retained', 'count')

dashboard/panels/replication.libsonnet

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ local timeseries = import 'dashboard/grafana/timeseries.libsonnet';
44
local common = import 'dashboard/panels/common.libsonnet';
55
local variable = import 'dashboard/variable.libsonnet';
66

7-
local graph = grafana.graphPanel;
87
local influxdb = grafana.influxdb;
98
local prometheus = grafana.prometheus;
109

@@ -59,8 +58,6 @@ local prometheus = grafana.prometheus;
5958
title=title,
6059
description=description,
6160
format='s',
62-
decimals=null,
63-
decimalsY1=null,
6461
legend_avg=false,
6562
min=0,
6663
panel_width=8,
@@ -91,8 +88,6 @@ local prometheus = grafana.prometheus;
9188
title=title,
9289
description=description,
9390
format='s',
94-
decimals=null,
95-
decimalsY1=null,
9691
fill=1,
9792
legend_avg=false,
9893
legend_max=false,

dashboard/panels/runtime.libsonnet

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ local common = import 'dashboard/panels/common.libsonnet';
159159
title=title,
160160
description=description,
161161
labelY1='cycle duration',
162-
decimals=2,
163-
decimalsY1=2,
164162
format='ms',
165163
panel_width=12,
166164
).addTarget(

0 commit comments

Comments
 (0)