Files
tutor-tool/grafana/provisioning/dashboards/tutor-tool.json

533 lines
13 KiB
JSON

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"templating": {
"list": [
{
"name": "course_id",
"type": "query",
"datasource": "PostgreSQL",
"query": "SELECT id AS __value, name AS __text FROM course ORDER BY name",
"refresh": 2,
"multi": false,
"includeAll": true,
"allValue": null,
"hide": 0,
"label": "Course"
}
]
},
"panels": [
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": {
"0": {
"color": "red",
"text": "DOWN"
},
"1": {
"color": "green",
"text": "UP"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": 0
},
{
"color": "green",
"value": 1
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "Prometheus",
"expr": "probe_success{job=\"blackbox_tcp\"}",
"legendFormat": "{{ instance }}",
"refId": "A"
}
],
"title": "Service Health",
"type": "stat"
},
{
"datasource": "PostgreSQL",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 0,
"y": 12
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "PostgreSQL",
"format": "table",
"rawSql": "SELECT COUNT(*) as value FROM token",
"refId": "A"
}
],
"title": "Total Registered Users",
"type": "stat"
},
{
"datasource": "PostgreSQL",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 6,
"y": 12
},
"id": 5,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "PostgreSQL",
"format": "table",
"rawSql": "SELECT COUNT(*) as value FROM deck",
"refId": "A"
}
],
"title": "Total Decks",
"type": "stat"
},
{
"datasource": "PostgreSQL",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 12,
"y": 12
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "PostgreSQL",
"format": "table",
"rawSql": "SELECT COUNT(*) as value FROM course",
"refId": "A"
}
],
"title": "Active Courses",
"type": "stat"
},
{
"datasource": "PostgreSQL",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 6,
"x": 18,
"y": 12
},
"id": 7,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": true
},
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "PostgreSQL",
"format": "table",
"rawSql": "SELECT c.name as \"metric\", COUNT(t.id) as \"value\" FROM course c LEFT JOIN token t ON c.id = t.active_course_id GROUP BY c.name",
"refId": "A"
}
],
"title": "Users per Active Course",
"type": "stat"
},
{
"datasource": "PostgreSQL",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "Users with Access",
"axisPlacement": "auto",
"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": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 16
},
"id": 8,
"repeat": "course_id",
"repeatDirection": "v",
"maxPerRow": 1,
"options": {
"barRadius": 0,
"barWidth": 0.7,
"fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"orientation": "horizontal",
"showValue": "never",
"stacking": "none",
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
},
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "PostgreSQL",
"format": "table",
"rawSql": "SELECT d.name AS \"Deck\", COUNT(dt.token_id) AS \"Users\" FROM deck d JOIN course c ON d.course_id = c.id LEFT JOIN deck_token dt ON d.id = dt.deck_id WHERE c.id = ${course_id} GROUP BY d.name ORDER BY regexp_replace(d.name, '\\D', '', 'g')::integer ASC NULLS LAST",
"refId": "A"
}
],
"title": "Users with Access per Deck \u2014 $course_id",
"type": "barchart"
},
{
"datasource": "PostgreSQL",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "Views",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"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": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 100
},
"id": 10,
"repeat": "course_id",
"repeatDirection": "v",
"maxPerRow": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "12.3.3",
"targets": [
{
"datasource": "PostgreSQL",
"format": "time_series",
"rawSql": "SELECT date_trunc('hour', pv.viewed_at) AS time, d.name AS metric, COUNT(*) AS value FROM page_view pv JOIN deck d ON pv.deck_id = d.id JOIN course c ON d.course_id = c.id WHERE c.id = ${course_id} AND $__timeFilter(pv.viewed_at) GROUP BY 1, 2 ORDER BY 1",
"refId": "A"
}
],
"title": "Deck Views Over Time \u2014 $course_id",
"type": "timeseries"
},
{
"id": 11,
"title": "User Registrations Over Time",
"type": "timeseries",
"gridPos": { "h": 10, "w": 24, "x": 0, "y": 300 },
"datasource": "PostgreSQL",
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "showLegend": false },
"tooltip": { "mode": "single", "sort": "none" }
},
"fieldConfig": {
"defaults": {
"custom": {
"drawStyle": "bars",
"fillOpacity": 80,
"lineWidth": 1,
"showPoints": "never"
}
},
"overrides": []
},
"targets": [
{
"datasource": "PostgreSQL",
"format": "time_series",
"rawSql": "SELECT date_trunc('day', created_at) AS time, COUNT(*) AS value FROM token WHERE $__timeFilter(created_at) GROUP BY 1 ORDER BY 1",
"refId": "A"
}
]
}
],
"preload": false,
"refresh": "1m",
"schemaVersion": 42,
"tags": [],
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Tutor Tool",
"uid": "tutor-tool",
"version": 5
}