Convert queues dashboard to grafonnet

Change-Id: Ia3307a923b99ecacaaa8c803aa2af0c9bf4eabcb
This commit is contained in:
Thomas Draebing 2020-09-09 16:03:58 +02:00
parent ce5b8300f1
commit 72391ac5e5
13 changed files with 524 additions and 1170 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,70 @@
local grafana = import '../../../vendor/grafonnet/grafana.libsonnet';
local dashboard = grafana.dashboard;
local template = grafana.template;
local graphPanel = grafana.graphPanel;
local prometheus = grafana.prometheus;
local defaults = import '../../globals/defaults.libsonnet';
local gridPos = import '../../globals/grid_pos.libsonnet';
local publishVariables = import '../../globals/publish.libsonnet';
local variables = import '../globals/variables.libsonnet';
local http_queue_panel = import './panels/http_queue.libsonnet';
local http_threads_panel = import './panels/http_threads.libsonnet';
local index_queue_panel = import './panels/index_queue.libsonnet';
local index_threads_panel = import './panels/index_threads.libsonnet';
local misc_queue_panel = import './panels/misc_queue.libsonnet';
local misc_threads_panel = import './panels/misc_threads.libsonnet';
local rest_api_request_rate_panel = import './panels/rest-api-request-rate.libsonnet';
local ssh_queue_panel = import './panels/ssh_queue.libsonnet';
local ssh_threads_panel = import './panels/ssh_threads.libsonnet';
dashboard.new(
'Gerrit - Queues',
tags=['gerrit'],
schemaVersion=defaults.dashboards.schemaVersion,
editable=defaults.dashboards.editable,
time_from=defaults.dashboards.timeFrom,
time_to=defaults.dashboards.timeTo,
refresh=defaults.dashboards.refresh,
graphTooltip='shared_tooltip',
)
.addTemplate(variables.instance)
.addTemplate(variables.replica)
.addPanel(
ssh_threads_panel,
gridPos=gridPos.new(0, 0, 3)
)
.addPanel(
http_threads_panel,
gridPos=gridPos.new(0, 1, 3)
)
.addPanel(
index_threads_panel,
gridPos=gridPos.new(0, 2, 3)
)
.addPanel(
ssh_queue_panel,
gridPos=gridPos.new(1, 0, 3)
)
.addPanel(
http_queue_panel,
gridPos=gridPos.new(1, 1, 3)
)
.addPanel(
index_queue_panel,
gridPos=gridPos.new(1, 2, 3)
)
.addPanel(
misc_threads_panel,
gridPos=gridPos.new(2, 0)
)
.addPanel(
rest_api_request_rate_panel,
gridPos=gridPos.new(2, 1)
)
.addPanel(
misc_queue_panel,
gridPos=gridPos.new(3, 0)
)
+ if std.extVar('publish') then publishVariables else {}

View file

@ -0,0 +1,23 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local HTTP_TARGET = 'http';
lineGraph.new(
title='HTTP queue',
labelY1='Tasks',
)
.addTarget(
prometheus.target(
'http_server_jetty_threadpool_queue_size{instance="$instance",replica="$replica"}',
legendFormat=HTTP_TARGET,
)
)
.addSeriesOverride(
{
alias: HTTP_TARGET,
color: '#FFB357',
}
)

View file

@ -0,0 +1,65 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local ACTIVE_THREADS_TARGET = 'active threads';
local RESERVED_THREADS_TARGET = 'reserved threads';
local MAX_POOL_SIZE_TARGET = 'max pool size';
local POOL_SIZE_TARGET = 'pool size';
lineGraph.new(
title='HTTP threads',
labelY1='Threads',
)
.addTarget(
prometheus.target(
'http_server_jetty_threadpool_active_threads{instance="$instance",replica="$replica"}',
legendFormat=ACTIVE_THREADS_TARGET,
)
)
.addTarget(
prometheus.target(
'http_server_jetty_threadpool_reserved_threads{instance="$instance",replica="$replica"}',
legendFormat=RESERVED_THREADS_TARGET,
)
)
.addTarget(
prometheus.target(
'http_server_jetty_threadpool_max_pool_size{instance="$instance",replica="$replica"}',
legendFormat=MAX_POOL_SIZE_TARGET,
)
)
.addTarget(
prometheus.target(
'http_server_jetty_threadpool_pool_size{instance="$instance",replica="$replica"}',
legendFormat= POOL_SIZE_TARGET,
)
)
.addSeriesOverride(
{
alias: ACTIVE_THREADS_TARGET,
color: '#FFB357',
}
)
.addSeriesOverride(
{
alias: RESERVED_THREADS_TARGET,
color: '#56A64B',
fill: 0,
}
)
.addSeriesOverride(
{
alias: MAX_POOL_SIZE_TARGET,
color: '#FA6400',
fill: 0,
}
)
.addSeriesOverride(
{
alias: POOL_SIZE_TARGET,
color: '#1F60C4',
fill: 0,
}
)

View file

@ -0,0 +1,36 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local BATCH_TARGET = 'batch';
local INTERACTIVE_TARGET = 'interactive';
lineGraph.new(
title='INDEX queue',
labelY1='Tasks',
)
.addTarget(
prometheus.target(
'queue_index_batch_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=BATCH_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_index_interactive_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=INTERACTIVE_TARGET,
)
)
.addSeriesOverride(
{
alias: BATCH_TARGET,
color: '#FFB357',
}
)
.addSeriesOverride(
{
alias: INTERACTIVE_TARGET,
color: '#C0D8FF',
}
)

View file

@ -0,0 +1,64 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local BATCH_THREADS_TARGET = 'batch threads';
local BATCH_POOL_SIZE_TARGET = 'batch pool size';
local INTERACTIVE_THREADS_TARGET = 'interactive threads';
local INTERACTIVE_POOL_SIZE_TARGET = 'interactive pool size';
lineGraph.new(
title='INDEX threads',
labelY1='Threads',
)
.addTarget(
prometheus.target(
'queue_index_batch_active_threads{instance="$instance",replica="$replica"}',
legendFormat=BATCH_THREADS_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_index_batch_pool_size{instance="$instance",replica="$replica"}',
legendFormat=BATCH_POOL_SIZE_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_index_interactive_active_threads{instance="$instance",replica="$replica"}',
legendFormat=INTERACTIVE_THREADS_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_index_interactive_pool_size{instance="$instance",replica="$replica"}',
legendFormat=INTERACTIVE_POOL_SIZE_TARGET,
)
)
.addSeriesOverride(
{
alias: BATCH_THREADS_TARGET,
color: '#FFB357',
}
)
.addSeriesOverride(
{
alias: BATCH_POOL_SIZE_TARGET,
color: '#FA6400',
fill: 0,
}
)
.addSeriesOverride(
{
alias: INTERACTIVE_THREADS_TARGET,
color: '#C0D8FF',
}
)
.addSeriesOverride(
{
alias: INTERACTIVE_POOL_SIZE_TARGET,
color: '#1F60C4',
fill: 0,
}
)

View file

@ -0,0 +1,49 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local STREAM_TARGET = 'stream threads';
local EMAIL_TARGET = 'email threads';
local RECEIVE_COMMIT_TARGET = 'receive-commit threads';
lineGraph.new(
title='MISC queues',
labelY1='Tasks',
)
.addTarget(
prometheus.target(
'queue_ssh_stream_worker_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=STREAM_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_send_email_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=EMAIL_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_receive_commits_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=RECEIVE_COMMIT_TARGET,
)
)
.addSeriesOverride(
{
alias: STREAM_TARGET,
color: '#8AB8FF',
}
)
.addSeriesOverride(
{
alias: EMAIL_TARGET,
color: '#96D98D',
}
)
.addSeriesOverride(
{
alias: RECEIVE_COMMIT_TARGET,
color: '#FF7383',
}
)

View file

@ -0,0 +1,91 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local STREAM_TARGET = 'stream threads';
local STREAM_POOL_SIZE_TARGET = 'stream pool size';
local EMAIL_TARGET = 'email threads';
local EMAIL_POOL_SIZE_TARGET = 'email pool size';
local RECEIVE_COMMIT_TARGET = 'receive-commit threads';
local RECEIVE_COMMIT_POOL_SIZE_TARGET = 'receive-commit pool size';
lineGraph.new(
title='MISC threads',
labelY1='Threads',
)
.addTarget(
prometheus.target(
'queue_ssh_stream_worker_active_threads{instance="$instance",replica="$replica"}',
legendFormat=STREAM_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_ssh_stream_worker_pool_size{instance="$instance",replica="$replica"}',
legendFormat=STREAM_POOL_SIZE_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_send_email_active_threads{instance="$instance",replica="$replica"}',
legendFormat=EMAIL_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_send_email_pool_size{instance="$instance",replica="$replica"}',
legendFormat=EMAIL_POOL_SIZE_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_receive_commits_active_threads{instance="$instance",replica="$replica"}',
legendFormat=RECEIVE_COMMIT_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_receive_commits_pool_size{instance="$instance",replica="$replica"}',
legendFormat=RECEIVE_COMMIT_POOL_SIZE_TARGET,
)
)
.addSeriesOverride(
{
alias: STREAM_TARGET,
color: '#C0D8FF',
}
)
.addSeriesOverride(
{
alias: STREAM_POOL_SIZE_TARGET,
color: '#1F60C4',
fill: 0,
}
)
.addSeriesOverride(
{
alias: EMAIL_TARGET,
color: '#96D98D',
}
)
.addSeriesOverride(
{
alias: EMAIL_POOL_SIZE_TARGET,
color: '#37872D',
fill: 0,
}
)
.addSeriesOverride(
{
alias: RECEIVE_COMMIT_TARGET,
color: '#FFA6B0',
}
)
.addSeriesOverride(
{
alias: RECEIVE_COMMIT_POOL_SIZE_TARGET,
color: '#C4162A',
fill: 0,
}
)

View file

@ -0,0 +1,16 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='REST API request rate',
labelY1='Requests/Second',
formatY1='reqps',
)
.addTarget(
prometheus.target(
'rate(http_server_rest_api_count_total_total{instance="$instance",replica="$replica"}[5m])',
legendFormat='REST API request rate',
)
)

View file

@ -0,0 +1,36 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local BATCH_TARGET = 'batch';
local INTERACTIVE_TARGET = 'interactive';
lineGraph.new(
title='SSH queue',
labelY1='Tasks',
)
.addTarget(
prometheus.target(
'queue_ssh_batch_worker_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=BATCH_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_ssh_interactive_worker_scheduled_tasks{instance="$instance",replica="$replica"}',
legendFormat=INTERACTIVE_TARGET,
)
)
.addSeriesOverride(
{
alias: BATCH_TARGET,
color: '#FFB357',
}
)
.addSeriesOverride(
{
alias: INTERACTIVE_TARGET,
color: '#C0D8FF',
}
)

View file

@ -0,0 +1,64 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local BATCH_THREADS_TARGET = 'batch threads';
local BATCH_POOL_SIZE_TARGET = 'batch pool size';
local INTERACTIVE_THREADS_TARGET = 'interactive threads';
local INTERACTIVE_POOL_SIZE_TARGET = 'interactive pool size';
lineGraph.new(
title='SSH threads',
labelY1='Threads',
)
.addTarget(
prometheus.target(
'queue_ssh_batch_worker_active_threads{instance="$instance",replica="$replica"}',
legendFormat=BATCH_THREADS_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_ssh_batch_worker_pool_size{instance="$instance",replica="$replica"}',
legendFormat=BATCH_POOL_SIZE_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_ssh_interactive_worker_active_threads{instance="$instance",replica="$replica"}',
legendFormat=INTERACTIVE_THREADS_TARGET,
)
)
.addTarget(
prometheus.target(
'queue_ssh_interactive_worker_pool_size{instance="$instance",replica="$replica"}',
legendFormat=INTERACTIVE_POOL_SIZE_TARGET,
)
)
.addSeriesOverride(
{
alias: BATCH_THREADS_TARGET,
color: '#FFB357',
}
)
.addSeriesOverride(
{
alias: BATCH_POOL_SIZE_TARGET,
color: '#FA6400',
fill: 0,
}
)
.addSeriesOverride(
{
alias: INTERACTIVE_THREADS_TARGET,
color: '#C0D8FF',
}
)
.addSeriesOverride(
{
alias: INTERACTIVE_POOL_SIZE_TARGET,
color: '#1F60C4',
fill: 0,
}
)

View file

@ -6,9 +6,5 @@
timeTo: 'now',
refresh: '1m',
},
panels: {
width: 12,
height: 11,
},
datasource: if std.extVar('publish') then '${DS_PROMETHEUS}' else 'Prometheus',
}

View file

@ -1,13 +1,19 @@
local defaults = import './defaults.libsonnet';
local TOTAL_WIDTH = 24;
local DEFAULT_HEIGHT = 11;
{
new(
row,
column,
total_columns=2,
):: {
x: column * defaults.panels.width,
y: row * defaults.panels.height,
w: defaults.panels.width,
h: defaults.panels.height,
local width = TOTAL_WIDTH / total_columns,
x: column * width,
y: row * DEFAULT_HEIGHT,
w: width,
h: DEFAULT_HEIGHT,
},
}