Show subgraph names in dashboard
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 45s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m44s
Smoke Test / Run basic test suite (pull_request) Successful in 4m41s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m37s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 9m10s

This commit is contained in:
Nabarun 2024-05-28 15:47:09 +05:30
parent 08c72a51fe
commit 83eeda2529
4 changed files with 75 additions and 14 deletions

View File

@ -743,25 +743,41 @@
"list": [
{
"current": {
"selected": true,
"text": "QmZLNyJ1JmUXUrzvQKtsJSwLoFvE28rsWeb7dAVuZYVKY2",
"value": "QmZLNyJ1JmUXUrzvQKtsJSwLoFvE28rsWeb7dAVuZYVKY2"
"isNone": true,
"selected": false,
"value": ""
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"type": "grafana-postgresql-datasource",
"uid": "PA8D093265C513DCC"
},
"definition": "label_values(deployment_head,deployment)",
"definition": "SELECT name\nFROM subgraphs.subgraph\nWHERE current_version IS NOT NULL;",
"description": "Name of deployed subgraph",
"hide": 0,
"includeAll": false,
"label": "Subgraph Name",
"multi": false,
"name": "subgraph_name",
"options": [],
"query": "SELECT name\nFROM subgraphs.subgraph\nWHERE current_version IS NOT NULL;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
},
{
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "PA8D093265C513DCC"
},
"definition": "SELECT deployment\nFROM subgraphs.subgraph_version\n JOIN subgraphs.subgraph ON subgraph.current_version = subgraph_version.id\nWHERE subgraph.name = '$subgraph_name';",
"hide": 0,
"includeAll": false,
"label": "Subgraph Deployment",
"multi": false,
"name": "subgraph_hash",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(deployment_head,deployment)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"query": "SELECT deployment\nFROM subgraphs.subgraph_version\n JOIN subgraphs.subgraph ON subgraph.current_version = subgraph_version.id\nWHERE subgraph.name = '$subgraph_name';",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@ -778,6 +794,6 @@
"timezone": "",
"title": "Graph Node Subgraphs",
"uid": "b54352dd-35f6-4151-97dc-265bab0c67e9",
"version": 25,
"version": 6,
"weekStart": ""
}

View File

@ -0,0 +1,20 @@
apiVersion: 1
datasources:
- name: Graph Node Postgres
type: postgres
jsonData:
database: graph-node
sslmode: 'disable'
maxOpenConns: 100
maxIdleConns: 100
maxIdleConnsAuto: true
connMaxLifetime: 14400
postgresVersion: 1411 # 903=9.3, 1000=10, 1411=14.11
timescaledb: false
user: graph-node
# # Add URL for graph-node database
# url: graph-node-db:5432
# # Set password for graph-node database
# secureJsonData:
# password: 'slLWVGMUfk5beLkLd8qAqEEUXpE5eRIO'

View File

@ -4,4 +4,6 @@ echo Using CERC_GRAFANA_ALERTS_SUBGRAPH_IDS ${CERC_GRAFANA_ALERTS_SUBGRAPH_IDS}
# Replace subgraph ids in subgraph alerting config
# Note: Requires the grafana container to be run with user root
if [ -n "$CERC_GRAFANA_ALERTS_SUBGRAPH_IDS" ]; then
sed -i "s/REPLACE_WITH_SUBGRAPH_IDS/$CERC_GRAFANA_ALERTS_SUBGRAPH_IDS/g" /etc/grafana/provisioning/alerting/subgraph-alert-rules.yml
fi

View File

@ -134,6 +134,29 @@ Note: Use `host.docker.internal` as host to access ports on the host machine
Place the dashboard json files in grafana dashboards config directory (`monitoring-deployment/config/monitoring/grafana/dashboards`) in the deployment folder
#### Graph Node Config
For graph-node dashboard postgres datasource needs to be setup in `monitoring-deployment/config/monitoring/grafana/provisioning/datasources/graph-node-postgres.yml` (in deployment folder)
```yml
# graph-node-postgres.yml
...
datasources:
- name: Graph Node Postgres
type: postgres
jsonData:
# Set name to remote graph-node database name
database: graph-node
...
# Set user to remote graph-node database username
user: graph-node
# Add URL for remote graph-node database
url: graph-node-db:5432
# Set password for graph-node database
secureJsonData:
password: 'password'
```
### Env
Set the following env variables in the deployment env config file (`monitoring-deployment/config.env`):