Skip to content

Commit 41a6dc8

Browse files
dashboard: add net per thread panels
Add panels to "Tarantool network activity" section to dashboard templates. Update consists of panels with following metrics: - tnt_net_per_thread_sent_total - tnt_net_per_thread_received_total - tnt_net_per_thread_connections_total - tnt_net_per_thread_connections_current - tnt_net_per_thread_requests_total - tnt_net_per_thread_requests_current - tnt_net_per_thread_requests_in_progress_total - tnt_net_per_thread_requests_in_progress_current - tnt_net_per_thread_requests_in_stream_queue_total - tnt_net_per_thread_requests_in_stream_queue_current Part of #178
1 parent 4ed60e7 commit 41a6dc8

25 files changed

+28347
-6598
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- Dashboard title customization
1111
- Panels for transaction operations
12+
- Panels with net statistics per thread
1213

1314
### Changed
1415
- Replace LuaJit deprecated metrics with new ones

dashboard/panels/net.libsonnet

Lines changed: 362 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
local grafana = import 'grafonnet/grafana.libsonnet';
2+
13
local common = import 'dashboard/panels/common.libsonnet';
24
local variable = import 'dashboard/variable.libsonnet';
35

6+
local influxdb = grafana.influxdb;
7+
local prometheus = grafana.prometheus;
8+
49
{
510
row:: common.row('Tarantool network activity'),
611

@@ -333,4 +338,361 @@ local variable = import 'dashboard/variable.libsonnet';
333338
alias,
334339
'last',
335340
)),
341+
342+
local per_thread_warning(description) = std.join(
343+
'\n',
344+
[description, |||
345+
Panel works with metrics 0.15.0 or newer, Tarantool 2.10 or newer.
346+
|||]
347+
),
348+
349+
local per_thread_rate_graph(
350+
title,
351+
description,
352+
datasource_type,
353+
datasource,
354+
policy,
355+
measurement,
356+
job,
357+
alias,
358+
metric_name,
359+
format,
360+
labelY1,
361+
panel_width,
362+
) = common.default_graph(
363+
title=title,
364+
description=description,
365+
datasource=datasource,
366+
format=format,
367+
labelY1=labelY1,
368+
panel_width=panel_width,
369+
).addTarget(
370+
if datasource_type == variable.datasource_type.prometheus then
371+
prometheus.target(
372+
expr=std.format('rate(%s{job=~"%s",alias=~"%s"}[$__rate_interval])',
373+
[metric_name, job, alias]),
374+
legendFormat='{{alias}} (thread {{thread}})',
375+
)
376+
else if datasource_type == variable.datasource_type.influxdb then
377+
influxdb.target(
378+
policy=policy,
379+
measurement=measurement,
380+
group_tags=['label_pairs_alias', 'label_pairs_thread'],
381+
alias='$tag_label_pairs_alias (thread $tag_label_pairs_thread)',
382+
fill='null',
383+
).where('metric_name', '=', metric_name).where('label_pairs_alias', '=~', alias)
384+
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),
385+
),
386+
387+
local per_thread_current_graph(
388+
title,
389+
description,
390+
datasource_type,
391+
datasource,
392+
policy,
393+
measurement,
394+
job,
395+
alias,
396+
metric_name,
397+
format,
398+
labelY1,
399+
panel_width,
400+
) = common.default_graph(
401+
title=title,
402+
description=description,
403+
datasource=datasource,
404+
format=format,
405+
labelY1=labelY1,
406+
decimals=0,
407+
panel_width=panel_width,
408+
).addTarget(
409+
if datasource_type == variable.datasource_type.prometheus then
410+
prometheus.target(
411+
expr=std.format('%s{job=~"%s",alias=~"%s"}',
412+
[metric_name, job, alias]),
413+
legendFormat='{{alias}} (thread {{thread}})',
414+
)
415+
else if datasource_type == variable.datasource_type.influxdb then
416+
influxdb.target(
417+
policy=policy,
418+
measurement=measurement,
419+
group_tags=['label_pairs_alias', 'label_pairs_thread'],
420+
alias='$tag_label_pairs_alias (thread $tag_label_pairs_thread)',
421+
fill='null',
422+
).where('metric_name', '=', metric_name).where('label_pairs_alias', '=~', alias)
423+
.selectField('value').addConverter('last'),
424+
),
425+
426+
bytes_sent_per_thread_per_second(
427+
title='Data sent (per thread)',
428+
description=per_thread_warning(|||
429+
Data sent by instance with binary protocol connections,
430+
separated per thread.
431+
Graph shows average bytes per second.
432+
|||),
433+
datasource_type=null,
434+
datasource=null,
435+
policy=null,
436+
measurement=null,
437+
job=null,
438+
alias=null,
439+
):: per_thread_rate_graph(
440+
title=title,
441+
description=description,
442+
datasource_type=datasource_type,
443+
datasource=datasource,
444+
policy=policy,
445+
measurement=measurement,
446+
job=job,
447+
alias=alias,
448+
metric_name='tnt_net_per_thread_sent_total',
449+
format='Bps',
450+
labelY1='sent',
451+
panel_width=12,
452+
),
453+
454+
bytes_received_per_thread_per_second(
455+
title='Data received (per thread)',
456+
description=per_thread_warning(|||
457+
Data received by instance from binary protocol connections,
458+
separated per thread.
459+
Graph shows average bytes per second.
460+
|||),
461+
datasource_type=null,
462+
datasource=null,
463+
policy=null,
464+
measurement=null,
465+
job=null,
466+
alias=null,
467+
):: per_thread_rate_graph(
468+
title=title,
469+
description=description,
470+
datasource_type=datasource_type,
471+
datasource=datasource,
472+
policy=policy,
473+
measurement=measurement,
474+
job=job,
475+
alias=alias,
476+
metric_name='tnt_net_per_thread_received_total',
477+
format='Bps',
478+
labelY1='received',
479+
panel_width=12,
480+
),
481+
482+
connections_per_thread_per_second(
483+
title='New binary connections (per thread)',
484+
description=per_thread_warning(|||
485+
Average number of new binary protocol connections per second,
486+
separated per thread.
487+
|||),
488+
datasource_type=null,
489+
datasource=null,
490+
policy=null,
491+
measurement=null,
492+
job=null,
493+
alias=null,
494+
):: per_thread_rate_graph(
495+
title=title,
496+
description=description,
497+
datasource_type=datasource_type,
498+
datasource=datasource,
499+
policy=policy,
500+
measurement=measurement,
501+
job=job,
502+
alias=alias,
503+
metric_name='tnt_net_per_thread_connections_total',
504+
format='none',
505+
labelY1='new per second',
506+
panel_width=12,
507+
),
508+
509+
current_connections_per_thread(
510+
title='Current binary connections (per thread)',
511+
description=per_thread_warning(|||
512+
Number of current active binary protocol connections,
513+
separated per thread.
514+
|||),
515+
datasource_type=null,
516+
datasource=null,
517+
policy=null,
518+
measurement=null,
519+
job=null,
520+
alias=null,
521+
):: per_thread_current_graph(
522+
title=title,
523+
description=description,
524+
datasource_type=datasource_type,
525+
datasource=datasource,
526+
policy=policy,
527+
measurement=measurement,
528+
job=job,
529+
alias=alias,
530+
metric_name='tnt_net_per_thread_connections_current',
531+
format='none',
532+
labelY1='current',
533+
panel_width=12,
534+
),
535+
536+
net_rps_per_thread(
537+
title='Network requests handled (per thread)',
538+
description=per_thread_warning(|||
539+
Number of network requests this instance has handled,
540+
separated per thread.
541+
Graph shows mean rps.
542+
|||),
543+
datasource_type=null,
544+
datasource=null,
545+
policy=null,
546+
measurement=null,
547+
job=null,
548+
alias=null,
549+
):: per_thread_rate_graph(
550+
title=title,
551+
description=description,
552+
datasource_type=datasource_type,
553+
datasource=datasource,
554+
policy=policy,
555+
measurement=measurement,
556+
job=job,
557+
alias=alias,
558+
metric_name='tnt_net_per_thread_requests_total',
559+
format='none',
560+
labelY1='requests per second',
561+
panel_width=8,
562+
),
563+
564+
requests_in_progress_per_thread_per_second(
565+
title='Processed requests (per thread)',
566+
description=per_thread_warning(|||
567+
Average number of requests processed per second,
568+
separated per thread.
569+
|||),
570+
datasource_type=null,
571+
datasource=null,
572+
policy=null,
573+
measurement=null,
574+
job=null,
575+
alias=null,
576+
):: per_thread_rate_graph(
577+
title=title,
578+
description=description,
579+
datasource_type=datasource_type,
580+
datasource=datasource,
581+
policy=policy,
582+
measurement=measurement,
583+
job=job,
584+
alias=alias,
585+
metric_name='tnt_net_per_thread_requests_in_progress_total',
586+
format='none',
587+
labelY1='requests per second',
588+
panel_width=8,
589+
),
590+
591+
requests_in_queue_per_thread_per_second(
592+
title='Requests in queue (overall per thread)',
593+
description=per_thread_warning(|||
594+
Average number of requests which was placed in queues
595+
of streams per second, separated per thread.
596+
|||),
597+
datasource_type=null,
598+
datasource=null,
599+
policy=null,
600+
measurement=null,
601+
job=null,
602+
alias=null,
603+
):: per_thread_rate_graph(
604+
title=title,
605+
description=description,
606+
datasource_type=datasource_type,
607+
datasource=datasource,
608+
policy=policy,
609+
measurement=measurement,
610+
job=job,
611+
alias=alias,
612+
metric_name='tnt_net_per_thread_requests_in_stream_queue_total',
613+
format='none',
614+
labelY1='requests per second',
615+
panel_width=8,
616+
),
617+
618+
net_pending_per_thread(
619+
title='Network requests pending (per thread)',
620+
description=per_thread_warning(|||
621+
Number of pending network requests,
622+
separated per thread.
623+
|||),
624+
datasource_type=null,
625+
datasource=null,
626+
policy=null,
627+
measurement=null,
628+
job=null,
629+
alias=null,
630+
):: per_thread_current_graph(
631+
title=title,
632+
description=description,
633+
datasource_type=datasource_type,
634+
datasource=datasource,
635+
policy=policy,
636+
measurement=measurement,
637+
job=job,
638+
alias=alias,
639+
metric_name='tnt_net_per_thread_requests_current',
640+
format='none',
641+
labelY1='pending',
642+
panel_width=8,
643+
),
644+
645+
requests_in_progress_current_per_thread(
646+
title='Requests in progress (per thread)',
647+
description=per_thread_warning(|||
648+
Number of requests currently being processed,
649+
separated per thread.
650+
|||),
651+
datasource_type=null,
652+
datasource=null,
653+
policy=null,
654+
measurement=null,
655+
job=null,
656+
alias=null,
657+
):: per_thread_current_graph(
658+
title=title,
659+
description=description,
660+
datasource_type=datasource_type,
661+
datasource=datasource,
662+
policy=policy,
663+
measurement=measurement,
664+
job=job,
665+
alias=alias,
666+
metric_name='tnt_net_per_thread_requests_in_progress_current',
667+
format='none',
668+
labelY1='pending',
669+
panel_width=8,
670+
),
671+
672+
requests_in_queue_current_per_thread(
673+
title='Requests in queue (current per thread)',
674+
description=per_thread_warning(|||
675+
Number of requests currently waiting in queues of streams,
676+
separated per thread.
677+
|||),
678+
datasource_type=null,
679+
datasource=null,
680+
policy=null,
681+
measurement=null,
682+
job=null,
683+
alias=null,
684+
):: per_thread_current_graph(
685+
title=title,
686+
description=description,
687+
datasource_type=datasource_type,
688+
datasource=datasource,
689+
policy=policy,
690+
measurement=measurement,
691+
job=job,
692+
alias=alias,
693+
metric_name='tnt_net_per_thread_requests_in_stream_queue_current',
694+
format='none',
695+
labelY1='pending',
696+
panel_width=8,
697+
),
336698
}

0 commit comments

Comments
 (0)