Skip to content

Commit 779d23a

Browse files
DifferentialOrangevasiliy-t
authored andcommitted
Slab panels: add alias tag, sort legend and tooltip
1 parent f148334 commit 779d23a

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

example/project/app/roles/custom.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
local cartridge = require('cartridge')
22
local metrics = require("metrics")
3-
metrics.enable_default_metrics()
43
local json_metrics = require("metrics.plugins.json")
54
local prometheus = require("metrics.plugins.prometheus")
65

6+
metrics.set_global_labels({ alias = 'instance'})
7+
metrics.enable_default_metrics()
8+
79
local function init(opts) -- luacheck: no unused args
810
-- if opts.is_master then
911
-- end

tarantool/slab.libsonnet

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ local influxdb = grafana.influxdb;
3131
labelY1='used ratio',
3232
fill=0,
3333
decimals=2,
34+
sort='decreasing',
3435
legend_alignAsTable=true,
3536
legend_current=true,
3637
legend_values=true,
37-
legend_sortDesc=true
38+
legend_sort='current',
39+
legend_sortDesc=true,
3840
).addTarget(
3941
influxdb.target(
40-
measurement=measurement
42+
measurement=measurement,
43+
group_tags=['label_pairs_alias'],
44+
alias='$tag_label_pairs_alias',
4145
).where('metric_name', '=', metric_name).selectField('value').addConverter('mean')
4246
),
4347

tests/InfluxDB/dashboard_compiled.json

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"rightSide": false,
111111
"show": true,
112112
"sideWidth": null,
113+
"sort": "current",
113114
"sortDesc": true,
114115
"total": false,
115116
"values": true
@@ -129,13 +130,20 @@
129130
"steppedLine": false,
130131
"targets": [
131132
{
133+
"alias": "$tag_label_pairs_alias",
132134
"groupBy": [
133135
{
134136
"params": [
135137
"$__interval"
136138
],
137139
"type": "time"
138140
},
141+
{
142+
"params": [
143+
"label_pairs_alias"
144+
],
145+
"type": "tag"
146+
},
139147
{
140148
"params": [
141149
"none"
@@ -176,7 +184,7 @@
176184
"title": "Used by slab allocator (quota_used_ratio)",
177185
"tooltip": {
178186
"shared": true,
179-
"sort": 0,
187+
"sort": 2,
180188
"value_type": "individual"
181189
},
182190
"type": "graph",
@@ -233,6 +241,7 @@
233241
"rightSide": false,
234242
"show": true,
235243
"sideWidth": null,
244+
"sort": "current",
236245
"sortDesc": true,
237246
"total": false,
238247
"values": true
@@ -252,13 +261,20 @@
252261
"steppedLine": false,
253262
"targets": [
254263
{
264+
"alias": "$tag_label_pairs_alias",
255265
"groupBy": [
256266
{
257267
"params": [
258268
"$__interval"
259269
],
260270
"type": "time"
261271
},
272+
{
273+
"params": [
274+
"label_pairs_alias"
275+
],
276+
"type": "tag"
277+
},
262278
{
263279
"params": [
264280
"none"
@@ -299,7 +315,7 @@
299315
"title": "Used for tuples and indexes (arena_used_ratio)",
300316
"tooltip": {
301317
"shared": true,
302-
"sort": 0,
318+
"sort": 2,
303319
"value_type": "individual"
304320
},
305321
"type": "graph",
@@ -356,6 +372,7 @@
356372
"rightSide": false,
357373
"show": true,
358374
"sideWidth": null,
375+
"sort": "current",
359376
"sortDesc": true,
360377
"total": false,
361378
"values": true
@@ -375,13 +392,20 @@
375392
"steppedLine": false,
376393
"targets": [
377394
{
395+
"alias": "$tag_label_pairs_alias",
378396
"groupBy": [
379397
{
380398
"params": [
381399
"$__interval"
382400
],
383401
"type": "time"
384402
},
403+
{
404+
"params": [
405+
"label_pairs_alias"
406+
],
407+
"type": "tag"
408+
},
385409
{
386410
"params": [
387411
"none"
@@ -422,7 +446,7 @@
422446
"title": "Used only for tuples (items_used_ratio)",
423447
"tooltip": {
424448
"shared": true,
425-
"sort": 0,
449+
"sort": 2,
426450
"value_type": "individual"
427451
},
428452
"type": "graph",

0 commit comments

Comments
 (0)