diff --git a/config/grafana/dashboards/delta-notifier.json b/config/grafana/dashboards/delta-notifier.json new file mode 100644 index 0000000..6770bc8 --- /dev/null +++ b/config/grafana/dashboards/delta-notifier.json @@ -0,0 +1,813 @@ +{ + "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": 1, + "id": null, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, + "id": 100, + "title": "Overview", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Version", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "deltanotifier_info", + "legendFormat": "{{version}}", + "refId": "A" + } + ], + "transformations": [ + { + "id": "reduce", + "options": { "reducers": ["lastNotNull"] } + } + ], + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "textMode": "name", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } + } + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "blue", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 }, + "id": 2, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Configured rules", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "deltanotifier_configured_rules_total", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 5 }, + { "color": "red", "value": 20 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 }, + "id": 3, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Pending bundles", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "deltanotifier_pending_bundles", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 }, + "id": 4, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Deltas received (total)", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "deltanotifier_deltas_received_total", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 }, + "id": 5, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Changesets received (total)", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "deltanotifier_changesets_received_total", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "red", "value": null }, + { "color": "green", "value": 1 } + ] + }, + "unit": "short", + "noValue": "0" + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 }, + "id": 6, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Notifications (total)", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sum(deltanotifier_notifications_total)", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }, + "id": 101, + "title": "Delta throughput", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 6 }, + "id": 10, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Deltas received rate", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_deltas_received_total[$__rate_interval])", + "legendFormat": "deltas/s", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 6 }, + "id": 11, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Changesets received rate", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_changesets_received_total[$__rate_interval])", + "legendFormat": "changesets/s", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "bars", + "fillOpacity": 50, + "gradientMode": "none", + "lineWidth": 1, + "pointSize": 5, + "showPoints": "never", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 14 }, + "id": 12, + "options": { + "legend": { "calcs": ["sum"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Changesets per delta (avg over interval)", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_changesets_received_total[$__rate_interval]) / (rate(deltanotifier_deltas_received_total[$__rate_interval]) > 0)", + "legendFormat": "changesets/delta", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 14 }, + "id": 13, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Pending bundles", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "deltanotifier_pending_bundles", + "legendFormat": "pending", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 22 }, + "id": 102, + "title": "Notifications by service", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 23 }, + "id": 20, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Notification rate by target (success)", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_notifications_total{status=\"success\"}[$__rate_interval])", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "fixed", "fixedColor": "red" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 23 }, + "id": 21, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Notification errors by target", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_notifications_total{status=\"error\"}[$__rate_interval])", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 0.01 }, + { "color": "red", "value": 0.05 } + ] + }, + "unit": "percentunit", + "noValue": "N/A" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 31 }, + "id": 22, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto", + "wideLayout": true + }, + "title": "Error rate by target", + "description": "Fraction of notifications that failed per target service. Green = 0%, Yellow > 1%, Red > 5%.", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_notifications_total{status=\"error\"}[5m]) / (rate(deltanotifier_notifications_total[5m]) > 0)", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 39 }, + "id": 103, + "title": "Notification latency", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 40 }, + "id": 30, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Notification latency p50", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "histogram_quantile(0.50, rate(deltanotifier_notification_duration_seconds_bucket[$__rate_interval]))", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 40 }, + "id": 31, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Notification latency p95", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "histogram_quantile(0.95, rate(deltanotifier_notification_duration_seconds_bucket[$__rate_interval]))", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 48 }, + "id": 32, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Notification latency p99", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "histogram_quantile(0.99, rate(deltanotifier_notification_duration_seconds_bucket[$__rate_interval]))", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 48 }, + "id": 33, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Average notification latency", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(deltanotifier_notification_duration_seconds_sum[$__rate_interval]) / (rate(deltanotifier_notification_duration_seconds_count[$__rate_interval]) > 0)", + "legendFormat": "{{target}}", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 56 }, + "id": 104, + "title": "Totals breakdown", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "fillOpacity": 80, + "gradientMode": "none", + "lineWidth": 1 + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 57 }, + "id": 40, + "options": { + "barWidth": 0.7, + "groupWidth": 0.7, + "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, + "orientation": "horizontal", + "tooltip": { "mode": "single", "sort": "none" }, + "xTickLabelRotation": 0 + }, + "title": "Total notifications by target", + "type": "barchart", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sum by (target) (deltanotifier_notifications_total{status=\"success\"})", + "legendFormat": "{{target}} (success)", + "refId": "A", + "instant": true + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sum by (target) (deltanotifier_notifications_total{status=\"error\"})", + "legendFormat": "{{target}} (error)", + "refId": "B", + "instant": true + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 57 }, + "id": 41, + "options": { + "footer": { "enablePagination": false, "show": false }, + "showHeader": true, + "sortBy": [{ "desc": true, "displayName": "Total" }] + }, + "title": "Notification counts by target & status", + "type": "table", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sum by (target, status) (deltanotifier_notifications_total)", + "legendFormat": "", + "refId": "A", + "instant": true, + "format": "table" + } + ], + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { "Time": true, "__name__": true }, + "renameByName": { + "target": "Target", + "status": "Status", + "Value": "Total" + } + } + } + ] + } + ], + "refresh": "30s", + "schemaVersion": 38, + "tags": ["delta-notifier", "semantic-works"], + "templating": { "list": [] }, + "time": { "from": "now-1h", "to": "now" }, + "timepicker": {}, + "timezone": "", + "title": "Delta Notifier", + "uid": "delta-notifier", + "version": 1 +} diff --git a/config/grafana/dashboards/mu-search.json b/config/grafana/dashboards/mu-search.json new file mode 100644 index 0000000..8e24427 --- /dev/null +++ b/config/grafana/dashboards/mu-search.json @@ -0,0 +1,995 @@ +{ + "uid": "mu-search", + "title": "Mu Search", + "tags": ["mu-search", "semantic-works"], + "editable": true, + "graphTooltip": 1, + "schemaVersion": 38, + "refresh": "30s", + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "browser", + "panels": [ + { + "type": "row", + "title": "Overview", + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, + "id": 1, + "panels": [] + }, + { + "type": "stat", + "title": "Version", + "id": 2, + "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_info", + "legendFormat": "{{version}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [], + "color": { + "mode": "fixed", + "fixedColor": "text" + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "/^version$/" + }, + "graphMode": "none", + "colorMode": "background", + "textMode": "name", + "justifyMode": "auto" + }, + "transformations": [ + { + "id": "labelsToFields", + "options": {} + } + ] + }, + { + "type": "stat", + "title": "Elasticsearch Status", + "id": 3, + "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_elasticsearch_up", + "legendFormat": "", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "1": { "text": "Up", "color": "green", "index": 0 }, + "0": { "text": "Down", "color": "red", "index": 1 } + } + } + ], + "color": { + "mode": "fixed" + }, + "noValue": "N/A" + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "" + }, + "graphMode": "none", + "colorMode": "background", + "textMode": "auto", + "justifyMode": "auto" + } + }, + { + "type": "stat", + "title": "ES Cluster Health", + "id": 4, + "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_elasticsearch_cluster_status", + "legendFormat": "", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "2": { "text": "Green", "color": "green", "index": 0 }, + "1": { "text": "Yellow", "color": "yellow", "index": 1 }, + "0": { "text": "Red", "color": "red", "index": 2 } + } + } + ], + "color": { + "mode": "fixed" + }, + "noValue": "N/A" + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "" + }, + "graphMode": "none", + "colorMode": "background", + "textMode": "auto", + "justifyMode": "auto" + } + }, + { + "type": "stat", + "title": "SPARQL Status", + "id": 5, + "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_sparql_up", + "legendFormat": "", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "1": { "text": "Up", "color": "green", "index": 0 }, + "0": { "text": "Down", "color": "red", "index": 1 } + } + } + ], + "color": { + "mode": "fixed" + }, + "noValue": "N/A" + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "" + }, + "graphMode": "none", + "colorMode": "background", + "textMode": "auto", + "justifyMode": "auto" + } + }, + { + "type": "stat", + "title": "ES Read-Only", + "id": 6, + "gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_elasticsearch_read_only", + "legendFormat": "", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "0": { "text": "Normal", "color": "green", "index": 0 }, + "1": { "text": "Read-only", "color": "red", "index": 1 }, + "-1": { "text": "Unknown", "color": "yellow", "index": 2 } + } + } + ], + "color": { + "mode": "fixed" + }, + "noValue": "N/A" + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "" + }, + "graphMode": "none", + "colorMode": "background", + "textMode": "auto", + "justifyMode": "auto" + } + }, + { + "type": "stat", + "title": "Update Handler Threads", + "id": 7, + "gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_update_handler_threads", + "legendFormat": "", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [], + "color": { + "mode": "thresholds" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + }, + "noValue": "N/A" + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "" + }, + "graphMode": "none", + "colorMode": "background", + "textMode": "auto", + "justifyMode": "auto" + } + }, + { + "type": "row", + "title": "HTTP Requests", + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }, + "id": 10, + "panels": [] + }, + { + "type": "timeseries", + "title": "Request Rate by Endpoint", + "id": 11, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 6 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(musearch_http_requests_total[$__rate_interval])", + "legendFormat": "{{endpoint}} {{method}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "ops", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Error Rate (5xx)", + "id": 12, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 6 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(musearch_http_requests_total{status=~\"5..\"}[$__rate_interval])", + "legendFormat": "{{endpoint}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "ops", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Request Duration p50", + "id": 13, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 14 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "histogram_quantile(0.50, sum(rate(musearch_http_request_duration_seconds_bucket[$__rate_interval])) by (le, endpoint))", + "legendFormat": "{{endpoint}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "s", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Request Duration p95", + "id": 14, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 14 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "histogram_quantile(0.95, sum(rate(musearch_http_request_duration_seconds_bucket[$__rate_interval])) by (le, endpoint))", + "legendFormat": "{{endpoint}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "s", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "row", + "title": "Indexes", + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 22 }, + "id": 20, + "panels": [] + }, + { + "type": "timeseries", + "title": "Indexes by Type and Status", + "id": 21, + "gridPos": { "h": 8, "w": 10, "x": 0, "y": 23 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_indexes_total", + "legendFormat": "{{type}} ({{status}})", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "short", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Documents by Type", + "id": 22, + "gridPos": { "h": 8, "w": 10, "x": 10, "y": 23 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_indexes_documents_total", + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "short", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "stat", + "title": "Eager Indexes", + "id": 23, + "gridPos": { "h": 8, "w": 4, "x": 20, "y": 23 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_indexes_eager_total", + "legendFormat": "", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [], + "color": { + "mode": "thresholds" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + }, + "noValue": "N/A" + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": ["lastNotNull"], + "fields": "" + }, + "graphMode": "area", + "colorMode": "background", + "textMode": "auto", + "justifyMode": "auto" + } + }, + { + "type": "row", + "title": "Queues & Deltas", + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 31 }, + "id": 30, + "panels": [] + }, + { + "type": "timeseries", + "title": "Update Queue Size", + "id": 31, + "gridPos": { "h": 8, "w": 6, "x": 0, "y": 32 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_update_queue_size", + "legendFormat": "Update queue", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "short", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Delta Queue Size", + "id": 32, + "gridPos": { "h": 8, "w": 6, "x": 6, "y": 32 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_delta_queue_size", + "legendFormat": "Delta queue", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "short", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Deltas Received Rate", + "id": 33, + "gridPos": { "h": 8, "w": 6, "x": 12, "y": 32 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(musearch_deltas_received_total[$__rate_interval])", + "legendFormat": "Deltas received", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "ops", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "Updates Processed Rate", + "id": 34, + "gridPos": { "h": 8, "w": 6, "x": 18, "y": 32 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(musearch_updates_processed_total[$__rate_interval])", + "legendFormat": "Updates processed", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "ops", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "row", + "title": "Connection Pools", + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 40 }, + "id": 40, + "panels": [] + }, + { + "type": "timeseries", + "title": "ES Pool: Available vs Total", + "id": 41, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 41 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_elasticsearch_pool_available", + "legendFormat": "Available", + "refId": "A" + }, + { + "expr": "musearch_elasticsearch_pool_size", + "legendFormat": "Total", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "short", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + }, + { + "type": "timeseries", + "title": "SPARQL Pool: Available vs Total", + "id": 42, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 41 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "musearch_sparql_pool_available", + "legendFormat": "Available", + "refId": "A" + }, + { + "expr": "musearch_sparql_pool_size", + "legendFormat": "Total", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 15, + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "mode": "none", "group": "A" }, + "axisPlacement": "auto", + "scaleDistribution": { "type": "linear" }, + "hideFrom": { "tooltip": false, "viz": false, "legend": false }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "short", + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { + "displayMode": "table", + "placement": "bottom", + "calcs": ["mean", "max"] + } + } + } + ], + "templating": { + "list": [] + }, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { "type": "grafana", "uid": "-- Grafana --" }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "links": [], + "liveNow": false, + "fiscalYearStartMonth": 0, + "weekStart": "" +} diff --git a/config/grafana/dashboards/sparql-parser.json b/config/grafana/dashboards/sparql-parser.json new file mode 100644 index 0000000..200d6e2 --- /dev/null +++ b/config/grafana/dashboards/sparql-parser.json @@ -0,0 +1,553 @@ +{ + "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": 1, + "id": null, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, + "id": 100, + "title": "Worker pool", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "blue", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 }, + "id": 1, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Total workers", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_total", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 }, + "id": 2, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Workers running", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_running", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 1 }, + { "color": "red", "value": 3 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 }, + "id": 3, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Workers idle", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_idle", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "red", "value": 1 } + ] + }, + "noValue": "0" + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 }, + "id": 4, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Workers decommissioned", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_decommissioned", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 5 }, + "id": 10, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Worker states over time", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_running", + "legendFormat": "running", + "refId": "A" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_idle", + "legendFormat": "idle", + "refId": "B" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_workers_decommissioned", + "legendFormat": "decommissioned", + "refId": "C" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 5 }, + "id": 11, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Worker utilization", + "description": "Ratio of busy workers (total - idle) to total workers", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "(sparqlparser_workers_total - sparqlparser_workers_idle) / sparqlparser_workers_total", + "legendFormat": "utilization", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "percentunit", + "min": 0, + "max": 1, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 0.7 }, + { "color": "red", "value": 0.9 } + ] + } + }, + "overrides": [] + } + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 13 }, + "id": 101, + "title": "Request queues", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 10 }, + { "color": "red", "value": 50 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 6, "x": 0, "y": 14 }, + "id": 20, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Total queue depth", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_queue_size", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 5 }, + { "color": "red", "value": 25 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 6, "x": 6, "y": 14 }, + "id": 21, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Waiting queue", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_waiting_queue_size", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 14 }, + "id": 22, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Queue depth over time", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_queue_size", + "legendFormat": "total queue", + "refId": "A" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_waiting_queue_size", + "legendFormat": "waiting", + "refId": "B" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 22 }, + "id": 102, + "title": "Update sequencer", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 10 }, + { "color": "red", "value": 50 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 6, "x": 0, "y": 23 }, + "id": 30, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "auto" + }, + "title": "Pending updates", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_update_sequencer_count", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "normal" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 18, "x": 6, "y": 23 }, + "id": 31, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Update sequencer states over time", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_update_sequencer_initialized", + "legendFormat": "initialized", + "refId": "A" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_update_sequencer_waiting", + "legendFormat": "waiting", + "refId": "B" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_update_sequencer_running", + "legendFormat": "running", + "refId": "C" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_update_sequencer_finished", + "legendFormat": "finished", + "refId": "D" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" } + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 31 }, + "id": 32, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "title": "Update sequencer total count", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "sparqlparser_update_sequencer_count", + "legendFormat": "pending updates", + "refId": "A" + } + ] + } + ], + "refresh": "30s", + "schemaVersion": 38, + "tags": ["sparql-parser", "semantic-works"], + "templating": { "list": [] }, + "time": { "from": "now-1h", "to": "now" }, + "timepicker": {}, + "timezone": "", + "title": "SPARQL Parser", + "uid": "sparql-parser", + "version": 1 +} diff --git a/config/grafana/provisioning/dashboards/default.yml b/config/grafana/provisioning/dashboards/default.yml new file mode 100644 index 0000000..1987ab9 --- /dev/null +++ b/config/grafana/provisioning/dashboards/default.yml @@ -0,0 +1,14 @@ +apiVersion: 1 + +providers: + - name: 'default' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: true + allowUiUpdates: true + updateIntervalSeconds: 60 + options: + path: /var/lib/grafana/dashboards + foldersFromFilesStructure: false diff --git a/config/grafana/provisioning/datasources/prometheus.yml b/config/grafana/provisioning/datasources/prometheus.yml new file mode 100644 index 0000000..737c1cd --- /dev/null +++ b/config/grafana/provisioning/datasources/prometheus.yml @@ -0,0 +1,10 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + access: proxy + url: http://prometheus:9090 + uid: prometheus + isDefault: true + editable: true diff --git a/config/json-exporter/config.yml b/config/json-exporter/config.yml new file mode 100644 index 0000000..1f1ee2e --- /dev/null +++ b/config/json-exporter/config.yml @@ -0,0 +1,41 @@ +modules: + sparql_parser: + metrics: + # Worker pool + - name: sparqlparser_workers_total + path: "{ .amount-of-workers }" + help: "Total number of worker threads" + - name: sparqlparser_workers_idle + path: "{ .workers-without-work }" + help: "Workers with empty queues" + - name: sparqlparser_workers_running + path: "{ .worker-states.RUNNING }" + help: "Workers in RUNNING state" + - name: sparqlparser_workers_decommissioned + path: "{ .worker-states.DECOMMISSIONED }" + help: "Workers in DECOMMISSIONED state" + + # Request queues + - name: sparqlparser_queue_size + path: "{ .total-queue }" + help: "Total jobs across all worker queues" + - name: sparqlparser_waiting_queue_size + path: "{ .total-waiting-queue }" + help: "Jobs queued but not yet executing" + + # Update sequencer (SPARQL INSERT/DELETE pipeline) + - name: sparqlparser_update_sequencer_count + path: "{ .update-sequencer-count }" + help: "Total pending SPARQL update operations" + - name: sparqlparser_update_sequencer_initialized + path: "{ .update-sequencer-states.INITIALIZED }" + help: "Update operations in INITIALIZED state" + - name: sparqlparser_update_sequencer_waiting + path: "{ .update-sequencer-states.WAITING }" + help: "Update operations in WAITING state" + - name: sparqlparser_update_sequencer_running + path: "{ .update-sequencer-states.RUNNING }" + help: "Update operations in RUNNING state" + - name: sparqlparser_update_sequencer_finished + path: "{ .update-sequencer-states.FINISHED }" + help: "Update operations in FINISHED state" diff --git a/config/prometheus/prometheus.yml b/config/prometheus/prometheus.yml new file mode 100644 index 0000000..7a63c03 --- /dev/null +++ b/config/prometheus/prometheus.yml @@ -0,0 +1,30 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: 'delta-notifier' + metrics_path: '/metrics' + static_configs: + - targets: ['delta-notifier:80'] + + # Uncomment if your project includes mu-search + # - job_name: 'mu-search' + # metrics_path: '/metrics' + # static_configs: + # - targets: ['search:80'] + + - job_name: 'sparql-parser' + metrics_path: /probe + params: + module: [sparql_parser] + static_configs: + - targets: + - http://database:8890/recovery-status + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: json-exporter:7979 diff --git a/docker-compose.monitoring.yml b/docker-compose.monitoring.yml new file mode 100644 index 0000000..26458f5 --- /dev/null +++ b/docker-compose.monitoring.yml @@ -0,0 +1,48 @@ +x-logging: + &default-logging + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + +services: + json-exporter: + image: prometheuscommunity/json-exporter:v0.6.0 + volumes: + - ./config/json-exporter/config.yml:/config.yml + command: ["--config.file=/config.yml"] + labels: + - "logging=true" + logging: *default-logging + + prometheus: + image: prom/prometheus:v2.53.0 + volumes: + - ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - prometheus-data:/prometheus + labels: + - "logging=true" + logging: *default-logging + + grafana: + image: grafana/grafana:11.1.0 + environment: + # CHANGE THIS: set a secure admin password before deploying + - GF_SECURITY_ADMIN_PASSWORD=changeme + # Anonymous access: allows viewing dashboards without logging in. + # Anyone who can reach the Grafana port gets read-only access to all + # dashboards. Disable this (set to false) if Grafana is exposed to + # untrusted networks or the internet. + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer + volumes: + - ./config/grafana/provisioning:/etc/grafana/provisioning + - ./config/grafana/dashboards:/var/lib/grafana/dashboards + - grafana-data:/var/lib/grafana + labels: + - "logging=true" + logging: *default-logging + +volumes: + prometheus-data: + grafana-data: