Overview
The Erst daemon exposes Prometheus metrics at the/metrics endpoint when running in daemon mode. These metrics track the health and performance of remote Stellar nodes (Horizon and Soroban RPC endpoints) used during simulation operations.
Accessing metrics
Start the daemon with:Available metrics
remote_node_last_response_timestamp_seconds
Type: Gauge Description: Unix timestamp (in seconds) of the last successful simulation response from a remote node. Labels:node_address: The RPC URL or identifier of the remote node (e.g.,https://soroban-testnet.stellar.org)network: The Stellar network (testnet,mainnet,futurenet)
Example queries
Alert when no response received in 60 seconds:remote_node_response_total
Type: Counter Description: Total number of simulation responses from remote nodes, labeled by status. Labels:node_address: The RPC URL or identifier of the remote nodenetwork: The Stellar network (testnet,mainnet,futurenet)status: Response status (success,error)
Example queries
Alert when error rate exceeds 10% over 5 minutes:remote_node_response_duration_seconds
Type: Histogram Description: Duration of simulation requests to remote nodes in seconds. Labels:node_address: The RPC URL or identifier of the remote nodenetwork: The Stellar network (testnet,mainnet,futurenet)
[0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]
Purpose: Identify performance degradation or latency issues with remote nodes.
Example queries
Alert when p95 latency exceeds 5 seconds:simulation_execution_total
Type: Counter Description: Total number of simulation executions, regardless of remote node involvement. Labels:status: Execution status (success,error)
Example queries
Alert when simulation error rate exceeds 5%:Prometheus configuration
Add the Erst daemon as a scrape target in yourprometheus.yml:
Alerting rules
Example Prometheus alerting rules for remote node health:Grafana dashboard
Example Grafana dashboard panels:Node staleness panel
Error rate panel
Latency panel
Testing metrics
Manual verification
1
Start the daemon
2
Trigger simulations
Execute some simulations via RPC calls or CLI commands.
3
Check metrics
4
Verify timestamp updates
5
Test staleness detection
Stop simulations and observe that the timestamp remains constant while
time() - timestamp increases.Expected metric output
Implementation details
The metrics are automatically recorded at the following points:Remote node responses
Remote node responses
Metrics are recorded in
internal/rpc/client.go for:GetTransactioncalls to HorizonGetLedgerEntriescalls to Soroban RPC- Other RPC methods that interact with remote nodes
Simulation executions
Simulation executions
Metrics are recorded in
internal/simulator/runner.go for every simulation run.Timestamp updates
Timestamp updates
The
remote_node_last_response_timestamp_seconds gauge is only updated on successful responses, ensuring it accurately reflects the last time the node was healthy.Troubleshooting
Metrics not appearing
Metrics not appearing
- Verify the daemon is running:
curl http://localhost:8080/health - Check the metrics endpoint:
curl http://localhost:8080/metrics - Ensure simulations are being executed (metrics won’t appear until first use)
Timestamp not updating
Timestamp not updating
- Verify simulations are succeeding (check logs)
- Confirm the node is responding successfully
- Check for errors in the daemon logs
High error rates
High error rates
- Check network connectivity to remote nodes
- Verify the remote node URLs are correct
- Check if the remote nodes are experiencing issues
- Review daemon logs for specific error messages
Metrics are exposed in Prometheus exposition format and are compatible with any Prometheus-compatible monitoring system.