Skip to content

Commit

Permalink
Add static dashboard example (grafana#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmholmes authored Feb 16, 2024
1 parent db6d752 commit 5a48d65
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/grr.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ local folder = import 'folder-simple.libsonnet';
local grr = import 'grizzly/grizzly.libsonnet';
local prometheus = import 'prometheus-rules.libsonnet';
local sm = import 'synthetic-monitoring-simple.libsonnet';

local testDashboard = import 'test-dashboard.json';
{
folders: [
grr.folder.new('sample', 'Sample'),
],
dashboards: [
grr.dashboard.new('prod-overview', dashboard)
+ grr.resource.addMetadata('folder', 'sample'),
grr.dashboard.new('e9abc1a5-1b8f-4327-83e4-0b3c2b3722a9', testDashboard)
+ grr.resource.addMetadata('folder', 'sample'),
],
datasources: [
grr.datasource.new('prometheus', datasource),
Expand Down
229 changes: 229 additions & 0 deletions examples/test-dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 4278,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"axisShow": false,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1,
"scaleDistribution": {
"type": "linear"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"barRadius": 0,
"barWidth": 0.97,
"fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"tooltip": {
"mode": "single",
"sort": "none"
},
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0
},
"targets": [
{
"channel": "plugin/testdata/random-2s-stream",
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"filter": {
"fields": [
"Time",
"Min"
]
},
"queryType": "randomWalk",
"refId": "A"
}
],
"title": "Panel Title",
"type": "barchart"
},
{
"datasource": {
"type": "grafana",
"uid": "grafana"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"axisShow": false,
"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": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"queryType": "randomWalk",
"refId": "A"
}
],
"title": "Liam's Panel Title",
"type": "timeseries"
}
],
"refresh": "",
"schemaVersion": 38,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Test dashboard",
"uid": "e9abc1a5-1b8f-4327-83e4-0b3c2b3722a9",
"version": 1,
"weekStart": ""
}

0 comments on commit 5a48d65

Please sign in to comment.