Module metrics

Source
Expand description

Metrics module for the application.

  • This module contains the global Prometheus registry.
  • Defines specific metrics for the application.

Modules§

middleware
This defines the Middleware to collect metrics for the application. This middleware will increment the request counter for each request for each endpoint.

Structs§

AVAILABLE_MEMORY
CPU_USAGE
DISK_USAGE
DISK_USAGE_PERCENT
ERROR_COUNTER
MEMORY_USAGE
MEMORY_USAGE_PERCENT
RAW_REQUEST_COUNTER
REGISTRY
REQUEST_COUNTER
REQUEST_LATENCY
TOTAL_MEMORY

Functions§

gather_metrics
Gather all metrics and encode into the provided format.
update_system_metrics
Updates the system metrics for CPU and memory usage.