Metrics Endpoint
By default, Graph Node exposes metrics on port 8040:Deployment Metrics
These metrics track the health and performance of individual subgraph deployments.Block Processing
deployment_block_processing_duration
deployment_block_processing_duration
deployment- The deployment hash (IPFS CID)network- The blockchain networkshard- The database shard
- Identify slow-processing deployments
- Detect performance degradation over time
- Compare processing speed across deployments
deployment_trigger_processing_duration
deployment_trigger_processing_duration
deploymentnetworkshard
- Identify bottlenecks in handler execution
- Monitor handler performance after code changes
- Optimize trigger processing logic
deployment_transact_block_operations_duration
deployment_transact_block_operations_duration
deploymentnetworkshard
- Monitor database write performance
- Identify deployments with high entity churn
- Detect database bottlenecks
Trigger and Handler Metrics
deployment_block_trigger_count
deployment_block_trigger_count
deploymentnetworkshard
- Understand trigger density per block
- Correlate trigger count with processing time
- Identify blocks with unusual trigger activity
deployment_handler_execution_time
deployment_handler_execution_time
deploymenthandler- The handler namenetworkshard
- Identify slow handlers
- Optimize specific handler logic
- Track performance impact of handler changes
deployment_host_fn_execution_time
deployment_host_fn_execution_time
deploymenthost_fn- The host function namenetworkshard
- Identify expensive host function calls
- Monitor store operations from handlers
- Detect excessive entity loads or stores
Deployment Health
deployment_head
deployment_head
deploymentnetworkshard
- Monitor sync progress
- Calculate blocks behind chain head
- Alert on stalled indexing
deployment_failed
deployment_failed
deploymentnetworkshard
- Alert on deployment failures
- Track deployment health over time
- Trigger automatic remediation
deployment_reverted_blocks
deployment_reverted_blocks
deploymentnetworkshard
- Monitor chain reorganizations
- Identify frequently reorged deployments
- Correlate reverts with network issues
deployment_sync_secs
deployment_sync_secs
deploymentnetworkshard
- Calculate average sync time
- Monitor sync efficiency
- Estimate time to full sync
deployment_count
deployment_count
- Monitor node capacity
- Track deployment growth
- Plan infrastructure scaling
Blockchain Metrics
Ethereum Chain Head
ethereum_chain_head_number
ethereum_chain_head_number
network- The blockchain network name
- Verify RPC connectivity
- Calculate deployment lag
- Monitor chain sync status
RPC Performance
deployment_eth_rpc_request_duration
deployment_eth_rpc_request_duration
deploymentnetworkmethod- The RPC method called
- Monitor RPC provider performance
- Identify slow RPC methods
- Detect RPC provider issues
deployment_eth_rpc_errors
deployment_eth_rpc_errors
deploymentnetworkmethod
- Alert on RPC failures
- Monitor RPC provider reliability
- Trigger provider failover
eth_rpc_request_duration
eth_rpc_request_duration
networkmethod
- Monitor overall RPC health
- Compare RPC performance across networks
- Benchmark RPC providers
eth_rpc_errors
eth_rpc_errors
networkmethod
- Track RPC reliability
- Alert on widespread RPC issues
- Monitor error rates by method
Query Metrics
These metrics help monitor GraphQL query performance and caching efficiency.Query Execution
query_execution_time
query_execution_time
deploymentquery_id- Hash of the query
- Identify slow queries
- Monitor query performance trends
- Optimize query execution
query_effort_ms
query_effort_ms
- Monitor overall query load
- Detect query performance degradation
- Trigger scaling decisions
query_blocks_behind
query_blocks_behind
- Inform pruning decisions
- Understand query patterns
- Optimize history retention
Query Results
query_result_size
query_result_size
deployment
- Monitor result size distribution
- Identify queries returning large datasets
- Optimize pagination strategies
query_result_max
query_result_max
deployment
- Track largest queries
- Set result size limits
- Prevent resource exhaustion
Caching
query_cache_status_count
query_cache_status_count
deploymentfield- The GraphQL field namestatus-hitormiss
- Monitor cache hit rates
- Identify frequently queried fields
- Optimize caching strategy
Load Management
query_kill_rate
query_kill_rate
- Monitor query overload
- Adjust query timeout settings
- Alert on excessive query cancellations
query_semaphore_wait_ms
query_semaphore_wait_ms
- Monitor database connection contention
- Adjust connection pool size
- Identify query queueing issues
Store Metrics
Metrics related to PostgreSQL database operations.store_connection_checkout_count
store_connection_checkout_count
pool- The connection pool nameshard- The database shard
- Monitor connection pool utilization
- Detect connection leaks
- Size connection pools appropriately
store_connection_wait_time_ms
store_connection_wait_time_ms
poolshard
- Identify connection pool bottlenecks
- Optimize pool configuration
- Alert on connection exhaustion
store_connection_error_count
store_connection_error_count
poolshard
- Monitor database connectivity
- Alert on connection failures
- Detect database issues
System Metrics
registered_metrics
registered_metrics
- Monitor metric system health
- Detect metric registration leaks
- Track metric growth over time
metrics_register_errors
metrics_register_errors
- Detect metric registration issues
- Alert on metrics system problems
metrics_unregister_errors
metrics_unregister_errors
- Monitor metric cleanup issues
- Detect metric lifecycle problems
Monitoring Setup
Prometheus Configuration
Add Graph Node to yourprometheus.yml:
Grafana Dashboard Setup
Alert Examples
Deployment Health Alerts
Deployment is falling behind
Deployment is falling behind
Deployment has failed
Deployment has failed
High RPC error rate
High RPC error rate
Query Performance Alerts
Slow query performance
Slow query performance
High query kill rate
High query kill rate
Database Alerts
Connection pool exhaustion
Connection pool exhaustion
High connection wait time
High connection wait time
Best Practices
Monitor deployment lag consistently
Monitor deployment lag consistently
ethereum_chain_head_number - deployment_head to ensure deployments stay synchronized with the blockchain.Set up alerts for critical metrics
Set up alerts for critical metrics
Use recording rules for complex queries
Use recording rules for complex queries
Track query patterns
Track query patterns
query_cache_status_count and query_blocks_behind to optimize caching and pruning strategies.Correlate metrics across layers
Correlate metrics across layers
Monitor resource utilization
Monitor resource utilization
Establish baselines
Establish baselines
Troubleshooting with Metrics
Slow Indexing
Poor Query Performance
Additional Resources
- Graphman CLI - Management commands
- Maintenance Operations - Deployment management
- Pruning Guide - Optimize storage
- Configuration - Graph Node configuration

