This document outlines the monitoring infrastructure for the Stellar-Teye smart contracts, including setup instructions, metrics collection, and alerting runbooks.
The monitoring stack is built on a standard Docker-compose configuration:
- Prometheus: Metrics scraping and long-term time-series storage.
- Alertmanager: Routing alerts triggered by Prometheus rules.
- Grafana: Visualizing metrics and contract health.
- Health Check Script: A bash script (
health_check.sh) designed to periodically ping the Soroban RPC and contract to verify liveness.
- Ensure you have Docker and Docker Compose installed.
- Navigate to the monitor directory:
cd scripts/monitor - Start the monitoring stack in the background:
docker-compose up -d
- Access the services:
- Grafana: http://localhost:3000 (default credentials:
admin/admin) - Prometheus: http://localhost:9090
- Alertmanager: http://localhost:9093
- Grafana: http://localhost:3000 (default credentials:
Grafana is pre-provisioned with the Prometheus datasource and a Contract Health Dashboard.
To track new contract metrics:
- Ensure your exporter application or health script pushes metrics (e.g., via Prometheus Pushgateway) or exposes a
/metricsendpoint. - Update
scripts/monitor/prometheus/prometheus.ymlto scrape the new endpoint. - Update or create new Dashboards in
scripts/monitor/grafana/dashboards.
When Prometheus triggers an alert, Alertmanager routes it based on its severity. Below are the runbooks for the currently configured alerts.
- Severity: Critical
- Description: The Soroban RPC service or health exporter has been unreachable for > 1 minute.
- Impact: Applications cannot read from or deploy to the Stellar network. Users may experience total service failure.
- Action Plan:
- Check the availability of the RPC URL (default
https://rpc-futurenet.stellar.org). - Verify your network connection and DNS resolution.
- If using a local/private RPC node, check its docker container or systemctl status and its logs for
out of memoryor sync errors.
- Check the availability of the RPC URL (default
- Severity: Warning
- Description: More than 5 transaction errors per second over the last 5 minutes.
- Impact: Users are likely failing to execute smart contract calls (e.g. invalid arguments, lacking authorization, or network congestion).
- Action Plan:
- Open the Contract Health Dashboard in Grafana to see the error spikes.
- Check recent contract deployments or DApp frontend updates that might have introduced breaking changes.
- Look at the Soroban CLI logs or application backend logs for specific transaction failure codes (e.g.,
HostError).
- Severity: Warning
- Description: Contract RPC calls are taking longer than 2.0 seconds on average.
- Impact: Degraded user experience. DApp may feel laggy.
- Action Plan:
- Check the Soroban RPC load. If using a public RPC, consider migrating to a dedicated node.
- If using a private node, check host CPU, Memory, and Disk I/O (Stellar nodes can be IOPS-heavy).