Skip to content

Monitoring

Vitas Spokas edited this page Apr 28, 2025 · 11 revisions

Monitoring Options

Local Prometheus Metrics

To expose metrics via a local HTTP endpoint for Prometheus scraping:

  1. Set the environment variable ENABLE_METRICS_SERVER=true
  2. Access metrics at http://your-feeder-host:9090/metrics
  3. (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.

Remote Pushgateway Metrics

For pushing metrics to a central Prometheus Pushgateway:

  1. Set PUSHGATEWAY_URL, PUSHGATEWAY_USER, and PUSHGATEWAY_PASSWORD environment variables
  2. Metrics will be automatically pushed every 30 seconds

Available Metrics

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.

Clone this wiki locally