diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 17:21:35 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 17:21:35 +0900 |
| commit | 5673b2c42c7a317c775777b1135996b4c3993ef4 (patch) | |
| tree | bc753b925b81f8f6714092de47a32a3ebf78454b /monitoring/grafana | |
| parent | d5f672698004ae05f55e5e1f6a6e62a9cebbd530 (diff) | |
feat(monitoring): add Grafana dashboard provisioning
Diffstat (limited to 'monitoring/grafana')
| -rw-r--r-- | monitoring/grafana/dashboards/trading-overview.json | 297 | ||||
| -rw-r--r-- | monitoring/grafana/provisioning/dashboards/dashboard.yaml | 11 |
2 files changed, 308 insertions, 0 deletions
diff --git a/monitoring/grafana/dashboards/trading-overview.json b/monitoring/grafana/dashboards/trading-overview.json new file mode 100644 index 0000000..ff7f8ff --- /dev/null +++ b/monitoring/grafana/dashboards/trading-overview.json @@ -0,0 +1,297 @@ +{ + "uid": "trading-overview", + "title": "Trading Platform Overview", + "tags": ["trading"], + "timezone": "browser", + "schemaVersion": 39, + "version": 1, + "refresh": "10s", + "time": { + "from": "now-1h", + "to": "now" + }, + "panels": [ + { + "type": "row", + "id": 1, + "title": "Service Health", + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, + "collapsed": false, + "panels": [] + }, + { + "type": "stat", + "id": 2, + "title": "Services Up", + "gridPos": { "h": 6, "w": 12, "x": 0, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "sum(data_collector_up == 1) + sum(strategy_engine_up == 1) + sum(order_executor_up == 1) + sum(portfolio_manager_up == 1)", + "legendFormat": "Services Up", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "red", "value": null }, + { "color": "yellow", "value": 2 }, + { "color": "green", "value": 4 } + ] + }, + "unit": "none", + "min": 0, + "max": 4 + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value", + "graphMode": "none" + } + }, + { + "type": "timeseries", + "id": 3, + "title": "Error Rate", + "gridPos": { "h": 6, "w": 12, "x": 12, "y": 1 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "sum(rate(data_collector_errors_total[5m]))", + "legendFormat": "data-collector", + "refId": "A" + }, + { + "expr": "sum(rate(strategy_engine_errors_total[5m]))", + "legendFormat": "strategy-engine", + "refId": "B" + }, + { + "expr": "sum(rate(order_executor_errors_total[5m]))", + "legendFormat": "order-executor", + "refId": "C" + }, + { + "expr": "sum(rate(portfolio_manager_errors_total[5m]))", + "legendFormat": "portfolio-manager", + "refId": "D" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 10, + "pointSize": 5, + "showPoints": "auto" + }, + "unit": "ops" + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "multi", "sort": "desc" }, + "legend": { "displayMode": "table", "placement": "bottom" } + } + }, + { + "type": "row", + "id": 4, + "title": "Trading Activity", + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 7 }, + "collapsed": false, + "panels": [] + }, + { + "type": "timeseries", + "id": 5, + "title": "Signals Generated", + "gridPos": { "h": 6, "w": 12, "x": 0, "y": 8 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(strategy_engine_events_processed_total[5m])", + "legendFormat": "{{ job }}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 10, + "pointSize": 5, + "showPoints": "auto" + }, + "unit": "ops" + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { "displayMode": "list", "placement": "bottom" } + } + }, + { + "type": "timeseries", + "id": 6, + "title": "Orders Executed", + "gridPos": { "h": 6, "w": 12, "x": 12, "y": 8 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(order_executor_events_processed_total[5m])", + "legendFormat": "{{ job }}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 10, + "pointSize": 5, + "showPoints": "auto" + }, + "unit": "ops" + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { "displayMode": "list", "placement": "bottom" } + } + }, + { + "type": "row", + "id": 7, + "title": "Data Collection", + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 14 }, + "collapsed": false, + "panels": [] + }, + { + "type": "timeseries", + "id": 8, + "title": "Candles Received", + "gridPos": { "h": 6, "w": 12, "x": 0, "y": 15 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "rate(data_collector_events_processed_total[5m])", + "legendFormat": "{{ job }}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "smooth", + "fillOpacity": 10, + "pointSize": 5, + "showPoints": "auto" + }, + "unit": "ops" + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { "displayMode": "list", "placement": "bottom" } + } + }, + { + "type": "timeseries", + "id": 9, + "title": "WebSocket Reconnections", + "gridPos": { "h": 6, "w": 12, "x": 12, "y": 15 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "data_collector_errors_total{error_type=\"reconnect\"}", + "legendFormat": "reconnections", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "stepAfter", + "fillOpacity": 10, + "pointSize": 5, + "showPoints": "auto" + }, + "unit": "short" + }, + "overrides": [] + }, + "options": { + "tooltip": { "mode": "single", "sort": "none" }, + "legend": { "displayMode": "list", "placement": "bottom" } + } + }, + { + "type": "row", + "id": 10, + "title": "Portfolio", + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 21 }, + "collapsed": false, + "panels": [] + }, + { + "type": "gauge", + "id": 11, + "title": "Portfolio Value", + "gridPos": { "h": 6, "w": 12, "x": 0, "y": 22 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "targets": [ + { + "expr": "portfolio_manager_portfolio_value", + "legendFormat": "Portfolio Value", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "red", "value": null }, + { "color": "yellow", "value": 1000 }, + { "color": "green", "value": 10000 } + ] + }, + "unit": "currencyUSD", + "min": 0 + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "orientation": "auto" + } + } + ] +} diff --git a/monitoring/grafana/provisioning/dashboards/dashboard.yaml b/monitoring/grafana/provisioning/dashboards/dashboard.yaml new file mode 100644 index 0000000..2fccc12 --- /dev/null +++ b/monitoring/grafana/provisioning/dashboards/dashboard.yaml @@ -0,0 +1,11 @@ +apiVersion: 1 +providers: + - name: "Trading Platform" + orgId: 1 + folder: "" + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards + foldersFromFilesStructure: false |
