Collects and formats metrics in Prometheus text format.
Gathers data from various sources:
Collects and formats metrics in Prometheus text format. Gathers data from various sources: - Connection tracking (active connections, bytes, packets) - Health checking (backend health status, latency) - DNS resolution (resolution status) - Stats aggregator (totals)
(clear-sources!)Clear all registered data sources.
Clear all registered data sources.
(collect-all)Collect all metrics and format as Prometheus text exposition format.
Returns a string suitable for returning from /metrics endpoint.
Collect all metrics and format as Prometheus text exposition format. Returns a string suitable for returning from /metrics endpoint.
(record-health-latency! proxy-name target-id latency-sec)Record a health check latency observation.
proxy-name: name of the proxy target-id: target identifier (e.g., "10.0.0.1:8080") latency-sec: latency in seconds
Record a health check latency observation. proxy-name: name of the proxy target-id: target identifier (e.g., "10.0.0.1:8080") latency-sec: latency in seconds
(register-sources! sources)Register data source functions for metric collection.
sources is a map with optional keys: :conntrack-fn - (fn [] connections) returns seq of Connection records :health-fn - (fn [] health-status) returns health status for all proxies :stats-fn - (fn [] stats) returns aggregated stats map :dns-fn - (fn [] dns-status) returns DNS status for all proxies :proxies-fn - (fn [] proxies) returns list of proxy configurations
Register data source functions for metric collection. sources is a map with optional keys: :conntrack-fn - (fn [] connections) returns seq of Connection records :health-fn - (fn [] health-status) returns health status for all proxies :stats-fn - (fn [] stats) returns aggregated stats map :dns-fn - (fn [] dns-status) returns DNS status for all proxies :proxies-fn - (fn [] proxies) returns list of proxy configurations
(reset-histograms!)Reset all histogram data.
Reset all histogram data.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |