Skip to content

Instantly share code, notes, and snippets.

@pi0neerpat
Created August 11, 2020 19:45
Show Gist options
  • Save pi0neerpat/b4e2efd11531d3b872455fcaaeb06dd8 to your computer and use it in GitHub Desktop.
Save pi0neerpat/b4e2efd11531d3b872455fcaaeb06dd8 to your computer and use it in GitHub Desktop.
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 4,
"iteration": 1590595997503,
"links": [],
"panels": [
{
"columns": [],
"datasource": "postgres",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "90%",
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 10,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 6,
"desc": true
},
"styles": [
{
"alias": "blocks behind",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 0,
"mappingType": 1,
"pattern": "blocks_behind_network",
"thresholds": [
""
],
"type": "number",
"unit": "none"
},
{
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 1,
"pattern": "lag",
"thresholds": [],
"type": "number",
"unit": "m"
},
{
"alias": "syn",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "synced",
"thresholds": [],
"type": "string",
"unit": "short",
"valueMaps": [
{
"text": "✓",
"value": "true"
},
{
"text": "—",
"value": "false"
}
]
}
],
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- grafana ignore\nselect\n g.name || (case\n when g.pending_version = v.id then ' (P)'\n when g.current_version = v.id then ' (C)'\n else ' (U)' end) as subgraph_name,\n d.id as deployment,\n s.id as schema,\n replace(a.node_id, 'index_node_','') as nodeId,\n d.synced::text,\n n.name as network,\n (n.head_block_number - d.latest_ethereum_block_number) as blocks_behind_network,\n (case when n.name = 'mainnet' then ((n.head_block_number - d.latest_ethereum_block_number)/4)::text\n when n.name = 'rinkeby' then ((n.head_block_number - d.latest_ethereum_block_number)/4)::text\n when n.name = 'kovan' then ((n.head_block_number - d.latest_ethereum_block_number)/15)::text\n when n.name = 'poa-core' then ((n.head_block_number - d.latest_ethereum_block_number)/12)::text\n else 'ø' end) as lag\nfrom subgraphs.subgraph_deployment as d,\n subgraphs.subgraph_deployment_assignment as a,\n subgraphs.subgraph_version as v,\n subgraphs.subgraph as g,\n subgraphs.ethereum_contract_data_source as ds,\n subgraphs.subgraph_manifest m,\n ethereum_networks as n,\n deployment_schemas as s\nwhere g.id = v.subgraph\n and v.id in (g.pending_version, g.current_version)\n and a.id = d.id\n and m.id = d.manifest \n and ds.id = m.data_sources[1]\n and s.subgraph = d.id\n and v.deployment = d.id\n and not d.failed\n and n.name = ds.network\norder by blocks_behind_network desc, subgraph_name;",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Subgraph Block vs. Network Block",
"transform": "table",
"type": "table"
},
{
"columns": [],
"datasource": "postgres",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 10
},
"id": 33,
"pageSize": null,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"alias": "",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": null,
"pattern": "/vid|block_number/",
"type": "number",
"unit": "none"
},
{
"alias": "",
"align": "right",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "/.*/",
"thresholds": [],
"type": "number",
"unit": "none"
}
],
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n vid, block_number, subgraph_id, message, handler\nFROM subgraphs.subgraph_error\nORDER BY vid DESC",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"table": "subgraphs.subgraph_error",
"timeColumn": "time",
"where": []
}
],
"timeFrom": null,
"timeShift": null,
"title": "Fatal errors",
"transform": "table",
"type": "table"
},
{
"columns": [],
"datasource": "postgres",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 18
},
"id": 6,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 1,
"desc": true
},
"styles": [
{
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 0,
"mappingType": 1,
"pattern": "num_assigned",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "select replace(node_id, 'index_node_', '') as nodeId,\n count(*) as num_assigned,\n array_agg(id) as deployments\n from subgraphs.subgraph_deployment_assignment\n group by node_id\n order by node_id asc;\n",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Subgraph Node Assignments",
"transform": "table",
"type": "table"
},
{
"cacheTimeout": null,
"datasource": "postgres",
"fieldConfig": {
"defaults": {
"custom": {
"align": null
},
"mappings": [],
"nullValueMode": "connected",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "name"
},
"properties": [
{
"id": "displayName",
"value": "Network name"
}
]
},
{
"matcher": {
"id": "byName",
"options": "block_number"
},
"properties": [
{
"id": "displayName",
"value": "Block number"
}
]
},
{
"matcher": {
"id": "byName",
"options": "block_hash"
},
"properties": [
{
"id": "displayName",
"value": "Block Hash"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Block number"
},
"properties": [
{
"id": "custom.width",
"value": 101
}
]
},
{
"matcher": {
"id": "byName",
"options": "Network name"
},
"properties": [
{
"id": "custom.width",
"value": 116
}
]
},
{
"matcher": {
"id": "byName",
"options": "Block Hash"
},
"properties": [
{
"id": "custom.width",
"value": 396
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 25
},
"id": 2,
"interval": "10s",
"links": [],
"maxDataPoints": 100,
"options": {
"showHeader": true,
"sortBy": []
},
"pluginVersion": "7.0.1",
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n name,\n head_block_number AS \"block_number\",\n head_block_hash AS \"block_hash\"\nFROM ethereum_networks\nORDER BY name;",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"table": "ethereum_networks",
"timeColumn": "time",
"where": []
}
],
"timeFrom": null,
"timeShift": null,
"title": "Network Head Blocks",
"type": "table"
},
{
"alert": {
"alertRuleTags": {},
"conditions": [
{
"evaluator": {
"params": [
0
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"A",
"3m",
"now"
]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"executionErrorState": "alerting",
"for": "5m",
"frequency": "1m",
"handler": 1,
"name": "Deployed subgraphs that have not started alert",
"noDataState": "no_data",
"notifications": [
{
"uid": "okc8ZyRZz"
}
]
},
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "postgres",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 25
},
"hiddenSeries": false,
"id": 29,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "select now() as time, count(*) as num_subgraphs\n from (\n select d.id, d.latest_ethereum_block_number block\n from subgraphs.subgraph_deployment d,\n subgraphs.subgraph_deployment_assignment a\n where d.id = a.id\n and not d.failed) a\n where a.block < 100;\n",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"thresholds": [
{
"colorMode": "critical",
"fill": true,
"line": true,
"op": "gt",
"value": 0
}
],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Deployed subgraphs that have not started",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "",
"schemaVersion": 25,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"datasource": "Elasticsearch",
"filters": [],
"hide": 0,
"label": "",
"name": "Filters",
"skipUrlSync": false,
"type": "adhoc"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Indexing Status",
"uid": "7rcuDImZk",
"version": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment