-
Notifications
You must be signed in to change notification settings - Fork 3
Monitoring
Vitas Spokas edited this page Apr 28, 2025
·
11 revisions
To expose metrics via a local HTTP endpoint for Prometheus scraping:
- Set the environment variable
ENABLE_METRICS_SERVER=true - Access metrics at
http://your-feeder-host:9090/metrics - (Optional) Change the port by setting
METRICS_PORT=your_port_number(default is 9090)
This exposes detailed metrics about the feeder's performance, including CPU/memory usage, uptime, and oracle update times. Configure your Prometheus server to scrape this endpoint.
For pushing metrics to a central Prometheus Pushgateway:
- Set
PUSHGATEWAY_URL,PUSHGATEWAY_USER, andPUSHGATEWAY_PASSWORDenvironment variables - Metrics will be automatically pushed every 30 seconds
The following metrics are monitored:
| Metric | Type | Description |
|---|---|---|
| feeder_uptime_hours | Gauge | Feeder uptime in hours |
| feeder_cpu_usage_percent | Gauge | CPU usage with rolling average smoothing |
| feeder_memory_usage_megabytes | Gauge | Memory usage in MB |
| feeder_contract_info | Gauge | Contract address being used (as label) |
| feeder_exchange_pairs | Gauge | List of exchange pairs being monitored |
| feeder_pools | Gauge | DEX pools being monitored (scrapers only) |
| feeder_gas_balance | Gauge | Gas wallet balance in native currency |
| feeder_last_update_time | Gauge | Holds the Unix timestamp (in seconds) of the last on-chain event emitted by the feeder contract. |
In prometheus, you can use the feeder_last_update_time to compute minutes since since last update with the following query:
(time() - feeder_last_update_time) / 60
This expression subtracts the stored timestamp from “now” (in seconds) and divides by 60, yielding the number of minutes since the last on-chain update.