macula_metrics_http (macula v4.2.7)
View SourcePrometheus text-format pull endpoint for macula_metrics.
Phase 4.1 — see PLAN_MACULA_NET_PHASE4_1_OBSERVABILITY.md.
Embeds an inets httpd listener that serves a single resource: GET /metrics returns the current snapshot in Prometheus text-exposition format (v0.0.4 / OpenMetrics-compatible).
Defaults bind 127.0.0.1; remote scraping requires an explicit bind address via start_link/1.
Summary
Functions
Returns the actual port the server is listening on (useful when port=0 is passed for tests).
Render the current metric snapshot as Prometheus text format.
Functions
-spec do(#mod{init_data :: term(), data :: term(), socket_type :: term(), socket :: term(), config_db :: term(), method :: term(), absolute_uri :: term(), request_uri :: term(), http_version :: term(), request_line :: term(), parsed_header :: term(), entity_body :: term(), connection :: term()}) -> {proceed, list()}.
-spec port() -> inet:port_number().
Returns the actual port the server is listening on (useful when port=0 is passed for tests).
-spec render() -> iolist().
Render the current metric snapshot as Prometheus text format.
-spec stop() -> ok.