Skip to content

Commit 39bc80b

Browse files
authored
Fix increase queries in clickhouse (#1392)
1 parent 4baa491 commit 39bc80b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clickhouse-mixin/dashboards/clickhouse-latency.libsonnet

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ local diskReadLatencyPanel(matcher) =
8383
{
8484
datasource: promDatasource,
8585
editorMode: 'builder',
86-
expr: 'increase(ClickHouseProfileEvents_DiskReadElapsedMicroseconds{' + matcher + '}[$__rate_interval])',
86+
expr: 'increase(ClickHouseProfileEvents_DiskReadElapsedMicroseconds{' + matcher + '}[$__interval] offset -$__interval)',
8787
legendFormat: '{{ instance }} - disk read elapsed',
8888
range: true,
8989
refId: 'A',
@@ -166,7 +166,7 @@ local diskWriteLatencyPanel(matcher) =
166166
{
167167
datasource: promDatasource,
168168
editorMode: 'builder',
169-
expr: 'increase(ClickHouseProfileEvents_DiskWriteElapsedMicroseconds{' + matcher + '}[$__rate_interval])',
169+
expr: 'increase(ClickHouseProfileEvents_DiskWriteElapsedMicroseconds{' + matcher + '}[$__interval] offset -$__interval)',
170170
legendFormat: '{{ instance }} - disk write elapsed',
171171
range: true,
172172
refId: 'A',
@@ -249,7 +249,7 @@ local networkTransmitLatencyInboundPanel(matcher) =
249249
{
250250
datasource: promDatasource,
251251
editorMode: 'builder',
252-
expr: 'increase(ClickHouseProfileEvents_NetworkReceiveElapsedMicroseconds{' + matcher + '}[$__rate_interval])',
252+
expr: 'increase(ClickHouseProfileEvents_NetworkReceiveElapsedMicroseconds{' + matcher + '}[$__interval] offset -$__interval)',
253253
legendFormat: '{{ instance }} - network receive elapsed',
254254
range: true,
255255
refId: 'A',
@@ -332,7 +332,7 @@ local networkTransmitLatencyOutboundPanel(matcher) =
332332
{
333333
datasource: promDatasource,
334334
editorMode: 'builder',
335-
expr: 'increase(ClickHouseProfileEvents_NetworkSendElapsedMicroseconds{' + matcher + '}[$__rate_interval])',
335+
expr: 'increase(ClickHouseProfileEvents_NetworkSendElapsedMicroseconds{' + matcher + '}[$__interval] offset -$__interval)',
336336
legendFormat: '{{ instance }} - network send elapsed',
337337
range: true,
338338
refId: 'A',
@@ -415,7 +415,7 @@ local zooKeeperWaitTimePanel(matcher) =
415415
{
416416
datasource: promDatasource,
417417
editorMode: 'builder',
418-
expr: 'increase(ClickHouseProfileEvents_ZooKeeperWaitMicroseconds{' + matcher + '}[$__rate_interval])',
418+
expr: 'increase(ClickHouseProfileEvents_ZooKeeperWaitMicroseconds{' + matcher + '}[$__interval] offset -$__interval)',
419419
legendFormat: '{{ instance }} - ZooKeeper wait',
420420
range: true,
421421
refId: 'A',

0 commit comments

Comments
 (0)