Module metrics

Source
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.