Skip to content

Commit

Permalink
Provision Grafana with a Pyroscope dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewslotin committed Aug 2, 2024
1 parent 67abea5 commit 24914ed
Showing 1 changed file with 339 additions and 0 deletions.
339 changes: 339 additions & 0 deletions grafana/dashboards/definitions/pyroscope.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,339 @@
{
"__inputs": [
{
"name": "DS_PYROSCOPE",
"label": "Pyroscope",
"description": "",
"type": "datasource",
"pluginId": "grafana-pyroscope-datasource",
"pluginName": "Grafana Pyroscope"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "flamegraph",
"name": "Flame Graph",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.1.2"
},
{
"type": "datasource",
"id": "grafana-pyroscope-datasource",
"name": "Grafana Pyroscope",
"version": "1.0.0"
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Visualize CPU profiles collected with Pyroscope",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 3,
"panels": [],
"title": "CPU",
"type": "row"
},
{
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": ["cpu"],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 1
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"groupBy": ["hostname"],
"labelSelector": "{service_name=~\"$service\", k6_test_run_id=~\"$testid\", k6_name=~\"$name\", k6_scenario=~\"$scenario\"}",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"queryType": "metrics",
"refId": "A"
}
],
"title": "CPU time",
"type": "timeseries"
},
{
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"gridPos": {
"h": 16,
"w": 24,
"x": 0,
"y": 9
},
"id": 2,
"targets": [
{
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"groupBy": ["hostname"],
"labelSelector": "{service_name=~\"$service\", k6_test_run_id=~\"$testid\", k6_name=~\"$name\", k6_scenario=~\"$scenario\"}",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"queryType": "profile",
"refId": "A"
}
],
"title": "CPU Flamegraph",
"type": "flamegraph"
}
],
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"tags": ["pyroscope", "k6"],
"templating": {
"list": [
{
"current": {},
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"definition": "label_values(service_name)",
"error": {},
"hide": 0,
"includeAll": false,
"label": "Service",
"multi": false,
"name": "service",
"options": [],
"query": {
"labelName": "service_name",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"type": "labelValue"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"definition": "label_values(k6_test_run_id)",
"error": {},
"hide": 0,
"includeAll": false,
"label": "Test ID",
"multi": false,
"name": "testid",
"options": [],
"query": {
"labelName": "k6_test_run_id",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"type": "labelValue"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"definition": "label_values(k6_name)",
"error": {},
"hide": 0,
"includeAll": false,
"label": "Test Name",
"multi": false,
"name": "name",
"options": [],
"query": {
"labelName": "k6_name",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"type": "labelValue"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-pyroscope-datasource",
"uid": "${DS_PYROSCOPE}"
},
"definition": "label_values(k6_scenario)",
"error": {},
"hide": 0,
"includeAll": false,
"label": "Scenario",
"multi": false,
"name": "scenario",
"options": [],
"query": {
"labelName": "k6_scenario",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
"type": "labelValue"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
}
]
},
"time": {
"from": "now-3h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Pyroscope",
"uid": "be627e9d-4851-42e7-b371-ddbe72e7c710",
"version": 1,
"weekStart": ""
}

0 comments on commit 24914ed

Please sign in to comment.