Expand description
Metrics module for the application.
- This module contains the global Prometheus registry.
- Defines specific metrics for the application.
Modules§
- server
- Metrics server module
Structs§
- AVAILABLE_
MEMORY - Gauge for available memory in bytes.
- CONTRACTS_
MONITORED - Gauge for total number of contracts being monitored (across all monitors).
- CPU_
USAGE - Gauge for CPU usage percentage.
- DISK_
USAGE - Gauge for used disk space in bytes.
- DISK_
USAGE_ PERCENT - Gauge for disk usage percentage.
- MEMORY_
USAGE - Gauge for memory usage in bytes.
- MEMORY_
USAGE_ PERCENT - Gauge for memory usage percentage.
- MONITORS_
ACTIVE - Gauge for number of active monitors (not paused).
- MONITORS_
TOTAL - Gauge for total number of monitors (active and paused).
- NETWORKS_
MONITORED - Gauge for total number of networks being monitored.
- NETWORK_
MONITORS - Gauge Vector for per-network metrics.
- REGISTRY
- Global Prometheus registry.
- RPC_
ENDPOINT_ ROTATIONS_ TOTAL - Counter for RPC endpoint rotations.
- RPC_
RATE_ LIMITS_ TOTAL - Counter for RPC rate limit responses (HTTP 429).
- RPC_
REQUESTS_ TOTAL - Counter for total RPC requests.
- RPC_
REQUEST_ DURATION_ SECONDS - Histogram for RPC request duration.
- RPC_
REQUEST_ ERRORS_ TOTAL - Counter for RPC request errors.
- TOTAL_
MEMORY - Gauge for total memory in bytes.
- TRIGGERS_
TOTAL - Gauge for total number of triggers.
Functions§
- gather_
metrics - Gather all metrics and encode into the provided format.
- init_
rpc_ metrics_ for_ network - Initializes RPC metrics for a network so they appear in Prometheus output with 0 values.
- observe_
rpc_ duration - Observes the duration of an RPC request.
- record_
endpoint_ rotation - Records an RPC endpoint rotation event.
- record_
rate_ limit - Records an RPC rate limit response (HTTP 429).
- record_
rpc_ error - Records an RPC request error.
- record_
rpc_ request - Records an RPC request.
- update_
monitoring_ metrics - Updates metrics related to monitors, triggers, networks, and contracts.
- update_
system_ metrics - Updates the system metrics for CPU and memory usage.