Lightning.Channels.PromExPlugin (Lightning v2.19.0-pre)

View Source

PromEx plugin exposing metrics for the Channels HTTP reverse-proxy.

Telemetry is layered into two spans:

  • Outer :inbound span — wraps every /channels/* hit, including probes with invalid UUIDs or unknown channel IDs. Tagged by outcome (:resolved | :invalid_uuid | :unknown_channel) so we can surface edge traffic and scanning behaviour without leaking the raw URL segment into metric labels.
  • Inner :request span — opens only after channel resolution succeeds. Tagged by project_id (a bounded, trusted value), it tracks real proxy operations: how many start, how long they take, and what their outcome is.

Metrics emitted:

  • lightning_channel_proxy_inbound_total{outcome} — counter on the outer span's :stop event. Counts every inbound request, bucketed by outcome.
  • lightning_channel_proxy_requests_started_total{project_id} — counter on the inner span's :start event. Started metadata already carries the resolved project_id, so no separate counted event is needed.
  • lightning_channel_proxy_request_duration_milliseconds{project_id} — distribution of total time spent in the inner span. Its _count series doubles as the finished-request total, so a separate finished counter is not emitted.

Concurrent in-flight requests cannot be derived precisely from these counters — request lifetimes (ms) are far shorter than typical scrape intervals (s), so any started − finished subtraction is ~always zero at scrape boundaries.