diff --git a/stack_orchestrator/data/compose/docker-compose-graph-node.yml b/stack_orchestrator/data/compose/docker-compose-graph-node.yml index 429366ac..023fe03b 100644 --- a/stack_orchestrator/data/compose/docker-compose-graph-node.yml +++ b/stack_orchestrator/data/compose/docker-compose-graph-node.yml @@ -32,6 +32,7 @@ services: - "8001" - "8020" - "8030" + - "8040" healthcheck: test: ["CMD", "nc", "-vz", "localhost", "8020"] interval: 30s diff --git a/stack_orchestrator/data/config/monitoring/grafana/dashboards/subgraphs-dashboard.json b/stack_orchestrator/data/config/monitoring/grafana/dashboards/subgraphs-dashboard.json index 8a600b5e..a268fe5f 100644 --- a/stack_orchestrator/data/config/monitoring/grafana/dashboards/subgraphs-dashboard.json +++ b/stack_orchestrator/data/config/monitoring/grafana/dashboards/subgraphs-dashboard.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 11, + "id": 6, "links": [], "liveNow": false, "panels": [ @@ -49,7 +49,7 @@ }, "gridPos": { "h": 4, - "w": 6, + "w": 4, "x": 0, "y": 0 }, @@ -89,7 +89,7 @@ "useBackend": false } ], - "title": "Deployment Head", + "title": "Latest indexed block", "type": "stat" }, { @@ -118,9 +118,9 @@ "overrides": [] }, "gridPos": { - "h": 4, - "w": 6, - "x": 6, + "h": 2, + "w": 4, + "x": 4, "y": 0 }, "id": 25, @@ -159,7 +159,76 @@ "useBackend": false } ], - "title": "Upstream Chain Head", + "title": "Graph Node Head", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Chain head from an external public endpoint", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "shades" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 0 + }, + "id": 12, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.2.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "latest_block_number{job=\"chain_heads\", chain=\"filecoin\"}", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "External head (filecoin)", "type": "stat" }, { @@ -180,7 +249,7 @@ "fill": 7, "fillGradient": 0, "gridPos": { - "h": 8, + "h": 7, "w": 12, "x": 12, "y": 0 @@ -263,6 +332,76 @@ "align": false } }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Block number of the latest block currently present in the chain head cache", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "shades" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 4, + "y": 2 + }, + "id": 63, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.2.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "chain_head_cache_latest_block", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Chain Cache Latest", + "type": "stat" + }, { "datasource": { "type": "prometheus", @@ -314,8 +453,8 @@ "overrides": [] }, "gridPos": { - "h": 4, - "w": 6, + "h": 3, + "w": 4, "x": 0, "y": 4 }, @@ -362,12 +501,12 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "description": "Block number of the latest block currently present in the chain head cache", + "description": "", "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", - "mode": "shades" + "mode": "thresholds" }, "mappings": [], "thresholds": { @@ -376,6 +515,14 @@ { "color": "green", "value": null + }, + { + "color": "orange", + "value": 8 + }, + { + "color": "red", + "value": 16 } ] } @@ -383,14 +530,14 @@ "overrides": [] }, "gridPos": { - "h": 4, - "w": 6, - "x": 6, + "h": 3, + "w": 4, + "x": 4, "y": 4 }, - "id": 63, + "id": 22, "options": { - "colorMode": "background", + "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", @@ -401,6 +548,9 @@ "fields": "", "values": false }, + "text": { + "valueSize": 25 + }, "textMode": "auto", "wideLayout": true }, @@ -412,20 +562,268 @@ "uid": "PBFA97CFB590B2093" }, "disableTextWrap": false, - "editorMode": "builder", - "expr": "chain_head_cache_latest_block", + "editorMode": "code", + "expr": "deployment_head{deployment=~\"$subgraph_hash\"}", "fullMetaSearch": false, - "hide": false, "includeNullMetadata": true, "instant": false, - "legendFormat": "__auto", + "legendFormat": "{{__name__}}", "range": true, - "refId": "B", + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "ethereum_chain_head_number", + "hide": false, + "instant": false, + "legendFormat": "{{__name__}}", + "range": true, + "refId": "B" + } + ], + "title": "Diff node head", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "", + "binary": { + "left": "ethereum_chain_head_number", + "operator": "-", + "right": "deployment_head" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 8 + }, + { + "color": "red", + "value": 16 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 8, + "y": 4 + }, + "id": 24, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": { + "valueSize": 25 + }, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.2.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "deployment_head{deployment=~\"$subgraph_hash\"}", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "{{__name__}}", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "latest_block_number{job=\"chain_heads\", chain=\"filecoin\"}", + "hide": false, + "instant": false, + "legendFormat": "{{__name__}}", + "range": true, + "refId": "B" + } + ], + "title": "Diff external", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "", + "binary": { + "left": "latest_block_number", + "operator": "-", + "right": "deployment_head" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 7, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 34, + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "max": true, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.2.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/value/", + "color": "#FFB357" + }, + {} + ], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "exemplar": false, + "expr": "deployment_block_processing_duration_sum{deployment=\"$subgraph_hash\"}", + "format": "time_series", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": " ", + "range": true, + "refId": "A", "useBackend": false } ], - "title": "Chain Cache Latest", - "type": "stat" + "thresholds": [], + "timeRegions": [], + "title": "Block Processing Duration", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } }, { "datasource": { @@ -487,7 +885,7 @@ "h": 7, "w": 12, "x": 0, - "y": 8 + "y": 14 }, "id": 28, "options": { @@ -586,7 +984,7 @@ "h": 7, "w": 12, "x": 12, - "y": 8 + "y": 14 }, "id": 64, "options": { @@ -624,113 +1022,6 @@ ], "title": "ETH RPC failed requests rate", "type": "timeseries" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 7, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 15 - }, - "hiddenSeries": false, - "id": 34, - "legend": { - "alignAsTable": false, - "avg": true, - "current": false, - "max": true, - "min": false, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.2.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/value/", - "color": "#FFB357" - }, - {} - ], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "builder", - "exemplar": false, - "expr": "deployment_block_processing_duration_sum{deployment=\"$subgraph_hash\"}", - "format": "time_series", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": " ", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Block Processing Duration", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } } ], "refresh": "10s", @@ -794,6 +1085,6 @@ "timezone": "", "title": "Graph Node Subgraphs", "uid": "b54352dd-35f6-4151-97dc-265bab0c67e9", - "version": 6, + "version": 18, "weekStart": "" } \ No newline at end of file diff --git a/stack_orchestrator/data/stacks/graph-node/README.md b/stack_orchestrator/data/stacks/graph-node/README.md index ba87776e..47728ed8 100644 --- a/stack_orchestrator/data/stacks/graph-node/README.md +++ b/stack_orchestrator/data/stacks/graph-node/README.md @@ -43,16 +43,18 @@ customized by editing the "spec" file generated by `laconic-so deploy init`. ``` $ cat graph-node-spec.yml stack: graph-node -ports: - graph-node: - - '8000:8000' - - '8001' - - '8020:8020' - - '8030' - ipfs: - - '8080' - - '4001' - - '5001:5001' +network: + ports: + graph-node: + - '8000:8000' + - '8001' + - '8020:8020' + - '8030' + - '8040' + ipfs: + - '8080' + - '4001' + - '5001:5001' ... ``` @@ -64,7 +66,7 @@ laconic-so --stack graph-node deploy create --spec-file graph-node-spec.yml --de ## Start the stack -Create an env file with the following values to be set before starting the stack: +Update `config.env` file inside deployment directory with the following values before starting the stack: ```bash # Set ETH RPC endpoint the graph node will use @@ -94,7 +96,7 @@ export GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEI # Ref: https://git.vdb.to/cerc-io/graph-node/src/branch/master/docs/environment-variables.md ``` -Example env file: +Example `config.env` file: ```bash export ETH_RPC_HOST=filecoin.chainup.net @@ -107,12 +109,6 @@ export GRAPH_ETHEREUM_REQUEST_RETRIES=5 export GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE=50 ``` -Set the environment variables: - -```bash -source -``` - Deploy the stack: ```bash