Skip to content

Commit

Permalink
Update watcher dashboard and config templates (#835)
Browse files Browse the repository at this point in the history
Part of [Metrics and logging for GQL queries in watcher](https://www.notion.so/Metrics-and-logging-for-GQL-queries-in-watcher-928c692292b140a2a4f52cda9795df5e)

- Update watcher config templates after config refactoring
- Mount watcher GQL query log files on volumes
- Update watcher dashboard to
  - add a panel to show latest processed block number
  - use latest processed block from sync status for diff values

Co-authored-by: Nabarun <[email protected]>
Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/835
Co-authored-by: Prathamesh Musale <[email protected]>
Co-committed-by: Prathamesh Musale <[email protected]>
  • Loading branch information
2 people authored and ashwin committed Jun 12, 2024
1 parent b80b647 commit 4acb063
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ services:
volumes:
- ../config/watcher-ajna/watcher-config-template.toml:/app/environments/watcher-config-template.toml
- ../config/watcher-ajna/start-server.sh:/app/start-server.sh
- ajna_watcher_gql_logs_data:/app/gql-logs
ports:
- "3008"
- "9001"
Expand All @@ -74,3 +75,4 @@ services:

volumes:
ajna_watcher_db_data:
ajna_watcher_gql_logs_data:
16 changes: 16 additions & 0 deletions stack_orchestrator/data/compose/docker-compose-watcher-azimuth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/azimuth-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/azimuth-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/azimuth-watcher/start-server.sh
- azimuth_watcher_gql_logs_data:/app/packages/azimuth-watcher/gql-logs
ports:
- "3001"
- "9001"
Expand Down Expand Up @@ -136,6 +137,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/censures-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/censures-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/censures-watcher/start-server.sh
- censures_watcher_gql_logs_data:/app/packages/censures-watcher/gql-logs
ports:
- "3002"
- "9003"
Expand Down Expand Up @@ -198,6 +200,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/claims-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/claims-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/claims-watcher/start-server.sh
- claims_watcher_gql_logs_data:/app/packages/claims-watcher/gql-logs
ports:
- "3003"
- "9005"
Expand Down Expand Up @@ -260,6 +263,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/conditional-star-release-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/conditional-star-release-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/conditional-star-release-watcher/start-server.sh
- conditional_star_release_watcher_gql_logs_data:/app/packages/conditional-star-release-watcher/gql-logs
ports:
- "3004"
- "9007"
Expand Down Expand Up @@ -322,6 +326,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/delegated-sending-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/delegated-sending-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/delegated-sending-watcher/start-server.sh
- delegated_sending_watcher_gql_logs_data:/app/packages/delegated-sending-watcher/gql-logs
ports:
- "3005"
- "9009"
Expand Down Expand Up @@ -384,6 +389,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/ecliptic-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/ecliptic-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/ecliptic-watcher/start-server.sh
- ecliptic_watcher_gql_logs_data:/app/packages/ecliptic-watcher/gql-logs
ports:
- "3006"
- "9011"
Expand Down Expand Up @@ -446,6 +452,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/linear-star-release-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/linear-star-release-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/linear-star-release-watcher/start-server.sh
- linear_star_release_watcher_gql_logs_data:/app/packages/linear-star-release-watcher/gql-logs
ports:
- "3007"
- "9013"
Expand Down Expand Up @@ -508,6 +515,7 @@ services:
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/polls-watcher/environments/watcher-config-template.toml
- ../config/watcher-azimuth/merge-toml.js:/app/packages/polls-watcher/merge-toml.js
- ../config/watcher-azimuth/start-server.sh:/app/packages/polls-watcher/start-server.sh
- polls_watcher_gql_logs_data:/app/packages/polls-watcher/gql-logs
ports:
- "3008"
- "9015"
Expand Down Expand Up @@ -560,3 +568,11 @@ services:

volumes:
watcher_db_data:
azimuth_watcher_gql_logs_data:
censures_watcher_gql_logs_data:
claims_watcher_gql_logs_data:
conditional_star_release_watcher_gql_logs_data:
delegated_sending_watcher_gql_logs_data:
ecliptic_watcher_gql_logs_data:
linear_star_release_watcher_gql_logs_data:
polls_watcher_gql_logs_data:
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ services:
volumes:
- ../config/watcher-merkl-sushiswap-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
- ../config/watcher-merkl-sushiswap-v3/start-server.sh:/app/start-server.sh
- merkl_sushiswap_v3_watcher_gql_logs_data:/app/gql-logs
ports:
- "127.0.0.1:3007:3008"
- "9003:9001"
Expand All @@ -74,3 +75,4 @@ services:

volumes:
merkl_sushiswap_v3_watcher_db_data:
merkl_sushiswap_v3_watcher_gql_logs_data:
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ services:
volumes:
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
- ../config/watcher-sushiswap-v3/start-server.sh:/app/start-server.sh
- sushiswap_v3_watcher_gql_logs_data:/app/gql-logs
ports:
- "127.0.0.1:3008:3008"
- "9001:9001"
Expand All @@ -74,3 +75,4 @@ services:

volumes:
sushiswap_v3_watcher_db_data:
sushiswap_v3_watcher_gql_logs_data:
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 4,
"id": 2,
"links": [
{
"asDropdown": false,
Expand Down Expand Up @@ -282,7 +282,7 @@
},
"gridPos": {
"h": 3,
"w": 4,
"w": 3,
"x": 0,
"y": 4
},
Expand All @@ -303,6 +303,75 @@
"wideLayout": true
},
"pluginVersion": "10.2.3",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_processed\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Latest processed block",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "blue",
"mode": "shades"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 3,
"x": 3,
"y": 4
},
"id": 38,
"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": {
Expand Down Expand Up @@ -352,8 +421,8 @@
},
"gridPos": {
"h": 3,
"w": 4,
"x": 4,
"w": 3,
"x": 6,
"y": 4
},
"id": 11,
Expand Down Expand Up @@ -421,8 +490,8 @@
},
"gridPos": {
"h": 3,
"w": 4,
"x": 8,
"w": 3,
"x": 9,
"y": 4
},
"id": 12,
Expand Down Expand Up @@ -639,7 +708,7 @@
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_indexed\"}",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_processed\"}",
"hide": false,
"instant": false,
"legendFormat": "{{__name__}}",
Expand Down Expand Up @@ -750,7 +819,7 @@
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_indexed\"}",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_processed\"}",
"hide": false,
"instant": false,
"legendFormat": "{{__name__}}",
Expand Down Expand Up @@ -936,12 +1005,12 @@
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "last_processed_block_number{job=~\"$job\", instance=~\"$watcher\"}",
"editorMode": "code",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_processed\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "latest_processed",
"legendFormat": "{{kind}}",
"range": true,
"refId": "A",
"useBackend": false
Expand All @@ -952,7 +1021,7 @@
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"editorMode": "code",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_canonical\"}",
"fullMetaSearch": false,
"hide": false,
Expand Down Expand Up @@ -1395,7 +1464,7 @@
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_indexed\"}",
"expr": "sync_status_block_number{job=~\"$job\", instance=~\"$watcher\", kind=\"latest_processed\"}",
"hide": false,
"instant": false,
"legendFormat": "{{__name__}}",
Expand Down Expand Up @@ -3215,6 +3284,6 @@
"timepicker": {},
"timezone": "",
"title": "Watchers",
"version": 4,
"version": 5,
"weekStart": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
host = "0.0.0.0"
port = 3008
kind = "active"
gqlPath = "/"

# Checkpointing state.
checkpointing = true
Expand All @@ -22,23 +21,30 @@
# Interval in number of blocks at which to clear entities cache.
clearEntitiesCacheInterval = 1000

# Max block range for which to return events in eventsInRange GQL query.
# Use -1 for skipping check on block range.
maxEventsBlockRange = 1000

# Flag to specify whether RPC endpoint supports block hash as block tag parameter
rpcSupportsBlockHashParam = false

# GQL cache settings
[server.gqlCache]
enabled = true
# Server GQL config
[server.gql]
path = "/"

# Max block range for which to return events in eventsInRange GQL query.
# Use -1 for skipping check on block range.
maxEventsBlockRange = 1000

# Log directory for GQL requests
logDir = "./gql-logs"

# Max in-memory cache size (in bytes) (default 8 MB)
# maxCacheSize
# GQL cache settings
[server.gql.cache]
enabled = true

# GQL cache-control max-age settings (in seconds)
maxAge = 15
timeTravelMaxAge = 86400 # 1 day
# Max in-memory cache size (in bytes) (default 8 MB)
# maxCacheSize

# GQL cache-control max-age settings (in seconds)
maxAge = 15
timeTravelMaxAge = 86400 # 1 day

[metrics]
host = "0.0.0.0"
Expand Down Expand Up @@ -85,6 +91,9 @@
# Filecoin block time: https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime
blockDelayInMilliSecs = 30000

# Number of blocks by which block processing lags behind head
blockProcessingOffset = 0

# Boolean to switch between modes of processing events when starting the server.
# Setting to true will fetch filtered events and required blocks in a range of blocks and then process them.
# Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[server]
host = "0.0.0.0"
maxSimultaneousRequests = -1
[server.gql]
maxSimultaneousRequests = -1

[metrics]
host = "0.0.0.0"
Expand Down
Loading

0 comments on commit 4acb063

Please sign in to comment.