From d49fc0b42dca046657725f14340c9563f990590a 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 +- .../dashboards/Daily Report.json | 923 ++++++++++++++++++ ...e_breakdown.json => Device Breakdown.json} | 66 +- ...or_breakdown.json => Error Breakdown.json} | 222 +++-- ...ts_breakdown.json => Event Breakdown.json} | 130 ++- ...s_breakdown.json => Metrics Overview.json} | 179 +++- ..._breakdown.json => Session Breakdown.json} | 152 ++- .../{active_sessions.json => Sessions.json} | 114 ++- .../provisioning/datasources/datasource.yml | 2 +- pillarbox-monitoring-transfer | 2 +- 13 files changed, 1701 insertions(+), 192 deletions(-) create mode 100644 docs/DASHBOARD_EXPORT_GUIDE.md create mode 100644 pillarbox-monitoring-grafana/dashboards/Daily Report.json rename pillarbox-monitoring-grafana/dashboards/{device_breakdown.json => Device Breakdown.json} (95%) rename pillarbox-monitoring-grafana/dashboards/{error_breakdown.json => Error Breakdown.json} (85%) rename pillarbox-monitoring-grafana/dashboards/{events_breakdown.json => Event Breakdown.json} (89%) rename pillarbox-monitoring-grafana/dashboards/{metrics_breakdown.json => Metrics Overview.json} (82%) rename pillarbox-monitoring-grafana/dashboards/{session_breakdown.json => Session Breakdown.json} (91%) rename pillarbox-monitoring-grafana/dashboards/{active_sessions.json => Sessions.json} (80%) 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..81ef3ff --- /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://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/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/Daily Report.json b/pillarbox-monitoring-grafana/dashboards/Daily Report.json new file mode 100644 index 0000000..daa27fe --- /dev/null +++ b/pillarbox-monitoring-grafana/dashboards/Daily Report.json @@ -0,0 +1,923 @@ +{ + "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": 30, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "Yesterday", + "tooltip": "", + "type": "link", + "url": "/d/fe3wlaan74740b/daily-report?from=now-1d/d&to=now-1d/d" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "2 Days Ago", + "tooltip": "", + "type": "link", + "url": "/d/fe3wlaan74740b/daily-report?from=now-2d/d&to=now-2d/d" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "3 Days Ago", + "tooltip": "", + "type": "link", + "url": "/d/fe3wlaan74740b/daily-report?from=now-3d/d&to=now-3d/d" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "4 Days Ago", + "tooltip": "", + "type": "link", + "url": "/d/fe3wlaan74740b/daily-report?from=now-4d/d&to=now-4d/d" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "5 Days Ago", + "tooltip": "", + "type": "link", + "url": "/d/fe3wlaan74740b/daily-report?from=now-5d/d&to=now-5d/d" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "6 Days Ago", + "tooltip": "", + "type": "link", + "url": "/d/fe3wlaan74740b/daily-report?from=now-6d/d&to=now-6d/d" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "pillarbox" + ], + "targetBlank": false, + "title": "Navigate to", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "panels": [ + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0.95 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 5, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "format": "table", + "hide": false, + "luceneQueryType": "Metric", + "metrics": [ + { + "field": "session_id.keyword", + "id": "3", + "type": "cardinality" + } + ], + "query": "session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "queryType": "lucene", + "refId": "playing", + "timeField": "@timestamp" + }, + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "format": "table", + "hide": false, + "metrics": [ + { + "field": "session_id.keyword", + "id": "1", + "type": "cardinality" + } + ], + "query": "event_name:ERROR\nAND session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "queryType": "lucene", + "refId": "error", + "timeField": "@timestamp" + } + ], + "title": "Total Success Rate", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "Unique Count session_id.keyword" + ] + } + } + }, + { + "id": "reduce", + "options": { + "includeTimeField": false, + "labelsToFields": false, + "mode": "seriesToRows", + "reducers": [ + "sum" + ] + } + }, + { + "id": "rowsToFields", + "options": { + "mappings": [] + } + }, + { + "id": "calculateField", + "options": { + "binary": { + "left": "Unique Count session_id.keyword 2", + "operator": "/", + "right": "Unique Count session_id.keyword 1" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Unique Count session_id.keyword 1": true, + "Unique Count session_id.keyword 2": true, + "Unique Count session_id.keyword 2 / Unique Count session_id.keyword 1": false + }, + "includeByName": {}, + "indexByName": {}, + "renameByName": {} + } + }, + { + "id": "calculateField", + "options": { + "binary": { + "left": "1", + "operator": "-", + "right": "Unique Count session_id.keyword 2 / Unique Count session_id.keyword 1" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Unique Count session_id.keyword 2 / Unique Count session_id.keyword 1": true + }, + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "1 - Unique Count session_id.keyword 2 / Unique Count session_id.keyword 1": "Success" + } + } + } + ], + "type": "gauge" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMax": 1.1, + "axisSoftMin": 0, + "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": "dashed+area" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0.95 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 19, + "x": 5, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "$interval", + "min_doc_count": "0", + "trimEdges": "0" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "format": "table", + "hide": true, + "luceneQueryType": "Metric", + "metrics": [ + { + "field": "session_id.keyword", + "id": "3", + "type": "cardinality" + } + ], + "query": "session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "queryType": "lucene", + "refId": "playing", + "timeField": "@timestamp" + }, + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "$interval" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "format": "table", + "hide": true, + "metrics": [ + { + "field": "session_id.keyword", + "id": "1", + "type": "cardinality" + } + ], + "query": "event_name:ERROR\nAND session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "queryType": "lucene", + "refId": "error", + "timeField": "@timestamp" + }, + { + "datasource": { + "name": "Expression", + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "1 - ($error / $playing)", + "hide": false, + "refId": "Error", + "type": "math" + } + ], + "title": "Success rate over time", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": " " + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 20 + }, + { + "color": "red", + "value": 100 + } + ] + } + }, + { + "id": "custom.width", + "value": 60 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Media ID" + }, + "properties": [ + { + "id": "filterable", + "value": true + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "https://demo.pillarbox.ch/examples?src=${__value.text}&type=srgssr%2Furn" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 5, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "session.media.id.keyword", + "id": "2", + "settings": { + "min_doc_count": "1", + "order": "desc", + "orderBy": "_count", + "size": "0" + }, + "type": "terms" + } + ], + "datasource": { + "type": "opensearch", + "uid": "PB728120E9B299770" + }, + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "event_name:ERROR\nAND session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Most conflicting medias", + "transformations": [ + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "desc": true, + "field": "Count" + } + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "Count": " ", + "data.name.keyword": "Error name", + "session.media.id.keyword": "Media ID" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 60, + "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": "blue", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 19, + "x": 5, + "y": 8 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "alias": "Sessions", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "$interval" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "format": "table", + "metrics": [ + { + "field": "session_id.keyword", + "id": "1", + "type": "cardinality" + } + ], + "query": "session.media.id:${bu:raw}\nAND session.player.platform:${platform}", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Number of Sessions", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "pillarbox" + ], + "templating": { + "list": [ + { + "allValue": "*", + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" + }, + "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", + "description": "Filter by player platform.", + "hide": 0, + "includeAll": true, + "label": "Player Platform", + "multi": false, + "name": "platform", + "options": [], + "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": "*", + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, + "hide": 0, + "includeAll": true, + "label": "Business Unit", + "multi": false, + "name": "bu", + "options": [ + { + "selected": true, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "srf", + "value": "urn\\:srf\\:*" + }, + { + "selected": false, + "text": "rts", + "value": "urn\\:rts\\:*" + }, + { + "selected": false, + "text": "rsi", + "value": "urn\\:rsi\\:*" + }, + { + "selected": false, + "text": "rtr", + "value": "urn\\:rtr\\:*" + }, + { + "selected": false, + "text": "swi", + "value": "urn\\:swi\\:*" + } + ], + "query": "srf : urn\\:srf\\:*, rts : urn\\:rts\\:*, rsi : urn\\:rsi\\:*, rtr : urn\\:rtr\\:*, swi : urn\\:swi\\:*", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "auto": true, + "auto_count": 30, + "auto_min": "1m", + "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-1d/d", + "to": "now-1d/d" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Daily Report", + "uid": "fe3wlaan74740b", + "version": 13, + "weekStart": "" +} diff --git a/pillarbox-monitoring-grafana/dashboards/device_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Device Breakdown.json similarity index 95% rename from pillarbox-monitoring-grafana/dashboards/device_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Device Breakdown.json index 1535102..ac3ddc0 100644 --- a/pillarbox-monitoring-grafana/dashboards/device_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Device Breakdown.json @@ -18,12 +18,28 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "links": [], + "id": 3, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "pillarbox" + ], + "targetBlank": false, + "title": "Navigate to", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "panels": [ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by Operating System for the selected time range.", "fieldConfig": { @@ -283,7 +299,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -291,7 +307,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 +318,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by device type for the selected time range.", "fieldConfig": { @@ -562,7 +578,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -570,7 +586,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 +597,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by browser for the selected time range.", "fieldConfig": { @@ -736,7 +752,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -744,7 +760,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 +771,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 +872,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -864,7 +880,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 +954,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "The top 10 device models for the selected time range.", "fieldConfig": { @@ -1033,7 +1049,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1041,7 +1057,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 +1068,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "The top 10 browsers' versions for the selected time range.", "fieldConfig": { @@ -1153,7 +1169,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1161,7 +1177,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" } @@ -1235,10 +1251,13 @@ ], "refresh": "5s", "schemaVersion": 39, - "tags": [], + "tags": [ + "pillarbox" + ], "templating": { "list": [ { + "allValue": "*", "current": { "selected": false, "text": "All", @@ -1246,7 +1265,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 +1276,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 +1337,10 @@ "from": "now-1h", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Device Breakdown", "uid": "cdrj6qnc10veoe", - "version": 1, + "version": 9, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/error_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Error Breakdown.json similarity index 85% rename from pillarbox-monitoring-grafana/dashboards/error_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Error Breakdown.json index c0d47c6..de19444 100644 --- a/pillarbox-monitoring-grafana/dashboards/error_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Error Breakdown.json @@ -18,7 +18,23 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "links": [], + "id": 2, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "pillarbox" + ], + "targetBlank": false, + "title": "Navigate to", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "panels": [ { "collapsed": true, @@ -33,7 +49,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "gridPos": { "h": 7, @@ -55,26 +71,32 @@ "targets": [ { "alias": "", - "bucketAggs": [], + "bucketAggs": [ + { + "field": "@timestamp", + "id": "1", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { "id": "1", - "settings": { - "size": "500" - }, - "type": "raw_data" + "type": "logs" } ], - "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 +104,10 @@ "include": { "names": [ "@timestamp", + "data.log", "data.message", "data.name", - "data.severity", - "session_id", - "data.log" + "session_id" ] } } @@ -112,9 +133,7 @@ "@timestamp", "data.message", "data.name", - "data.severity", - "session_id", - "Log" + "session_id" ] } } @@ -138,7 +157,7 @@ "data.log": "Logs", "data.message": "Message", "data.name": "Name", - "data.severity": "Severity", + "data.severity": "", "session_id": "Session" } } @@ -166,7 +185,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -293,14 +312,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 +340,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 +368,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 +396,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -458,7 +477,7 @@ "alias": "", "bucketAggs": [ { - "field": "data.device.model.keyword", + "field": "session.device.model.keyword", "id": "2", "settings": { "min_doc_count": "1", @@ -471,7 +490,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -479,7 +498,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 +509,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -639,7 +658,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -647,7 +666,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 +703,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -889,7 +908,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -897,20 +916,62 @@ "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" } ], - "refresh": "30s", + "refresh": "", "schemaVersion": 39, - "tags": [], + "tags": [ + "pillarbox" + ], "templating": { "list": [ + { + "allValue": "*", + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "opensearch", + "uid": "PB728120E9B299770" + }, + "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", + "description": "Filter by player platform.", + "hide": 0, + "includeAll": true, + "label": "Player Platform", + "multi": false, + "name": "platform", + "options": [], + "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, { "allValue": "*", "current": { @@ -961,30 +1022,78 @@ "type": "custom" }, { - "allValue": "", + "auto": true, + "auto_count": 30, + "auto_min": "30s", "current": { "selected": false, - "text": "All", - "value": "$__all" + "text": "auto", + "value": "$__auto_interval_interval" }, - "datasource": { - "type": "opensearch", - "uid": "de0gi09a14ow0e" - }, - "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", - "description": "Filter by player platform.", "hide": 0, - "includeAll": true, - "label": "Player Platform", - "multi": false, - "name": "platform", - "options": [], - "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", - "refresh": 1, - "regex": "", + "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, - "sort": 0, - "type": "query" + "type": "interval" } ] }, @@ -992,11 +1101,10 @@ "from": "now-30m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Error Breakdown", "uid": "adrbls4g373eod", - "version": 1, + "version": 12, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/events_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Event Breakdown.json similarity index 89% rename from pillarbox-monitoring-grafana/dashboards/events_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Event Breakdown.json index d017f5e..0876979 100644 --- a/pillarbox-monitoring-grafana/dashboards/events_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Event Breakdown.json @@ -18,12 +18,28 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "links": [], + "id": 1, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "pillarbox" + ], + "targetBlank": false, + "title": "Navigate to", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "panels": [ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -205,7 +221,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -224,7 +240,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -439,7 +455,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s", + "interval": "$interval", "trimEdges": "0" }, "type": "date_histogram" @@ -447,7 +463,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -467,7 +483,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Usage by platform for the selected time range.", "fieldConfig": { @@ -667,7 +683,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -675,7 +691,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 +702,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -828,7 +844,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s", + "interval": "$interval", "trimEdges": "0" }, "type": "date_histogram" @@ -836,7 +852,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -845,7 +861,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" } @@ -856,10 +872,13 @@ ], "refresh": "30s", "schemaVersion": 39, - "tags": [], + "tags": [ + "pillarbox" + ], "templating": { "list": [ { + "allValue": "*", "current": { "selected": false, "text": "All", @@ -867,7 +886,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 +897,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 +951,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": 12, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/metrics_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Metrics Overview.json similarity index 82% rename from pillarbox-monitoring-grafana/dashboards/metrics_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Metrics Overview.json index e07aba9..ea96d20 100644 --- a/pillarbox-monitoring-grafana/dashboards/metrics_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Metrics Overview.json @@ -18,12 +18,28 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "links": [], + "id": 5, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "pillarbox" + ], + "targetBlank": false, + "title": "Navigate to", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "panels": [ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -139,14 +155,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -155,7 +171,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 +182,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 +199,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 +210,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Stall rate normalized to duration watched.", "fieldConfig": { @@ -296,14 +312,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 +329,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 +340,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 +357,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 +379,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "Stall duration duration to watched ratio,", "fieldConfig": { @@ -465,14 +481,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 +498,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 +509,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 +526,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 +548,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -622,7 +638,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto", + "interval": "$interval", "min_doc_count": "0", "timeZone": "utc", "trimEdges": "0" @@ -632,7 +648,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -642,7 +658,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 +669,7 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto", + "interval": "$interval", "min_doc_count": "0", "timeZone": "utc", "trimEdges": "0" @@ -663,7 +679,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -672,7 +688,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 +699,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "description": "", "fieldConfig": { @@ -831,14 +847,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "10s" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -847,7 +863,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 +874,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 +891,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 +902,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 +919,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" } @@ -913,10 +929,13 @@ ], "refresh": "30s", "schemaVersion": 39, - "tags": [], + "tags": [ + "pillarbox" + ], "templating": { "list": [ { + "allValue": "*", "current": { "selected": false, "text": "All", @@ -924,7 +943,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 +954,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 +1009,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 +1108,10 @@ "from": "now-15m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Metrics Overview", "uid": "cdrfq3ry8fw1sc", - "version": 1, + "version": 9, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/session_breakdown.json b/pillarbox-monitoring-grafana/dashboards/Session Breakdown.json similarity index 91% rename from pillarbox-monitoring-grafana/dashboards/session_breakdown.json rename to pillarbox-monitoring-grafana/dashboards/Session Breakdown.json index 1aec4b9..8a1084d 100644 --- a/pillarbox-monitoring-grafana/dashboards/session_breakdown.json +++ b/pillarbox-monitoring-grafana/dashboards/Session Breakdown.json @@ -18,12 +18,28 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "links": [], + "id": 6, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "sessions" + ], + "targetBlank": false, + "title": "Go back to session list", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "panels": [ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -94,7 +110,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -118,14 +134,14 @@ "names": [ "data.device.model", "data.device.type", - "data.screen.height", "data.media.id", - "data.media.source", "data.media.origin", "data.os.name", "data.os.version", "data.player.platform", - "data.screen.width" + "data.screen.height", + "data.screen.width", + "user_ip" ] } } @@ -155,7 +171,8 @@ "data.media.source": "Media Source", "data.os.name": "", "data.player.name": "", - "data.player.platform": "Player Platform" + "data.player.platform": "Player Platform", + "user_ip": "IP" } } }, @@ -219,7 +236,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -316,7 +333,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -366,7 +383,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -496,7 +513,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -584,7 +601,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -718,7 +735,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -809,7 +826,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -940,7 +957,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1012,7 +1029,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -1128,14 +1145,14 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto" + "interval": "$interval" }, "type": "date_histogram" } ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1155,14 +1172,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 +1200,7 @@ { "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "gridPos": { "h": 7, @@ -1208,7 +1225,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -1232,11 +1249,10 @@ "include": { "names": [ "@timestamp", + "data.log", "data.message", "data.name", - "data.severity", - "session_id", - "data.log" + "session_id" ] } } @@ -1262,9 +1278,7 @@ "@timestamp", "data.message", "data.name", - "data.severity", - "session_id", - "Log" + "session_id" ] } } @@ -1288,7 +1302,7 @@ "data.log": "Logs", "data.message": "Message", "data.name": "Name", - "data.severity": "Severity", + "data.severity": "", "session_id": "Session" } } @@ -1299,7 +1313,9 @@ ], "refresh": "", "schemaVersion": 39, - "tags": [], + "tags": [ + "hidden" + ], "templating": { "list": [ { @@ -1322,6 +1338,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 +1418,10 @@ "from": "now-30m", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Session Breakdown", "uid": "bdrf82ou9416ob", - "version": 1, + "version": 9, "weekStart": "" } diff --git a/pillarbox-monitoring-grafana/dashboards/active_sessions.json b/pillarbox-monitoring-grafana/dashboards/Sessions.json similarity index 80% rename from pillarbox-monitoring-grafana/dashboards/active_sessions.json rename to pillarbox-monitoring-grafana/dashboards/Sessions.json index f5c5b5e..5191ba2 100644 --- a/pillarbox-monitoring-grafana/dashboards/active_sessions.json +++ b/pillarbox-monitoring-grafana/dashboards/Sessions.json @@ -18,12 +18,28 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "links": [], + "id": 4, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "pillarbox" + ], + "targetBlank": false, + "title": "Pillarbox Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "panels": [ { "datasource": { - "type": "opensearch", - "uid": "de0gi09a14ow0e" + "type": "grafana-opensearch-datasource", + "uid": "PB728120E9B299770" }, "fieldConfig": { "defaults": { @@ -155,7 +171,7 @@ "cellHeight": "sm", "footer": { "countRows": false, - "enablePagination": false, + "enablePagination": true, "fields": "", "reducer": [ "sum" @@ -172,7 +188,7 @@ "bucketAggs": [], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "metrics": [ { @@ -183,7 +199,7 @@ "type": "raw_data" } ], - "query": "event_name:START", + "query": "event_name:START\nAND data.player.platform:${platform}\nAND data.media.id:${bu:raw}", "refId": "A", "timeField": "@timestamp" }, @@ -215,7 +231,7 @@ ], "datasource": { "type": "opensearch", - "uid": "de0gi09a14ow0e" + "uid": "PB728120E9B299770" }, "hide": false, "metrics": [ @@ -224,7 +240,7 @@ "type": "count" } ], - "query": "NOT (event_name:START)", + "query": "NOT (event_name:START)\nAND session.player.platform:${platform}\nAND session.media.id:${bu:raw}", "refId": "C", "timeField": "@timestamp" } @@ -434,19 +450,93 @@ ], "refresh": "30s", "schemaVersion": 39, - "tags": [], + "tags": [ + "pillarbox", + "sessions" + ], "templating": { - "list": [] + "list": [ + { + "allValue": "*", + "current": { + "selected": true, + "text": "Web", + "value": "Web" + }, + "definition": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", + "description": "Filter by player platform.", + "hide": 0, + "includeAll": true, + "label": "Platform", + "multi": false, + "name": "platform", + "options": [], + "query": "{\n \"find\": \"terms\",\n \"field\": \"data.player.platform.keyword\",\n \"size\": 1000\n}", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "allValue": "*", + "current": { + "selected": true, + "text": "rts", + "value": "urn\\:rts\\:*" + }, + "hide": 0, + "includeAll": true, + "label": "Business Unit", + "multi": false, + "name": "bu", + "options": [ + { + "selected": false, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "srf", + "value": "urn\\:srf\\:*" + }, + { + "selected": true, + "text": "rts", + "value": "urn\\:rts\\:*" + }, + { + "selected": false, + "text": "rsi", + "value": "urn\\:rsi\\:*" + }, + { + "selected": false, + "text": "rtr", + "value": "urn\\:rtr\\:*" + }, + { + "selected": false, + "text": "swi", + "value": "urn\\:swi\\:*" + } + ], + "query": "srf : urn\\:srf\\:*, rts : urn\\:rts\\:*, rsi : urn\\:rsi\\:*, rtr : urn\\:rtr\\:*, swi : urn\\:swi\\:*", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + } + ] }, "time": { "from": "now-1h", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "browser", "title": "Sessions", "uid": "bdq5sq0nz5pmod", - "version": 1, + "version": 9, "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