Ensure that all dashboards are using 'defaults.datasource'

Some dashboards were still explicitly specifying 'Prometheus' as the
datasource, which leads to issues when trying to import the dashboards
into a grafana instance where the prometheus datasource has a different
name.

Change-Id: I13135af32a6f312a4feb32ab828f906f7b13edfe
This commit is contained in:
Pat Long 2021-06-16 11:35:43 -04:00
parent 8e8a55e650
commit 37dc340371
No known key found for this signature in database
GPG key ID: 41C7B6A2B12D7092
11 changed files with 26 additions and 12 deletions

View file

@ -37,7 +37,7 @@ dashboard.new(
.addTemplate(
template.new(
name='check',
datasource='Prometheus',
datasource=defaults.datasource,
query='metrics(^plugins_healthcheck_.+_failure_total$)',
regex='plugins_healthcheck_(.+)_failure_total',
label='Check',

View file

@ -27,7 +27,7 @@ dashboard.new(
.addTemplate(
template.new(
name='endpoint',
datasource='Prometheus',
datasource=defaults.datasource,
query='metrics(^http_server_rest_api_server_latency_restapi_.+$)',
regex='^http_server_rest_api_server_latency_restapi_([^_]+)_.+$',
label='Endpoint',
@ -37,7 +37,7 @@ dashboard.new(
.addTemplate(
template.new(
name='action',
datasource='Prometheus',
datasource=defaults.datasource,
query='metrics(^http_server_rest_api_server_latency_restapi_$endpoint.+$)',
regex='^http_server_rest_api_server_latency_restapi_[^_]+_([^_]+)_.+$',
label='Action',

View file

@ -27,7 +27,7 @@ dashboard.new(
.addTemplate(
template.new(
name='action',
datasource='Prometheus',
datasource=defaults.datasource,
query='metrics(^http_server_rest_api_ui_actions_latency_[^_]+$)',
regex='^http_server_rest_api_ui_actions_latency_(.+)$',
label='Action',

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local stat = grafana.singlestat;
local defaults = import '../../../globals/defaults.libsonnet';
stat.new(
title='Gerrit Availability [last 24h]',
datasource='Prometheus',
datasource=defaults.datasource,
colorBackground=true,
colors=[
"red",

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local gauge = grafana.gaugePanel;
local defaults = import '../../../globals/defaults.libsonnet';
gauge.new(
title='CPU Usage',
datasource='Prometheus',
datasource=defaults.datasource,
)
.addTarget(
target=prometheus.target(

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local gauge = grafana.gaugePanel;
local defaults = import '../../../globals/defaults.libsonnet';
gauge.new(
title='Heap Memory Usage',
datasource='Prometheus',
datasource=defaults.datasource,
)
.addTarget(
target=prometheus.target(

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local gauge = grafana.gaugePanel;
local defaults = import '../../../globals/defaults.libsonnet';
gauge.new(
title='HTTP Request Error Rate (last 5 min)',
datasource='Prometheus',
datasource=defaults.datasource,
description='Excludes 404 and 401, since these error codes are caused by client behaviour and are overrepresented in the data.',
min=0,
max=100,

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local gauge = grafana.gaugePanel;
local defaults = import '../../../globals/defaults.libsonnet';
gauge.new(
title='REST API latency (0.99 quantile)',
datasource='Prometheus',
datasource=defaults.datasource,
unit='ms',
min=0,
max=50,

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local gauge = grafana.barGaugePanel;
local defaults = import '../../../globals/defaults.libsonnet';
gauge.new(
title='Live Threads',
datasource='Prometheus',
datasource=defaults.datasource,
thresholds=[{
color: 'green',
value: null,

View file

@ -2,9 +2,11 @@ local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
local table = grafana.tablePanel;
local defaults = import '../../../globals/defaults.libsonnet';
table.new(
title='Gerrit Version',
datasource='Prometheus',
datasource=defaults.datasource,
transform='table',
transparent=false,
)

View file

@ -27,7 +27,7 @@ dashboard.new(
.addTemplate(
template.new(
name='target',
datasource='Prometheus',
datasource=defaults.datasource,
query='metrics(plugins_replication_replication_latency_.*_count)',
regex='^plugins_replication_replication_latency_(.*)_count$',
label='Replication Target',