diff --git a/docker-compose-monitoring.yml b/docker-compose-monitoring.yml index 869274d5..55c864a2 100644 --- a/docker-compose-monitoring.yml +++ b/docker-compose-monitoring.yml @@ -112,6 +112,7 @@ services: env_file: - ./docker/grafana/config.env environment: + GF_SECURITY_DATA_SOURCE_PROXY_WHITELIST: mysql-cl:3306 GF_RENDERING_SERVER_URL: http://renderer:8081/render GF_RENDERING_CALLBACK_URL: http://grafana:3000/ GF_LOG_FILTERS: rendering:debug diff --git a/docker-compose-perf.yml b/docker-compose-perf.yml index dea1484f..2d3b4830 100644 --- a/docker-compose-perf.yml +++ b/docker-compose-perf.yml @@ -642,10 +642,10 @@ services: condition: service_healthy central-handler-position: condition: service_healthy - central-handler-timeout: - condition: service_healthy - central-handler-get: - condition: service_healthy + # central-handler-timeout: + # condition: service_healthy + # central-handler-get: + # condition: service_healthy central-handler-admin: condition: service_healthy networks: diff --git a/docker/grafana/provisioning/dashboards/dashboard-central-ledger-db.json b/docker/grafana/provisioning/dashboards/dashboard-central-ledger-db.json new file mode 100644 index 00000000..4527d28a --- /dev/null +++ b/docker/grafana/provisioning/dashboards/dashboard-central-ledger-db.json @@ -0,0 +1,317 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 11, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": true, + "tags": [], + "targetBlank": true, + "title": "Image render", + "tooltip": "Image Render", + "type": "link", + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=1000&width=2000" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "dataset": "central_ledger", + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(transferId) FROM central_ledger.transferStateChange WHERE transferStateId = 'COMMITTED' AND createdDate between $__timeFrom() AND $__timeTo()", + "refId": "A", + "sql": { + "columns": [ + { + "name": "COUNT", + "parameters": [ + { + "name": "transferStateId", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "name": "transferStateId", + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "transferStateChange" + } + ], + "title": "COMMITED State Changes In DB between time range", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(transferId) FROM central_ledger.transferStateChange WHERE transferStateId != 'COMMITTED' AND createdDate between $__timeFrom() AND $__timeTo()", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Transfer state changes excluding COMMITTED between time range", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "dataset": "performance_schema", + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT table_schema \"DB Name\",\n ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) \"DB Size in MB\" \nFROM information_schema.tables \nGROUP BY table_schema; ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Panel Title", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Central Ledger DB", + "uid": "d17cf1dd-8fbc-4841-a957-214387249f19", + "version": 5, + "weekStart": "" +} diff --git a/docker/sql-cl-init/01_permissions.sql b/docker/sql-cl-init/01_permissions.sql index c9aa03ee..a2f53634 100644 --- a/docker/sql-cl-init/01_permissions.sql +++ b/docker/sql-cl-init/01_permissions.sql @@ -2,7 +2,4 @@ ALTER USER 'central_ledger'@'%' identified WITH mysql_native_password by 'passwo CREATE USER 'exporter'@'%' IDENTIFIED BY 'password'; GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'exporter'@'%'; GRANT SELECT ON performance_schema.* TO 'exporter'@'%'; -CREATE USER 'grafanaReader' IDENTIFIED BY 'password'; -GRANT SELECT ON central_ledger.transferStateChange TO 'grafanaReader'; -GRANT SELECT ON information_schema.TABLES TO 'grafanaReader'; FLUSH PRIVILEGES;