Skip to main content

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:
Metrics are available at:

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)
Purpose: This metric enables staleness alerting by tracking when each remote node last successfully responded. The timestamp is only updated on successful responses.

Example queries

Alert when no response received in 60 seconds:
Alert when any node hasn’t responded in 5 minutes:
Alert when testnet nodes are stale:

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 node
  • network: The Stellar network (testnet, mainnet, futurenet)
  • status: Response status (success, error)
Purpose: Track overall node health and error rates over time.

Example queries

Alert when error rate exceeds 10% over 5 minutes:
Total successful responses per node:
Error rate by network:

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 node
  • network: The Stellar network (testnet, mainnet, futurenet)
Buckets: [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:
Average response time per node:
p99 latency by network:

simulation_execution_total

Type: Counter Description: Total number of simulation executions, regardless of remote node involvement. Labels:
  • status: Execution status (success, error)
Purpose: Track overall system throughput and simulation success rate.

Example queries

Alert when simulation error rate exceeds 5%:
Total simulations per minute:

Prometheus configuration

Add the Erst daemon as a scrape target in your prometheus.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:
Metrics are recorded in internal/rpc/client.go for:
  • GetTransaction calls to Horizon
  • GetLedgerEntries calls to Soroban RPC
  • Other RPC methods that interact with remote nodes
Metrics are recorded in internal/simulator/runner.go for every simulation run.
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

  1. Verify the daemon is running: curl http://localhost:8080/health
  2. Check the metrics endpoint: curl http://localhost:8080/metrics
  3. Ensure simulations are being executed (metrics won’t appear until first use)
  1. Verify simulations are succeeding (check logs)
  2. Confirm the node is responding successfully
  3. Check for errors in the daemon logs
  1. Check network connectivity to remote nodes
  2. Verify the remote node URLs are correct
  3. Check if the remote nodes are experiencing issues
  4. Review daemon logs for specific error messages
Metrics are exposed in Prometheus exposition format and are compatible with any Prometheus-compatible monitoring system.