From aba34c09c0a9b1f2013f7ce1ccf665dbe64a838a Mon Sep 17 00:00:00 2001 From: Josep Boix Requesens Date: Tue, 12 Nov 2024 17:46:01 +0100 Subject: [PATCH] chore: update grafana dashboards and add backup instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #3 by removing severity filters from Grafana dashboards. Changes made: - Added backing up instructions under `docs/DASHBOARD_EXPORT_GUIDE.md` - Updated submodules to latest version. - Updated dashboards in provisioning to align with production state. - Adapted Grafana version in Dockerfile for consistent local testing. - Use aliased index in datasource provisioning (see SRGSSR/pillarbox-monitoring-transfer#16) Co-authored-by: Samuel Défago Co-authored-by: Gaëtan Muller --- README.md | 5 + docs/DASHBOARD_EXPORT_GUIDE.md | 94 +++++++++++ pillarbox-event-dispatcher | 2 +- pillarbox-monitoring-grafana/Dockerfile | 2 +- ...e_breakdown.json => Device Breakdown.json} | 45 ++--- ...or_breakdown.json => Error Breakdown.json} | 151 +++++++++++++---- ...ts_breakdown.json => Event Breakdown.json} | 109 ++++++++++-- ...s_breakdown.json => Metrics Overview.json} | 158 +++++++++++++----- ..._breakdown.json => Session Breakdown.json} | 122 +++++++++++--- .../{active_sessions.json => Sessions.json} | 12 +- .../provisioning/datasources/datasource.yml | 2 +- pillarbox-monitoring-transfer | 2 +- 12 files changed, 554 insertions(+), 150 deletions(-) create mode 100644 docs/DASHBOARD_EXPORT_GUIDE.md rename pillarbox-monitoring-grafana/dashboards/{device_breakdown.json => Device Breakdown.json} (96%) rename pillarbox-monitoring-grafana/dashboards/{error_breakdown.json => Error Breakdown.json} (87%) rename pillarbox-monitoring-grafana/dashboards/{events_breakdown.json => Event Breakdown.json} (90%) rename pillarbox-monitoring-grafana/dashboards/{metrics_breakdown.json => Metrics Overview.json} (83%) rename pillarbox-monitoring-grafana/dashboards/{session_breakdown.json => Session Breakdown.json} (93%) rename pillarbox-monitoring-grafana/dashboards/{active_sessions.json => Sessions.json} (98%) diff --git a/README.md b/README.md index 4cdfd33..08c7c00 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,11 @@ git config core.hooksPath .githooks/ Refer to our [Contribution Guide](docs/CONTRIBUTING.md) for more detailed information. +### Exporting Dashboards from production + +See the [Grafana Dashboard Export Guide](./docs/DASHBOARD_EXPORT_GUIDE.md) for information on how +to export and backup the dashboards in production. + ## License This project is licensed under the [MIT License](LICENSE). diff --git a/docs/DASHBOARD_EXPORT_GUIDE.md b/docs/DASHBOARD_EXPORT_GUIDE.md new file mode 100644 index 0000000..8f6adb3 --- /dev/null +++ b/docs/DASHBOARD_EXPORT_GUIDE.md @@ -0,0 +1,94 @@ +# Grafana Dashboard Export Guide + +This guide provides step-by-step instructions to export dashboards from Grafana. You can export +either a single dashboard directly through the Grafana interface or all dashboards within a +specified folder using a custom script. + +## Exporting a Single Dashboard + +To export an individual dashboard directly through the Grafana interface, follow these steps: + +1. Open the dashboard you wish to export. +2. Click the Share button (usually located at the top right). +3. In the Share panel, navigate to the Export tab. +4. Select Save to file. This will download a JSON file of the dashboard's configuration to your + computer. + +## Exporting All Dashboards in a Folder + +The following steps outline a method to export all dashboards within a specified folder in Grafana +as a single zip file containing individual JSON files for each dashboard. + +### 1. Open the Browser Console + +- Open your Grafana instance and log in if prompted by SSO. +- Press F12 (or right-click and select **Inspect**) to open Developer Tools. +- Navigate to the **Console** tab. + +### 2. Load JSZip Library + +- To manage multiple files in a zip, we’ll use the [JSZip library](https://stuk.github.io/jszip/). + Copy and paste the following code into the console and press Enter: + + ```javascript + var script = document.createElement('script'); + script.src = 'https://cdn.jsdelivr.net/npm/jszip@3.10.1/dist/jszip.min.js'; + document.head.appendChild(script); + ``` + +- Verify that JSZip is loaded by typing `JSZip` into the console and pressing Enter. You + should + see an object or function returned. + +### 3. Run the Export Script + +- Copy and paste the following code into the console and press Enter: + + ```javascript + async function exportAllDashboardsWithFolders() { + const zip = new JSZip(); + + // Step 1: Get all folders + const folderResponse = await fetch(`/api/folders`); + const folders = await folderResponse.json(); + const folderMap = {}; + folders.forEach(folder => { + folderMap[folder.uid] = folder.title.replace(/[/\\?%*:|"<>]/g, ''); // Clean up folder names + }); + + // Step 2: Fetch all dashboards across folders + const response = await fetch(`/api/search?type=dash-db`); + const dashboards = await response.json(); + + for (const dashboard of dashboards) { + const uid = dashboard.uid; + const title = dashboard.title.replace(/[/\\?%*:|"<>]/g, ''); // Clean up filename + const folderName = folderMap[dashboard.folderUid] || 'General'; + + // Fetch each dashboard's JSON + const dashboardResponse = await fetch(`/api/dashboards/uid/${uid}`); + const dashboardData = await dashboardResponse.json(); + + // Add each dashboard JSON to the zip, organized by folder + zip.file(`${folderName}/${title}.json`, JSON.stringify(dashboardData.dashboard, null, 2)); + console.log(`Added to zip: ${folderName}/${title}`); + } + + // Step 3: Generate the zip and trigger download + zip.generateAsync({ type: 'blob' }).then(function (content) { + const link = document.createElement('a'); + link.href = URL.createObjectURL(content); + link.download = 'grafana_dashboards.zip'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + console.log("Downloaded all dashboards as zip with folder structure."); + }); + } + + exportAllDashboardsWithFolders(); + ``` +- The script will create a zip containing individual JSON files for each dashboard and will follow + Grafana folder structure. +- Each JSON file is named after the dashboard title and represents a backup of the dashboard’s + configuration. diff --git a/pillarbox-event-dispatcher b/pillarbox-event-dispatcher index 62757e3..12bafbd 160000 --- a/pillarbox-event-dispatcher +++ b/pillarbox-event-dispatcher @@ -1 +1 @@ -Subproject commit 62757e3c9c0466a56163ad159bc0043597743ae4 +Subproject commit 12bafbd8f2285c0ca314fea6fd131e5a8ab56014 diff --git a/pillarbox-monitoring-grafana/Dockerfile b/pillarbox-monitoring-grafana/Dockerfile index cf79fd9..14b45ed 100644 --- a/pillarbox-monitoring-grafana/Dockerfile +++ b/pillarbox-monitoring-grafana/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile for grafana -FROM grafana/grafana:11.0.0 +FROM grafana/grafana:10.4.1 # Copy provisioning and dashboards COPY ./provisioning /etc/grafana/provisioning diff --git a/pillarbox-monitoring-grafana/dashboards/device_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Device Breakdown.json similarity index 96% rename from pillarbox-monitoring-grafana/dashboards/device_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Device Breakdown.json index 1535102..6ee4574 100644 --- a/pillarbox-monitoring-grafana/dashboards/device_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Device Breakdown.json @@ -18,12 +18,13 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, + "id": 3, "links": [], "panels": [ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by Operating System for the selected time range.", "fieldConfig": { @@ -283,7 +284,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -291,7 +292,7 @@ "type": "count" } ], - "query": "event_name:START AND data.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START \nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -302,7 +303,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by device type for the selected time range.", "fieldConfig": { @@ -562,7 +563,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -570,7 +571,7 @@ "type": "count" } ], - "query": "event_name:START AND data.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -581,7 +582,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by browser for the selected time range.", "fieldConfig": { @@ -736,7 +737,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -744,7 +745,7 @@ "type": "count" } ], - "query": "event_name:START AND data.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -755,7 +756,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "The top 10 operating systems' versions for the selected time range.", "fieldConfig": { @@ -856,7 +857,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -864,7 +865,7 @@ "type": "count" } ], - "query": "event_name:START AND data.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -938,7 +939,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "The top 10 device models for the selected time range.", "fieldConfig": { @@ -1033,7 +1034,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1041,7 +1042,7 @@ "type": "count" } ], - "query": "event_name:START AND data.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -1052,7 +1053,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "The top 10 browsers' versions for the selected time range.", "fieldConfig": { @@ -1153,7 +1154,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1161,7 +1162,7 @@ "type": "count" } ], - "query": "event_name:START AND data.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -1239,6 +1240,7 @@ "templating": { "list": [ { + "allValue": "*", "current": { "selected": false, "text": "All", @@ -1246,7 +1248,7 @@ }, "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", "description": "Filter by player platform.", @@ -1257,7 +1259,7 @@ "name": "platform", "options": [], "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 1, @@ -1318,11 +1320,10 @@ "from": "now-1h", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Device Breakdown", "uid": "cdrj6qnc10veoe", - "version": 1, + "version": 6, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/error_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Error Breakdown.json similarity index 87% rename from pillarbox-monitoring-grafana/dashboards/error_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Error Breakdown.json index c0d47c6..53f119f 100644 --- a/pillarbox-monitoring-grafana/dashboards/error_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Error Breakdown.json @@ -18,6 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, + "id": 2, "links": [], "panels": [ { @@ -33,7 +34,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "gridPos": { "h": 7, @@ -58,7 +59,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -69,12 +70,12 @@ "type": "raw_data" } ], - "query": "event_name:ERROR AND\nsession.media.id:${bu:raw} AND\nsession.player.platform:${platform}", + "query": "event_name:ERROR \nAND session.media.id:${bu:raw} \nAND session.player.platform:${platform}", "refId": "A", "timeField": "@timestamp" } ], - "title": "Lates Errors", + "title": "Latest Errors", "transformations": [ { "id": "filterFieldsByName", @@ -82,11 +83,10 @@ "include": { "names": [ "@timestamp", + "data.log", "data.message", "data.name", - "data.severity", - "session_id", - "data.log" + "session_id" ] } } @@ -112,9 +112,7 @@ "@timestamp", "data.message", "data.name", - "data.severity", - "session_id", - "Log" + "session_id" ] } } @@ -138,7 +136,7 @@ "data.log": "Logs", "data.message": "Message", "data.name": "Name", - "data.severity": "Severity", + "data.severity": "", "session_id": "Session" } } @@ -166,7 +164,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -293,14 +291,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "1m" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -321,14 +319,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -349,14 +347,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -377,7 +375,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -458,7 +456,7 @@ "alias": "", "bucketAggs": [ { - "field": "data.device.model.keyword", + "field": "session.device.model.keyword", "id": "2", "settings": { "min_doc_count": "1", @@ -471,7 +469,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -479,7 +477,7 @@ "type": "count" } ], - "query": "event_name:START AND \ndata.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:ERROR\nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -490,7 +488,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -639,7 +637,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -647,7 +645,7 @@ "type": "count" } ], - "query": "event_name:ERROR\nAND data.severity:Fatal\nAND session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "query": "event_name:ERROR\nAND session.media.id:${bu:raw}\nAND session.player.platform:${platform}", "refId": "A", "timeField": "@timestamp" } @@ -684,7 +682,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -889,7 +887,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -897,12 +895,26 @@ "type": "count" } ], - "query": "event_name:ERROR AND \nsession.player.platform:${platform} AND\nsession.media.id:${bu:raw}", + "query": "event_name:ERROR \nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } ], "title": "Error Breakdown", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "string", + "targetField": "data.name.keyword" + } + ], + "fields": {} + } + } + ], "type": "piechart" } ], @@ -961,7 +973,7 @@ "type": "custom" }, { - "allValue": "", + "allValue": "*", "current": { "selected": false, "text": "All", @@ -969,7 +981,7 @@ }, "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", "description": "Filter by player platform.", @@ -980,11 +992,85 @@ "name": "platform", "options": [], "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" + }, + { + "auto": true, + "auto_count": 30, + "auto_min": "30s", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } ] }, @@ -992,11 +1078,10 @@ "from": "now-30m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Error Breakdown", "uid": "adrbls4g373eod", - "version": 1, + "version": 8, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/events_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Event Breakdown.json similarity index 90% rename from pillarbox-monitoring-grafana/dashboards/events_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Event Breakdown.json index d017f5e..da38d8c 100644 --- a/pillarbox-monitoring-grafana/dashboards/events_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Event Breakdown.json @@ -18,12 +18,13 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, + "id": 1, "links": [], "panels": [ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -205,7 +206,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -224,7 +225,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -439,7 +440,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s", + "interval": "$interval", "trimEdges": "0" }, "type": "date_histogram" @@ -447,7 +448,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -467,7 +468,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by platform for the selected time range.", "fieldConfig": { @@ -667,7 +668,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -675,7 +676,7 @@ "type": "count" } ], - "query": "event_name:START AND\ndata.player.platform:${platform} AND\ndata.media.id:${bu:raw}", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" } @@ -686,7 +687,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -828,7 +829,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s", + "interval": "$interval", "trimEdges": "0" }, "type": "date_histogram" @@ -836,7 +837,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -845,7 +846,7 @@ "type": "count" } ], - "query": "event_name:START AND\n(data.player.platform:${platform}\nAND data.media.id:${bu:raw} )", + "query": "event_name:START\nAND (data.player.platform:${platform}\nAND data.media.id:${bu:raw} )", "refId": "A", "timeField": "@timestamp" } @@ -860,6 +861,7 @@ "templating": { "list": [ { + "allValue": "*", "current": { "selected": false, "text": "All", @@ -867,7 +869,7 @@ }, "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", "description": "Filter by player platform.", @@ -878,7 +880,7 @@ "name": "platform", "options": [], "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 1, @@ -932,18 +934,91 @@ "queryValue": "", "skipUrlSync": false, "type": "custom" + }, + { + "auto": true, + "auto_count": 30, + "auto_min": "30s", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } ] }, "time": { - "from": "now-15m", + "from": "now-30m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Event Breakdown", "uid": "bdrg12eb4dp1cf", - "version": 1, + "version": 10, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/metrics_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Metrics Overview.json similarity index 83% rename from pillarbox-monitoring-grafana/dashboards/metrics_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Metrics Overview.json index e07aba9..e59e502 100644 --- a/pillarbox-monitoring-grafana/dashboards/metrics_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Metrics Overview.json @@ -18,12 +18,13 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, + "id": 5, "links": [], "panels": [ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -139,14 +140,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -155,7 +156,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:${bu:raw} AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}\nAND session.media.id:${media_id} ", "refId": "A", "timeField": "@timestamp" }, @@ -166,14 +167,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -183,7 +184,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:urn\\:${bu}\\:* AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:urn\\:${bu}\\:*\nAND session.media.id:${media_id} ", "refId": "B", "timeField": "@timestamp" } @@ -194,7 +195,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Stall rate normalized to duration watched.", "fieldConfig": { @@ -296,14 +297,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": true, "metrics": [ @@ -313,7 +314,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:${bu:raw} AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}\nAND session.media.id:${media_id} ", "refId": "A", "timeField": "@timestamp" }, @@ -324,14 +325,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": true, "metrics": [ @@ -341,7 +342,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:urn\\:${bu}\\:* AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:urn\\:${bu}\\:*\nAND session.media.id:${media_id} ", "refId": "B", "timeField": "@timestamp" }, @@ -363,7 +364,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Stall duration duration to watched ratio,", "fieldConfig": { @@ -465,14 +466,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": true, "metrics": [ @@ -482,7 +483,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND \nsession.player.platform:${platform} AND\nsession.media.id:${bu:raw} AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}\nAND session.media.id:${media_id} ", "refId": "A", "timeField": "@timestamp" }, @@ -493,14 +494,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": true, "metrics": [ @@ -510,7 +511,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:urn\\:${bu}\\:* AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:urn\\:${bu}\\:*\nAND session.media.id:${media_id} ", "refId": "B", "timeField": "@timestamp" }, @@ -532,7 +533,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -622,7 +623,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto", + "interval": "$interval", "min_doc_count": "0", "timeZone": "utc", "trimEdges": "0" @@ -632,7 +633,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -642,7 +643,7 @@ "type": "avg" } ], - "query": "event_name:START AND \ndata.player.platform:${platform} AND\ndata.media.id:${bu:raw} AND\ndata.media.id:${media_id} ", + "query": "event_name:START \nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}\nAND data.media.id:${media_id} ", "refId": "C", "timeField": "@timestamp" }, @@ -653,7 +654,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto", + "interval": "$interval", "min_doc_count": "0", "timeZone": "utc", "trimEdges": "0" @@ -663,7 +664,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -672,7 +673,7 @@ "type": "avg" } ], - "query": "event_name:START AND\ndata.player.platform:${platform} AND\ndata.media.id:urn\\:${bu}\\:* AND\ndata.media.id:${media_id} ", + "query": "event_name:START \nAND data.player.platform:${platform}\nAND data.media.id:urn\\:${bu}\\:*\nAND data.media.id:${media_id} ", "refId": "A", "timeField": "@timestamp" } @@ -683,7 +684,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -831,14 +832,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -847,7 +848,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:${bu:raw} AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR)\nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}\nAND session.media.id:${media_id} ", "refId": "A", "timeField": "@timestamp" }, @@ -858,14 +859,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -875,7 +876,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:urn\\:${bu}\\:* AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR) \nAND session.player.platform:${platform}\nAND session.media.id:urn\\:${bu}\\:*\nAND session.media.id:${media_id} ", "refId": "B", "timeField": "@timestamp" }, @@ -886,14 +887,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -903,7 +904,7 @@ "type": "avg" } ], - "query": "NOT event_name:(START OR ERROR) AND\nsession.player.platform:${platform} AND\nsession.media.id:urn\\:${bu}\\:* AND\nsession.media.id:${media_id} ", + "query": "NOT event_name:(START OR ERROR) \nAND session.player.platform:${platform}\nAND session.media.id:urn\\:${bu}\\:*\nAND session.media.id:${media_id} ", "refId": "C", "timeField": "@timestamp" } @@ -917,6 +918,7 @@ "templating": { "list": [ { + "allValue": "*", "current": { "selected": false, "text": "All", @@ -924,7 +926,7 @@ }, "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", "description": "Filter by player platform.", @@ -935,7 +937,7 @@ "name": "platform", "options": [], "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 1, @@ -990,6 +992,79 @@ "skipUrlSync": false, "type": "custom" }, + { + "auto": true, + "auto_count": 30, + "auto_min": "30s", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, { "current": { "selected": false, @@ -1016,11 +1091,10 @@ "from": "now-15m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Metrics Overview", "uid": "cdrfq3ry8fw1sc", - "version": 1, + "version": 7, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/session_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Session Breakdown.json similarity index 93% rename from pillarbox-monitoring-grafana/dashboards/session_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Session Breakdown.json index 1aec4b9..15a020a 100644 --- a/pillarbox-monitoring-grafana/dashboards/session_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Session Breakdown.json @@ -18,12 +18,13 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, + "id": 6, "links": [], "panels": [ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -94,7 +95,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -219,7 +220,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -316,7 +317,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -366,7 +367,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -496,7 +497,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -584,7 +585,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -718,7 +719,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -809,7 +810,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -940,7 +941,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1012,7 +1013,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -1128,14 +1129,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1155,14 +1156,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -1183,7 +1184,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "gridPos": { "h": 7, @@ -1208,7 +1209,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1232,11 +1233,10 @@ "include": { "names": [ "@timestamp", + "data.log", "data.message", "data.name", - "data.severity", - "session_id", - "data.log" + "session_id" ] } } @@ -1262,9 +1262,7 @@ "@timestamp", "data.message", "data.name", - "data.severity", - "session_id", - "Log" + "session_id" ] } } @@ -1288,7 +1286,7 @@ "data.log": "Logs", "data.message": "Message", "data.name": "Name", - "data.severity": "Severity", + "data.severity": "", "session_id": "Session" } } @@ -1322,6 +1320,79 @@ "query": "", "skipUrlSync": false, "type": "textbox" + }, + { + "auto": true, + "auto_count": 30, + "auto_min": "30s", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } ] }, @@ -1329,11 +1400,10 @@ "from": "now-30m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Session Breakdown", "uid": "bdrf82ou9416ob", - "version": 1, + "version": 4, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/active_sessions.json b/pillarbox-monitoring-grafana/dashboards/Sessions.json similarity index 98% rename from pillarbox-monitoring-grafana/dashboards/active_sessions.json rename to pillarbox-monitoring-grafana/dashboards/Sessions.json index f5c5b5e..8dabb71 100644 --- a/pillarbox-monitoring-grafana/dashboards/active_sessions.json +++ b/pillarbox-monitoring-grafana/dashboards/Sessions.json @@ -18,12 +18,13 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, + "id": 4, "links": [], "panels": [ { "datasource": { - "type": "opensearch", - "uid": "de0gi09a14ow0e" + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -172,7 +173,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -215,7 +216,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -442,11 +443,10 @@ "from": "now-1h", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Sessions", "uid": "bdq5sq0nz5pmod", - "version": 1, + "version": 5, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/provisioning/datasources/datasource.yml b/pillarbox-monitoring-grafana/provisioning/datasources/datasource.yml index 56dff2d..43df64d 100644 --- a/pillarbox-monitoring-grafana/provisioning/datasources/datasource.yml +++ b/pillarbox-monitoring-grafana/provisioning/datasources/datasource.yml @@ -11,7 +11,7 @@ datasources: basicAuth: false isDefault: true jsonData: - database: actions + database: filtered_actions flavor: opensearch logLevelField: '' logMessageField: '' diff --git a/pillarbox-monitoring-transfer b/pillarbox-monitoring-transfer index d51d7fe..c15357a 160000 --- a/pillarbox-monitoring-transfer +++ b/pillarbox-monitoring-transfer @@ -1 +1 @@ -Subproject commit d51d7feb849fa09c5b12c7052a0b3044831ecbc7 +Subproject commit c15357acdf88e6779690e04bb9d14e0ab03532e5