Convert latency dashboard to grafonnet

Change-Id: Id97759996259eea802c80c2ef3261ba1883d92d3
This commit is contained in:
Thomas Draebing 2020-09-10 15:07:46 +02:00
parent 3e811f272b
commit 0b4c16e881
3 changed files with 151 additions and 1349 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,110 @@
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 latency_panel = import './panels/latency.libsonnet';
dashboard.new(
'Gerrit - Latency',
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(
latency_panel.new(
metric='receivecommits_latency_total',
title='RECEIVE-COMMIT latency'
),
gridPos=gridPos.new(0, 0)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_total',
title='REST total latency'
),
gridPos=gridPos.new(0, 1)
)
.addPanel(
latency_panel.new(
metric='query_query_latency_total',
title='QUERY total latency'
),
gridPos=gridPos.new(1, 0)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_GetDetail',
title='REST get change detail latency'
),
gridPos=gridPos.new(1, 1)
)
.addPanel(
latency_panel.new(
metric='query_query_latency_changes',
title='QUERY changes latency'
),
gridPos=gridPos.new(2, 0)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_GetDiff',
title='REST get change diff latency'
),
gridPos=gridPos.new(2, 1)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_ListChangeComments',
title='REST change list comments latency'
),
gridPos=gridPos.new(3, 0)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_GetChange',
title='REST get change latency'
),
gridPos=gridPos.new(3, 1)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_ListChangeRobotComments',
title='REST change list robot comments latency'
),
gridPos=gridPos.new(4, 0)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_GetCommit',
title='REST get commit latency'
),
gridPos=gridPos.new(4, 1)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_PostReview',
title='REST post change review latency'
),
gridPos=gridPos.new(5, 0)
)
.addPanel(
latency_panel.new(
metric='http_server_rest_api_server_latency_restapi_change_GetRevisionActions',
title='REST get change revision actions latency'
),
gridPos=gridPos.new(5, 1)
)
+ if std.extVar('publish') then publishVariables else {}

View file

@ -0,0 +1,41 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local graphPanel = grafana.graphPanel;
local prometheus = grafana.prometheus;
local lineGraph = import '../../../globals/line-graph.libsonnet';
local yAxis = import '../../../globals/yaxis.libsonnet';
{
new(
metric,
title,
):: lineGraph.new(
title=title,
yAxis1=yAxis.latency,
)
.addTarget(
prometheus.target(
std.format(
'%s{instance="$instance",replica="$replica"}', metric),
legendFormat='quantile: {{quantile}}',
)
)
.addSeriesOverride(
{
alias: 'quantile: 0.75',
hiddenSeries: true,
}
)
.addSeriesOverride(
{
alias: 'quantile: 0.98',
hiddenSeries: true,
}
)
.addSeriesOverride(
{
alias: 'quantile: 0.99',
hiddenSeries: true,
}
)
}