Skip to content

observability: d2bd has no live /metrics serving path; add a scrape-able SOCK_STREAM metrics socket (Phase 6 follow-up) #593

Description

@vicondoa

d2bd records broker_request_total and other counters into an in-process Prometheus registry (packages/d2bd/src/metrics.rs record_broker_request), but there is no live serving path a scraper can reach (verified: no metrics.sock/metrics listener in packages/d2bd; no prometheus.scrape wiring in nixos-modules/components/observability). The R8 attempt to multiplex /metrics through the public SOCK_SEQPACKET socket was reverted (commit 7dc401b) because Prometheus speaks SOCK_STREAM and fails with EPROTOTYPE.

The design is recorded in TODO.md's 'Scrapable /metrics endpoint' entry: a dedicated SOCK_STREAM AF_UNIX socket from d2bd (e.g. /run/d2b/metrics.sock, d2b-launchers group ACL) with prometheus.scrape config in the observability components.

Acceptance criteria:

  • A metrics socket exists after daemon start and curl --unix-socket /run/d2b/metrics.sock http://localhost/metrics returns the registry including broker_request_total.
  • The socket is bound to d2b-launchers with the documented ACL.
  • The observability example config scrapes it.
  • The Phase-6 tracker row is closed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogBacklog — not tied to a specific releaseenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions