Add dashboard for graph-node subgraphs #832

Merged
ashwin merged 12 commits from deep-stack/stack-orchestrator:ng-graph-node-dashboard into main 2024-06-04 07:21:29 +00:00
8 changed files with 364 additions and 143 deletions
Showing only changes of commit ef07280818 - Show all commits

View File

@ -70,6 +70,17 @@ services:
start_period: 3s
ports:
- "5432"
graph-node-chain-head-exporter:
image: cerc/watcher-ts:local
restart: always
working_dir: /app/packages/cli
environment:
ETH_RPC_ENDPOINT: ${ETH_RPC_ENDPOINT:-http://lotus-node-1:1234/rpc/v1}
command: ["sh", "-c", "yarn export-metrics:chain-heads"]
ports:
- '5000'
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
ipfs-import:

View File

@ -28,15 +28,25 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
chain-head-exporter:
ethereum-chain-head-exporter:
image: cerc/watcher-ts:local
restart: always
working_dir: /app/packages/cli
environment:
ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
FIL_RPC_ENDPOINT: ${CERC_FIL_RPC_ENDPOINT}
ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT:-https://mainnet.infura.io/v3}
ETH_RPC_API_KEY: ${CERC_INFURA_KEY}
PORT: ${CERC_METRICS_PORT}
command: ["sh", "-c", "yarn export-metrics:chain-heads"]
ports:
- '5000'
extra_hosts:
- "host.docker.internal:host-gateway"
filecoin-chain-head-exporter:
image: cerc/watcher-ts:local
restart: always
working_dir: /app/packages/cli
environment:
ETH_RPC_ENDPOINT: ${CERC_FIL_RPC_ENDPOINT:-https://api.node.glif.io/rpc/v1}
command: ["sh", "-c", "yarn export-metrics:chain-heads"]
ports:
- '5000'

View File

@ -48,7 +48,7 @@
"overrides": []
},
"gridPos": {
"h": 4,
"h": 3,
"w": 4,
"x": 0,
"y": 0
@ -97,7 +97,7 @@
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"description": "Block number of the most recent block synced from Ethereum",
"description": "Upstream head from graph-node ETH RPC endpoint",
"fieldConfig": {
"defaults": {
"color": {
@ -118,12 +118,12 @@
"overrides": []
},
"gridPos": {
"h": 2,
"h": 3,
"w": 4,
"x": 4,
"y": 0
},
"id": 25,
"id": 12,
"options": {
"colorMode": "background",
"graphMode": "none",
@ -148,18 +148,17 @@
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "ethereum_chain_head_number",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"filecoin\", instance=\"graph-node\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"refId": "A",
"useBackend": false
}
],
"title": "Graph Node Head",
"title": "Upstream head",
"type": "stat"
},
{
@ -188,12 +187,12 @@
"overrides": []
},
"gridPos": {
"h": 4,
"h": 3,
"w": 4,
"x": 8,
"y": 0
},
"id": 12,
"id": 65,
"options": {
"colorMode": "background",
"graphMode": "none",
@ -218,7 +217,7 @@
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"filecoin\"}",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"filecoin\", instance=\"external\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
@ -249,7 +248,7 @@
"fill": 7,
"fillGradient": 0,
"gridPos": {
"h": 7,
"h": 8,
"w": 12,
"x": 12,
"y": 0
@ -332,6 +331,298 @@
"align": false
}
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"description": "Block number of the most recent block synced from Ethereum",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "blue",
"mode": "shades"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 4,
"x": 0,
"y": 3
},
"id": 25,
"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": "ethereum_chain_head_number",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Graph Node Head",
"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": 2,
"w": 4,
"x": 4,
"y": 3
},
"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\", instance=\"graph-node\"}",
"hide": false,
"instant": false,
"legendFormat": "{{__name__}}",
"range": true,
"refId": "B"
}
],
"title": "diff_upstream",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "",
"binary": {
"left": "latest_block_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": 2,
"w": 4,
"x": 8,
"y": 3
},
"id": 66,
"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\", instance=\"external\"}",
"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"
},
{
"datasource": {
"type": "prometheus",
@ -358,10 +649,10 @@
"overrides": []
},
"gridPos": {
"h": 2,
"h": 3,
"w": 4,
"x": 4,
"y": 2
"y": 5
},
"id": 63,
"options": {
@ -455,8 +746,8 @@
"gridPos": {
"h": 3,
"w": 4,
"x": 0,
"y": 4
"x": 8,
"y": 5
},
"id": 20,
"options": {
@ -530,10 +821,10 @@
"overrides": []
},
"gridPos": {
"h": 3,
"h": 2,
"w": 4,
"x": 4,
"y": 4
"x": 0,
"y": 6
},
"id": 22,
"options": {
@ -586,7 +877,7 @@
"refId": "B"
}
],
"title": "Diff node head",
"title": "diff_node_head",
"transformations": [
{
"id": "calculateField",
@ -607,117 +898,6 @@
],
"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,
@ -739,7 +919,7 @@
"h": 7,
"w": 24,
"x": 0,
"y": 7
"y": 8
},
"hiddenSeries": false,
"id": 34,
@ -885,7 +1065,7 @@
"h": 7,
"w": 12,
"x": 0,
"y": 14
"y": 15
},
"id": 28,
"options": {
@ -984,7 +1164,7 @@
"h": 7,
"w": 12,
"x": 12,
"y": 14
"y": 15
},
"id": 64,
"options": {

View File

@ -251,7 +251,7 @@
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"$target_chain\"}",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"$target_chain\", instance=\"external\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
@ -638,7 +638,7 @@
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"$target_chain\"}",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"$target_chain\", instance=\"external\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
@ -1311,7 +1311,7 @@
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"$target_chain\"}",
"expr": "latest_block_number{job=\"chain_heads\", chain=\"$target_chain\", instance=\"external\"}",
"hide": false,
"instant": false,
"legendFormat": "{{__name__}}",

View File

@ -45,7 +45,19 @@ scrape_configs:
metrics_path: /metrics
scheme: http
static_configs:
- targets: ['chain-head-exporter:5000']
- targets: ['ethereum-chain-head-exporter:5000']
labels:
instance: 'external'
chain: 'ethereum'
- targets: ['filecoin-chain-head-exporter:5000']
labels:
instance: 'external'
chain: 'filecoin'
# # Add graph-node chain-head-exported targets to be monitored below
# - targets: ['graph-node-chain-head-exporter:5000']
# labels:
# instance: 'graph-node'
# chain: 'filecoin'
- job_name: 'postgres'
scrape_interval: 30s

View File

@ -75,6 +75,9 @@ Update `config.env` file inside deployment directory with the following values b
export ETH_RPC_HOST=
export ETH_RPC_PORT=
# RPC endpoint used by graph-node for exposing upstream head as metrics
export ETH_RPC_ENDPOINT=
# The etherum network(s) graph-node will connect to
# Set this to a space-separated list of the networks where each entry has the form NAME:URL
export ETH_NETWORKS=
@ -101,6 +104,7 @@ Example `config.env` file:
```bash
export ETH_RPC_HOST=filecoin.chainup.net
export ETH_RPC_PORT=443
export ETH_RPC_ENDPOINT=https://filecoin.chainup.net
export ETH_NETWORKS=filecoin:https://filecoin.chainup.net/rpc/v1

View File

@ -3,7 +3,10 @@ name: graph-node
description: "Stack for running graph-node"
repos:
- github.com/graphprotocol/graph-node
# TODO: Set latest version
- github.com/cerc-io/watcher-ts
containers:
- cerc/graph-node
- cerc/watcher-ts
pods:
- graph-node

View File

@ -1,7 +1,8 @@
version: "0.1"
name: monitoring
repos:
- github.com/cerc-io/watcher-ts@v0.2.81
# Set latest version
- github.com/cerc-io/watcher-ts
containers:
- cerc/watcher-ts
pods: