{ "apiVersion": "dashboard.grafana.app/v2", "kind": "Dashboard", "metadata": { "name": "plex-language-sync" }, "spec": { "title": "Plex Language Sync", "description": "Whether plex-language-sync is connected to Plex and keeping its deep scan on time, with what needs your attention, and the track choices it writes over time. The attention tiles need the rules from alerts/promql.yaml loaded.", "tags": [ "plex", "media" ], "annotations": [ { "kind": "AnnotationQuery", "spec": { "query": { "kind": "DataQuery", "group": "grafana", "version": "v0", "datasource": { "name": "-- Grafana --" }, "spec": {} }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "builtIn": true, "legacyOptions": { "type": "dashboard" } } } ], "cursorSync": "Crosshair", "editable": true, "liveNow": false, "preload": true, "links": [], "timeSettings": { "timezone": "browser", "from": "now-7d", "to": "now", "autoRefresh": "1m", "autoRefreshIntervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "hideTimepicker": false, "fiscalYearStartMonth": 0 }, "variables": [ { "kind": "DatasourceVariable", "spec": { "name": "datasource", "pluginId": "prometheus", "refresh": "never", "regex": "", "current": { "text": "", "value": "" }, "options": [], "multi": false, "includeAll": false, "label": "Data source", "hide": "dontHide", "skipUrlSync": false, "allowCustomValue": true } }, { "kind": "QueryVariable", "spec": { "name": "instance", "current": { "text": "", "value": "" }, "label": "Instance", "hide": "dontHide", "refresh": "onTimeRangeChanged", "skipUrlSync": false, "description": "The plex-language-sync to show, by its scrape instance. Each container follows one Plex server.", "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "query": "label_values(plex_language_sync_build_info, instance)" } }, "regex": "", "sort": "alphabeticalAsc", "definition": "label_values(plex_language_sync_build_info, instance)", "options": [], "multi": false, "includeAll": false, "allowCustomValue": false } }, { "kind": "QueryVariable", "spec": { "name": "attention", "label": "Attention tiles shown", "description": "How many Needs attention tiles have data. The row shows only while one does.", "current": { "text": "0", "value": "0" }, "hide": "hideVariable", "refresh": "onTimeRangeChanged", "skipUrlSync": true, "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "query": "query_result(count(label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncDown\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"1\", \"\", \"\") or label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncDeepScanStalled\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"2\", \"\", \"\") or label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncWebSocketDown\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"3\", \"\", \"\") or label_replace(count(max(ALERTS{alertname=\"PlexLanguageSyncResolutionStalled\", alertstate=\"firing\", instance=\"$instance\", cause=\"sessions_unreadable\"} * 0 + 1 or ALERTS{alertname=\"PlexLanguageSyncResolutionStalled\", alertstate=\"firing\", instance=\"$instance\", cause=\"all_clients_absent\"} * 0 + 2)), \"tile\", \"4\", \"\", \"\") or label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncCacheSaveFailed\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"5\", \"\", \"\")) or vector(0))" } }, "definition": "query_result(count(label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncDown\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"1\", \"\", \"\") or label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncDeepScanStalled\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"2\", \"\", \"\") or label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncWebSocketDown\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"3\", \"\", \"\") or label_replace(count(max(ALERTS{alertname=\"PlexLanguageSyncResolutionStalled\", alertstate=\"firing\", instance=\"$instance\", cause=\"sessions_unreadable\"} * 0 + 1 or ALERTS{alertname=\"PlexLanguageSyncResolutionStalled\", alertstate=\"firing\", instance=\"$instance\", cause=\"all_clients_absent\"} * 0 + 2)), \"tile\", \"4\", \"\", \"\") or label_replace(count(0 * max(ALERTS{alertname=\"PlexLanguageSyncCacheSaveFailed\", alertstate=\"firing\", instance=\"$instance\"})), \"tile\", \"5\", \"\", \"\")) or vector(0))", "regex": "/^\\{\\} ([0-9]+) /", "sort": "disabled", "options": [], "multi": false, "includeAll": false, "allowCustomValue": false } } ], "elements": { "panel-1": { "kind": "Panel", "spec": { "id": 1, "title": "Scrape", "description": "Shows while the PlexLanguageSyncDown alert fires: no scrape of plex-language-sync has succeeded for 5 minutes. Check that the container runs and that METRICS_LISTEN_ADDR is set. A scrape job with no target at all fires the alert with no instance, so this tile cannot show it. Needs the rules from alerts/promql.yaml in a ruler that stores its `ALERTS` series beside the metrics, as Prometheus and Mimir do.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "0 * max(ALERTS{alertname=\"PlexLanguageSyncDown\", alertstate=\"firing\", instance=\"$instance\"})", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": { "maxDataPoints": 500 } } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Nothing to report", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "red" } ] }, "decimals": 0, "mappings": [ { "type": "value", "options": { "0": { "index": 0, "text": "Not scraped", "color": "red" } } } ] }, "overrides": [] } } } } }, "panel-2": { "kind": "Panel", "spec": { "id": 2, "title": "Deep scan", "description": "Shows while the PlexLanguageSyncDeepScanStalled alert fires: no deep scan has covered its whole window for two scan intervals plus 2 hours, so missed episodes get no tracks. The container log's `deep analysis completed` lines with `complete=false` say why. Needs the rules from alerts/promql.yaml in a ruler that stores its `ALERTS` series beside the metrics, as Prometheus and Mimir do.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "0 * max(ALERTS{alertname=\"PlexLanguageSyncDeepScanStalled\", alertstate=\"firing\", instance=\"$instance\"})", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": { "maxDataPoints": 500 } } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Nothing to report", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "red" } ] }, "decimals": 0, "mappings": [ { "type": "value", "options": { "0": { "index": 0, "text": "Overdue", "color": "red" } } } ] }, "overrides": [] } } } } }, "panel-3": { "kind": "Panel", "spec": { "id": 3, "title": "Plex notifications", "description": "Shows while the PlexLanguageSyncWebSocketDown alert fires: the Plex notification stream has been down for 10 minutes, so no play or new episode is handled. Check that Plex is up and that PLEX_TOKEN is still valid. Needs the rules from alerts/promql.yaml in a ruler that stores its `ALERTS` series beside the metrics, as Prometheus and Mimir do.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "0 * max(ALERTS{alertname=\"PlexLanguageSyncWebSocketDown\", alertstate=\"firing\", instance=\"$instance\"})", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": { "maxDataPoints": 500 } } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Nothing to report", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "red" } ] }, "decimals": 0, "mappings": [ { "type": "value", "options": { "0": { "index": 0, "text": "Disconnected", "color": "red" } } } ] }, "overrides": [] } } } } }, "panel-4": { "kind": "Panel", "spec": { "id": 4, "title": "User attribution", "description": "Shows while the PlexLanguageSyncResolutionStalled alert fires: no play can be matched to a user, so no language choice is saved. Sessions unreadable means the token cannot read Plex's sessions: check that PLEX_TOKEN is the server admin's. Players not found means plays arrive but their players are missing from Plex's session list. Needs the rules from alerts/promql.yaml in a ruler that stores its `ALERTS` series beside the metrics, as Prometheus and Mimir do.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "max(ALERTS{alertname=\"PlexLanguageSyncResolutionStalled\", alertstate=\"firing\", instance=\"$instance\", cause=\"sessions_unreadable\"} * 0 + 1 or ALERTS{alertname=\"PlexLanguageSyncResolutionStalled\", alertstate=\"firing\", instance=\"$instance\", cause=\"all_clients_absent\"} * 0 + 2)", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": { "maxDataPoints": 500 } } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Nothing to report", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "red" } ] }, "decimals": 0, "mappings": [ { "type": "value", "options": { "1": { "index": 0, "text": "Sessions unreadable", "color": "red" }, "2": { "index": 1, "text": "Players not found", "color": "red" } } } ] }, "overrides": [] } } } } }, "panel-5": { "kind": "Panel", "spec": { "id": 5, "title": "Cache save", "description": "Shows while the PlexLanguageSyncCacheSaveFailed alert fires: a save to /config failed in the last hour, so learned choices and user tokens may be lost at the next restart. Give the container user write access to /config. Needs the rules from alerts/promql.yaml in a ruler that stores its `ALERTS` series beside the metrics, as Prometheus and Mimir do.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "0 * max(ALERTS{alertname=\"PlexLanguageSyncCacheSaveFailed\", alertstate=\"firing\", instance=\"$instance\"})", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": { "maxDataPoints": 500 } } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Nothing to report", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "red" } ] }, "decimals": 0, "mappings": [ { "type": "value", "options": { "0": { "index": 0, "text": "Failed", "color": "red" } } } ] }, "overrides": [] } } } } }, "panel-10": { "kind": "Panel", "spec": { "id": 10, "title": "Plex connection", "description": "Whether the Plex notification stream is connected now. Every play and new episode the app handles arrives on it, so while it reads Disconnected nothing is synced, and the app keeps reconnecting. No value means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "plex_language_sync_websocket_connected{instance=\"$instance\"}", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Not scraped", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "text" } ] }, "mappings": [ { "type": "value", "options": { "1": { "index": 0, "text": "Connected", "color": "green" }, "0": { "index": 1, "text": "Disconnected", "color": "red" } } } ] }, "overrides": [] } } } } }, "panel-11": { "kind": "Panel", "spec": { "id": 11, "title": "Last complete deep scan", "description": "When the last deep scan that covered its whole window finished, kept across restarts. With the default 24-hour DEEP_SCAN_INTERVAL, a time over a day ago means a scan was missed or stopped early. No value means none has completed yet, the deep scan is off, or plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "(plex_language_sync_deep_scan_last_success_timestamp_seconds{instance=\"$instance\"} > 0) * 1000", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "dateTimeFromNow", "noValue": "None yet", "color": { "mode": "fixed", "fixedColor": "text" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "text" } ] } }, "overrides": [] } } } } }, "panel-12": { "kind": "Panel", "spec": { "id": 12, "title": "Next complete deep scan due", "description": "The time by which the next complete deep scan is due: two scan intervals plus 2 hours after the last one, or after the start. A time in the past means the scan is overdue, and the Deep scan tile shows an hour later. No value means the deep scan is off.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "(plex_language_sync_deep_scan_deadline_timestamp_seconds{instance=\"$instance\"} > 0) * 1000", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "dateTimeFromNow", "noValue": "Scan off", "color": { "mode": "fixed", "fixedColor": "text" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "text" } ] } }, "overrides": [] } } } } }, "panel-13": { "kind": "Panel", "spec": { "id": 13, "title": "Shared users followed", "description": "How many shared Plex users the app follows besides the admin. A count lower than the users you share the server with means the others' choices are not synced. Check the container log for `failed to refresh shared user tokens`. No value means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "plex_language_sync_shared_users{instance=\"$instance\"}", "legendFormat": "", "instant": true, "range": false } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "stat", "version": "", "spec": { "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "reduceOptions": { "calcs": [ "lastNotNull" ], "values": false }, "textMode": "auto", "text": { "titleSize": 14, "valueSize": 28 } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Not scraped", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "text" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "text" } ] } }, "overrides": [] } } } } }, "panel-20": { "kind": "Panel", "spec": { "id": 20, "title": "Track selections written", "description": "Audio and subtitle choices the app wrote to Plex, per interval. An interval near a container restart, a failed scrape or a scrape outage can show fewer or more writes than were made. Failed bars mean Plex refused the write, and the container log says why. A gap means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "round(label_replace(label_replace(sum by (kind) ((((plex_language_sync_track_updates_total{instance=\"$instance\", result=\"set\"} - last_over_time(plex_language_sync_track_updates_total{instance=\"$instance\", result=\"set\"}[1h] offset $__interval)) unless on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_track_updates_total{instance=\"$instance\", result=\"set\"} and on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_track_updates_total{instance=\"$instance\", result=\"set\"} - min_over_time(plex_language_sync_track_updates_total{instance=\"$instance\", result=\"set\"}[$__interval])))), \"kind\", \"Audio\", \"kind\", \"audio\"), \"kind\", \"Subtitle\", \"kind\", \"subtitle\"))", "legendFormat": "{{kind}} set" } }, "refId": "A", "hidden": false } }, { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "round(label_replace(label_replace(sum by (kind) ((((plex_language_sync_track_updates_total{instance=\"$instance\", result=\"failed\"} - last_over_time(plex_language_sync_track_updates_total{instance=\"$instance\", result=\"failed\"}[1h] offset $__interval)) unless on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_track_updates_total{instance=\"$instance\", result=\"failed\"} and on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_track_updates_total{instance=\"$instance\", result=\"failed\"} - min_over_time(plex_language_sync_track_updates_total{instance=\"$instance\", result=\"failed\"}[$__interval])))), \"kind\", \"Audio\", \"kind\", \"audio\"), \"kind\", \"Subtitle\", \"kind\", \"subtitle\"))", "legendFormat": "{{kind}} failed" } }, "refId": "B", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "timeseries", "version": "", "spec": { "options": { "legend": { "showLegend": true, "displayMode": "list", "placement": "bottom", "calcs": [ "sum" ] }, "tooltip": { "mode": "multi" } }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" } ] }, "color": { "mode": "palette-classic" }, "custom": { "fillOpacity": 80, "lineWidth": 1, "drawStyle": "bars", "stacking": { "mode": "normal" } }, "noValue": "Not scraped", "min": 0, "decimals": 0 }, "overrides": [ { "matcher": { "id": "byRegexp", "options": ".* failed$" }, "properties": [ { "id": "color", "value": { "mode": "fixed", "fixedColor": "red" } } ] } ] } } } } }, "panel-21": { "kind": "Panel", "spec": { "id": 21, "title": "Plays handled", "description": "Plays the app handled, per interval, split by whether it could tell which user was watching. An interval near a container restart, a failed scrape or a scrape outage can show fewer or more plays than were handled. Skipped plays save no choice: many of them point to a token that cannot read sessions or a player Plex does not list. A gap means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "label_replace(label_replace(round(sum by (outcome) ((((plex_language_sync_play_events_total{instance=\"$instance\"} - last_over_time(plex_language_sync_play_events_total{instance=\"$instance\"}[1h] offset $__interval)) unless on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_play_events_total{instance=\"$instance\"} and on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_play_events_total{instance=\"$instance\"} - min_over_time(plex_language_sync_play_events_total{instance=\"$instance\"}[$__interval]))))), \"outcome\", \"Matched to a user\", \"outcome\", \"attributed\"), \"outcome\", \"Skipped, no user\", \"outcome\", \"skipped\")", "legendFormat": "{{outcome}}" } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "timeseries", "version": "", "spec": { "options": { "legend": { "showLegend": true, "displayMode": "list", "placement": "bottom", "calcs": [ "sum" ] }, "tooltip": { "mode": "multi" } }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" } ] }, "color": { "mode": "palette-classic" }, "custom": { "fillOpacity": 80, "lineWidth": 1, "drawStyle": "bars", "stacking": { "mode": "normal" } }, "noValue": "Not scraped", "min": 0, "decimals": 0 }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "^Skipped.*" }, "properties": [ { "id": "color", "value": { "mode": "fixed", "fixedColor": "red" } } ] } ] } } } } }, "panel-30": { "kind": "Panel", "spec": { "id": 30, "title": "Deep scans finished", "description": "Deep scans that finished, per interval: complete ones covered their whole window, incomplete ones stopped early and leave it to the next scan. An interval near a container restart, a failed scrape or a scrape outage can show fewer or more scans than finished. Repeated incomplete scans lead to the Deep scan tile. A gap means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "label_replace(label_replace(round(sum by (result) ((((plex_language_sync_deep_scan_runs_total{instance=\"$instance\"} - last_over_time(plex_language_sync_deep_scan_runs_total{instance=\"$instance\"}[1h] offset $__interval)) unless on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_deep_scan_runs_total{instance=\"$instance\"} and on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_deep_scan_runs_total{instance=\"$instance\"} - min_over_time(plex_language_sync_deep_scan_runs_total{instance=\"$instance\"}[$__interval]))))), \"result\", \"Complete\", \"result\", \"complete\"), \"result\", \"Incomplete\", \"result\", \"incomplete\")", "legendFormat": "{{result}}" } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "timeseries", "version": "", "spec": { "options": { "legend": { "showLegend": true, "displayMode": "list", "placement": "bottom", "calcs": [ "sum" ] }, "tooltip": { "mode": "multi" } }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" } ] }, "color": { "mode": "palette-classic" }, "custom": { "fillOpacity": 80, "lineWidth": 1, "drawStyle": "bars", "stacking": { "mode": "normal" } }, "noValue": "Not scraped", "min": 0, "decimals": 0 }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "^Incomplete$" }, "properties": [ { "id": "color", "value": { "mode": "fixed", "fixedColor": "red" } } ] } ] } } } } }, "panel-31": { "kind": "Panel", "spec": { "id": 31, "title": "Plex connection over time", "description": "When the Plex notification stream was connected over the selected range. A red stretch is time when no play or new episode was handled. The next deep scan repairs the episodes it missed. A gap means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "plex_language_sync_websocket_connected{instance=\"$instance\"}", "legendFormat": "Notification stream" } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "state-timeline", "version": "", "spec": { "options": { "showValue": "never", "mergeValues": true, "alignValue": "left", "rowHeight": 0.9, "legend": { "showLegend": false, "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "Not scraped", "color": { "mode": "fixed", "fixedColor": "green" }, "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" } ] }, "mappings": [ { "type": "value", "options": { "1": { "index": 0, "text": "Connected", "color": "green" }, "0": { "index": 1, "text": "Disconnected", "color": "red" } } } ], "custom": { "fillOpacity": 80, "lineWidth": 0 } }, "overrides": [] } } } } }, "panel-32": { "kind": "Panel", "spec": { "id": 32, "title": "Reconnect attempts", "description": "Attempts to reconnect the Plex notification stream after it dropped, per interval. An interval near a container restart, a failed scrape or a scrape outage can show fewer or more attempts than were made. A single bar is a Plex restart or a network blip, and a steady run means Plex keeps refusing the stream. A gap means plex-language-sync was not scraped.", "links": [], "data": { "kind": "QueryGroup", "spec": { "queries": [ { "kind": "PanelQuery", "spec": { "query": { "kind": "DataQuery", "group": "prometheus", "version": "v0", "datasource": { "name": "${datasource}" }, "spec": { "expr": "round(sum by (instance) ((((plex_language_sync_websocket_reconnects_total{instance=\"$instance\"} - last_over_time(plex_language_sync_websocket_reconnects_total{instance=\"$instance\"}[1h] offset $__interval)) unless on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_websocket_reconnects_total{instance=\"$instance\"} and on (instance) ((process_start_time_seconds{instance=\"$instance\"} != last_over_time(process_start_time_seconds{instance=\"$instance\"}[1h] offset $__interval)) or (process_start_time_seconds{instance=\"$instance\"} > time() - ${__interval_ms} / 1000))) or (plex_language_sync_websocket_reconnects_total{instance=\"$instance\"} - min_over_time(plex_language_sync_websocket_reconnects_total{instance=\"$instance\"}[$__interval])))))", "legendFormat": "Reconnects" } }, "refId": "A", "hidden": false } } ], "transformations": [], "queryOptions": {} } }, "vizConfig": { "kind": "VizConfig", "group": "timeseries", "version": "", "spec": { "options": { "legend": { "showLegend": true, "displayMode": "list", "placement": "bottom", "calcs": [ "sum" ] }, "tooltip": { "mode": "multi" } }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "value": null, "color": "green" } ] }, "color": { "mode": "palette-classic" }, "custom": { "fillOpacity": 80, "lineWidth": 1, "drawStyle": "bars", "stacking": { "mode": "normal" } }, "noValue": "Not scraped", "min": 0, "decimals": 0 }, "overrides": [] } } } } } }, "layout": { "kind": "RowsLayout", "spec": { "rows": [ { "kind": "RowsLayoutRow", "spec": { "title": "Needs attention", "collapse": false, "conditionalRendering": { "kind": "ConditionalRenderingGroup", "spec": { "visibility": "show", "condition": "and", "items": [ { "kind": "ConditionalRenderingVariable", "spec": { "variable": "attention", "operator": "matches", "value": "^[1-9]" } } ] } }, "layout": { "kind": "AutoGridLayout", "spec": { "maxColumnCount": 3, "columnWidthMode": "custom", "rowHeightMode": "custom", "rowHeight": 106, "fillScreen": false, "columnWidth": 272, "items": [ { "kind": "AutoGridLayoutItem", "spec": { "element": { "kind": "ElementReference", "name": "panel-1" }, "conditionalRendering": { "kind": "ConditionalRenderingGroup", "spec": { "visibility": "show", "condition": "or", "items": [ { "kind": "ConditionalRenderingData", "spec": { "value": true } }, { "kind": "ConditionalRenderingTimeRangeSize", "spec": { "value": "0s" } } ] } } } }, { "kind": "AutoGridLayoutItem", "spec": { "element": { "kind": "ElementReference", "name": "panel-2" }, "conditionalRendering": { "kind": "ConditionalRenderingGroup", "spec": { "visibility": "show", "condition": "or", "items": [ { "kind": "ConditionalRenderingData", "spec": { "value": true } }, { "kind": "ConditionalRenderingTimeRangeSize", "spec": { "value": "0s" } } ] } } } }, { "kind": "AutoGridLayoutItem", "spec": { "element": { "kind": "ElementReference", "name": "panel-3" }, "conditionalRendering": { "kind": "ConditionalRenderingGroup", "spec": { "visibility": "show", "condition": "or", "items": [ { "kind": "ConditionalRenderingData", "spec": { "value": true } }, { "kind": "ConditionalRenderingTimeRangeSize", "spec": { "value": "0s" } } ] } } } }, { "kind": "AutoGridLayoutItem", "spec": { "element": { "kind": "ElementReference", "name": "panel-4" }, "conditionalRendering": { "kind": "ConditionalRenderingGroup", "spec": { "visibility": "show", "condition": "or", "items": [ { "kind": "ConditionalRenderingData", "spec": { "value": true } }, { "kind": "ConditionalRenderingTimeRangeSize", "spec": { "value": "0s" } } ] } } } }, { "kind": "AutoGridLayoutItem", "spec": { "element": { "kind": "ElementReference", "name": "panel-5" }, "conditionalRendering": { "kind": "ConditionalRenderingGroup", "spec": { "visibility": "show", "condition": "or", "items": [ { "kind": "ConditionalRenderingData", "spec": { "value": true } }, { "kind": "ConditionalRenderingTimeRangeSize", "spec": { "value": "0s" } } ] } } } } ] } } } }, { "kind": "RowsLayoutRow", "spec": { "title": "Now", "collapse": false, "layout": { "kind": "GridLayout", "spec": { "items": [ { "kind": "GridLayoutItem", "spec": { "x": 0, "y": 0, "width": 6, "height": 3, "element": { "kind": "ElementReference", "name": "panel-10" } } }, { "kind": "GridLayoutItem", "spec": { "x": 6, "y": 0, "width": 6, "height": 3, "element": { "kind": "ElementReference", "name": "panel-11" } } }, { "kind": "GridLayoutItem", "spec": { "x": 12, "y": 0, "width": 6, "height": 3, "element": { "kind": "ElementReference", "name": "panel-12" } } }, { "kind": "GridLayoutItem", "spec": { "x": 18, "y": 0, "width": 6, "height": 3, "element": { "kind": "ElementReference", "name": "panel-13" } } } ] } } } }, { "kind": "RowsLayoutRow", "spec": { "title": "Sync", "collapse": false, "layout": { "kind": "GridLayout", "spec": { "items": [ { "kind": "GridLayoutItem", "spec": { "x": 0, "y": 0, "width": 12, "height": 8, "element": { "kind": "ElementReference", "name": "panel-20" } } }, { "kind": "GridLayoutItem", "spec": { "x": 12, "y": 0, "width": 12, "height": 8, "element": { "kind": "ElementReference", "name": "panel-21" } } } ] } } } }, { "kind": "RowsLayoutRow", "spec": { "title": "Deep scan and Plex connection", "collapse": false, "layout": { "kind": "GridLayout", "spec": { "items": [ { "kind": "GridLayoutItem", "spec": { "x": 0, "y": 0, "width": 8, "height": 8, "element": { "kind": "ElementReference", "name": "panel-30" } } }, { "kind": "GridLayoutItem", "spec": { "x": 8, "y": 0, "width": 8, "height": 8, "element": { "kind": "ElementReference", "name": "panel-31" } } }, { "kind": "GridLayoutItem", "spec": { "x": 16, "y": 0, "width": 8, "height": 8, "element": { "kind": "ElementReference", "name": "panel-32" } } } ] } } } } ] } } } }