Convert caches dashboard to grafonnet

Change-Id: I42f10428bb5f85991cef2abbcdfab9424b8bb48d
This commit is contained in:
Thomas Draebing 2020-09-09 16:44:52 +02:00
parent 72391ac5e5
commit 82d9ead576
10 changed files with 141 additions and 739 deletions

View file

@ -1,738 +0,0 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "7.1.5"
},
{
"type": "panel",
"id": "graph",
"name": "Graph",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"fill": 1,
"fillGradient": 1,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"interval": "",
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 150,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "100-caches_memory_hit_ratio_accounts{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "accounts",
"refId": "A"
},
{
"expr": "100-caches_memory_hit_ratio_groups{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "groups",
"refId": "B"
},
{
"expr": "100-caches_memory_hit_ratio_groups_byuuid{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "groups_byuuid",
"refId": "C"
},
{
"expr": "100-caches_memory_hit_ratio_ldap_groups_byinclude{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "ldap_groups_byinclude",
"refId": "D"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "ACCOUNT cache misses",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percent",
"label": "Cache Misses",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"fill": 1,
"fillGradient": 1,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"hiddenSeries": false,
"id": 8,
"interval": "",
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 150,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "100-caches_memory_hit_ratio_conflicts{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "conflicts",
"refId": "A"
},
{
"expr": "100-caches_memory_hit_ratio_mergeability{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "mergeability",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CONFLICT cache misses",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percent",
"label": "Cache Misses",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"fill": 1,
"fillGradient": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 8
},
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 150,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "100-caches_memory_hit_ratio_change_kind{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "change_kind",
"refId": "B"
},
{
"expr": "100-caches_memory_hit_ratio_change_notes{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "change_notes",
"refId": "C"
},
{
"expr": "100-caches_memory_hit_ratio_changeid_project{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "changeid_project",
"refId": "D"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CHANGE cache misses",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percent",
"label": "Cache Misses",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"fill": 1,
"fillGradient": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 8
},
"hiddenSeries": false,
"id": 10,
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 150,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "100-caches_memory_hit_ratio_project_list{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "project list",
"refId": "A"
},
{
"expr": "100-caches_memory_hit_ratio_projects{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "projects",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "PROJECT cache misses",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 4,
"format": "percent",
"label": "Cache Misses",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"fill": 1,
"fillGradient": 1,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 17
},
"hiddenSeries": false,
"id": 6,
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 150,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "100-caches_memory_hit_ratio_diff{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "diff",
"refId": "A"
},
{
"expr": "100-caches_memory_hit_ratio_diff_intraline{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "diff intraline",
"refId": "B"
},
{
"expr": "100-caches_memory_hit_ratio_diff_summary{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "diff summary",
"refId": "C"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "DIFF cache misses",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percent",
"label": "Cache Misses",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 17
},
"hiddenSeries": false,
"id": 12,
"interval": "",
"legend": {
"alignAsTable": true,
"avg": false,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"sideWidth": 150,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "100-caches_memory_hit_ratio_web_sessions{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "web sessions",
"refId": "A"
},
{
"expr": "100-caches_memory_hit_ratio_sshkeys{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "sshkeys",
"refId": "B"
},
{
"expr": "100-caches_memory_hit_ratio_git_tags{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "git tags",
"refId": "D"
},
{
"expr": "100-caches_memory_hit_ratio_permission_sort{instance=\"$instance\",replica=\"$replica\"}",
"legendFormat": "permission_sort",
"refId": "C"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "MISC cache misses",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 1,
"format": "percent",
"label": "Cache Misses",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 21,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"text": "",
"value": ""
},
"datasource": "${DS_PROMETHEUS}",
"definition": "label_values(git_upload_pack_phase_writing_total, instance)",
"hide": 0,
"includeAll": false,
"label": "Gerrit Instance",
"multi": false,
"name": "instance",
"options": [],
"query": "label_values(git_upload_pack_phase_writing_total, instance)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"text": "",
"value": ""
},
"datasource": "${DS_PROMETHEUS}",
"definition": "label_values(git_upload_pack_phase_writing_total{instance=\"$instance\"}, replica)",
"hide": 0,
"includeAll": false,
"label": "Replica",
"multi": false,
"name": "replica",
"options": [],
"query": "label_values(git_upload_pack_phase_writing_total{instance=\"$instance\"}, replica)",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Caches",
"uid": "vHQVaGsWk",
"version": 15
}

View file

@ -0,0 +1,55 @@
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 account_cache_misses_panel = import './panels/account_cache_misses.libsonnet';
local change_cache_misses_panel = import './panels/change_cache_misses.libsonnet';
local conflict_cache_misses_panel = import './panels/conflict_cache_misses.libsonnet';
local diff_cache_misses_panel = import './panels/diff_cache_misses.libsonnet';
local misc_cache_misses_panel = import './panels/misc_cache_misses.libsonnet';
local project_cache_misses_panel = import './panels/project_cache_misses.libsonnet';
dashboard.new(
'Gerrit - Caches',
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(
account_cache_misses_panel,
gridPos=gridPos.new(0, 0)
)
.addPanel(
change_cache_misses_panel,
gridPos=gridPos.new(0, 1)
)
.addPanel(
conflict_cache_misses_panel,
gridPos=gridPos.new(1, 0)
)
.addPanel(
project_cache_misses_panel,
gridPos=gridPos.new(1, 1)
)
.addPanel(
diff_cache_misses_panel,
gridPos=gridPos.new(2, 0)
)
.addPanel(
misc_cache_misses_panel,
gridPos=gridPos.new(2, 1)
)
+ if std.extVar('publish') then publishVariables else {}

View file

@ -0,0 +1,13 @@
local target = import './cache_target.libsonnet';
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='ACCOUNT cache misses',
labelY1='Cache Misses',
formatY1='percent',
fill=0,
)
.addTarget(target.new('accounts'))
.addTarget(target.new('groups'))
.addTarget(target.new('groups_byuuid'))
.addTarget(target.new('ldap_groups_byinclude'))

View file

@ -0,0 +1,12 @@
local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
local prometheus = grafana.prometheus;
{
new(
cache
)::
prometheus.target(
std.format('100-caches_memory_hit_ratio_%s{instance="$instance",replica="$replica"}', cache),
legendFormat=cache,
)
}

View file

@ -0,0 +1,12 @@
local target = import './cache_target.libsonnet';
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='CHANGE cache misses',
labelY1='Cache Misses',
formatY1='percent',
fill=0,
)
.addTarget(target.new('change_kind'))
.addTarget(target.new('change_notes'))
.addTarget(target.new('changeid_project'))

View file

@ -0,0 +1,11 @@
local target = import './cache_target.libsonnet';
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='CONFLICT cache misses',
labelY1='Cache Misses',
formatY1='percent',
fill=0,
)
.addTarget(target.new('conflicts'))
.addTarget(target.new('mergeability'))

View file

@ -0,0 +1,12 @@
local target = import './cache_target.libsonnet';
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='DIFF cache misses',
labelY1='Cache Misses',
formatY1='percent',
fill=0,
)
.addTarget(target.new('diff'))
.addTarget(target.new('diff_intraline'))
.addTarget(target.new('diff_summary'))

View file

@ -0,0 +1,13 @@
local target = import './cache_target.libsonnet';
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='MISC cache misses',
labelY1='Cache Misses',
formatY1='percent',
fill=0,
)
.addTarget(target.new('web_sessions'))
.addTarget(target.new('sshkeys'))
.addTarget(target.new('git_tags'))
.addTarget(target.new('permission_sort'))

View file

@ -0,0 +1,11 @@
local target = import './cache_target.libsonnet';
local lineGraph = import '../../../globals/line-graph.libsonnet';
lineGraph.new(
title='PROJECT cache misses',
labelY1='Cache Misses',
formatY1='percent',
fill=0,
)
.addTarget(target.new('project_list'))
.addTarget(target.new('projects'))

View file

@ -11,6 +11,7 @@ local defaults = import './defaults.libsonnet';
formatY1='short',
formatY2='short',
stack=false,
fill=1,
):: graphPanel.new(
title=title,
labelY1=labelY1,
@ -19,7 +20,7 @@ local defaults = import './defaults.libsonnet';
formatY2=formatY2,
stack=stack,
datasource=defaults.datasource,
fill=1,
fill=fill,
legend_alignAsTable=true,
legend_avg=true,
legend_current=true,