File tree Expand file tree Collapse file tree 3 files changed +36
-6
lines changed
example/project/app/roles Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 11local cartridge = require (' cartridge' )
22local metrics = require (" metrics" )
3- metrics .enable_default_metrics ()
43local json_metrics = require (" metrics.plugins.json" )
54local prometheus = require (" metrics.plugins.prometheus" )
65
6+ metrics .set_global_labels ({ alias = ' instance' })
7+ metrics .enable_default_metrics ()
8+
79local function init (opts ) -- luacheck: no unused args
810 -- if opts.is_master then
911 -- end
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 110110 "rightSide" : false ,
111111 "show" : true ,
112112 "sideWidth" : null ,
113+ "sort" : " current" ,
113114 "sortDesc" : true ,
114115 "total" : false ,
115116 "values" : true
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"
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" ,
233241 "rightSide" : false ,
234242 "show" : true ,
235243 "sideWidth" : null ,
244+ "sort" : " current" ,
236245 "sortDesc" : true ,
237246 "total" : false ,
238247 "values" : true
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"
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" ,
356372 "rightSide" : false ,
357373 "show" : true ,
358374 "sideWidth" : null ,
375+ "sort" : " current" ,
359376 "sortDesc" : true ,
360377 "total" : false ,
361378 "values" : true
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"
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" ,
You can’t perform that action at this time.
0 commit comments