Skip to content

Commit b83e904

Browse files
replace prometheus targets by common
1 parent f9ead2f commit b83e904

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

dashboard/panels/cpu.libsonnet

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ local prometheus = grafana.prometheus;
105105
}),
106106
alias='$tag_label_pairs_name — $tag_label_pairs_alias'
107107
),
108+
).addTarget(
109+
if cfg.type == variable.datasource_type.prometheus then
110+
prometheus.target(
111+
expr='sum(rate(tnt_cpu_user_time{job=~"$job"}[$__rate_interval])) + sum(rate(tnt_cpu_system_time{job=~"$job"}[$__rate_interval]))',
112+
)
113+
else if cfg.type == variable.datasource_type.influxdb then
114+
influxdb.target()
108115
),
109116

110117
getrusage_cpu_total_time(

dashboard/panels/runtime.libsonnet

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local variable = import 'dashboard/variable.libsonnet';
2727

2828
total_memory(
2929
cfg,
30-
title='Total memory',
30+
title='Total memory usage',
3131
description=|||
3232
Total memory used by Tarantool.
3333
|||,
@@ -41,7 +41,7 @@ local variable = import 'dashboard/variable.libsonnet';
4141
).addTarget(
4242
if cfg.type == variable.datasource_type.prometheus then
4343
prometheus.target(
44-
expr='sum(tnt_memory{job=~"$job"}) + sum(tnt_memory_virt{job=~"$job"}'),
44+
expr='sum(tnt_memory{job=~"$job"}) + sum(tnt_memory_virt{job=~"$job"})',
4545
legendFormat='{{alias}}',
4646
)
4747
else if cfg.type == variable.datasource_type.influxdb then
@@ -64,10 +64,7 @@ local variable = import 'dashboard/variable.libsonnet';
6464
).addTarget(
6565
common.target(cfg, 'tnt_memory')
6666
).addTarget(
67-
if cfg.type == variable.datasource_type.prometheus then
68-
prometheus.target(expr=aggregate_expr(cfg, 'tnt_memory'),)
69-
else if cfg.type == variable.datasource_type.influxdb then
70-
influxdb.target()
67+
common.target(cfg, 'sum(tnt_memory{job=~"$job"})'),
7168
),
7269

7370
virt_memory(
@@ -86,10 +83,7 @@ local variable = import 'dashboard/variable.libsonnet';
8683
).addTarget(
8784
common.target(cfg, 'tnt_memory_virt')
8885
).addTarget(
89-
if cfg.type == variable.datasource_type.prometheus then
90-
prometheus.target(expr=aggregate_expr(cfg, 'tnt_memory_virt'),)
91-
else if cfg.type == variable.datasource_type.influxdb then
92-
influxdb.target()
86+
common.target(cfg, 'sum(tnt_memory_virt{job=~"$job"})'),
9387
),
9488

9589
lua_memory(

0 commit comments

Comments
 (0)