Skip to content

Split into backend-agnostic core + per-backend serving packages#60

Open
mtelvers wants to merge 1 commit into
mirage:masterfrom
mtelvers:proto/backend-agnostic
Open

Split into backend-agnostic core + per-backend serving packages#60
mtelvers wants to merge 1 commit into
mirage:masterfrom
mtelvers:proto/backend-agnostic

Conversation

@mtelvers

@mtelvers mtelvers commented Jun 1, 2026

Copy link
Copy Markdown

Recording and collection no longer depend on a concurrency library, so metric-defining libraries depend only on prometheus; an application chooses Lwt or Eio only when it serves metrics.

  • prometheus (core): Lwt-free, direct-style. CollectorRegistry.collect returns a plain snapshot; a collector may perform I/O via effects, handled by whatever scheduler runs collect.
  • prometheus-app: backend-free text-format renderer + GC collectors (no cohttp, no concurrency library).
  • prometheus-cohttp: a /metrics handler functor over cohttp's Cohttp.Generic.Server.S, usable with any cohttp backend.
  • prometheus-lwt (+ .unix): Lwt collectors (register_lwt), an Lwt collect that merges the core's synchronous metrics, Lwt timing helpers, and the cohttp-lwt server + cmdliner + logging.
  • prometheus-eio: direct-style timing helpers and a cohttp-eio handler; async collection needs no special machinery under Eio.

Tests cover the core (incl. an effects-driven collector), the Lwt sync+async merge, and the Eio path under Eio_main. README updated.

Replaces #59.

@mtelvers mtelvers force-pushed the proto/backend-agnostic branch from dfd31d3 to 6fc4251 Compare June 2, 2026 06:51
Recording and collection no longer depend on a concurrency library, so
metric-defining libraries depend only on `prometheus`; an application
chooses Lwt or Eio only when it serves metrics.

- prometheus (core): Lwt-free, direct-style. CollectorRegistry.collect
  returns a plain snapshot; a collector may perform I/O via effects,
  handled by whatever scheduler runs collect. Includes the direct-style
  timing helpers (Gauge.time, track_inprogress, Summary.time).
- prometheus-app: backend-free text-format renderer + GC collectors
  (no cohttp, no concurrency library).
- prometheus-cohttp: a /metrics handler functor over cohttp's
  Cohttp.Generic.Server.S, usable with any cohttp backend.
- prometheus-lwt (+ .unix): Lwt collectors (register_lwt), an Lwt collect
  that merges the core's synchronous metrics, Lwt timing helpers, and the
  cohttp-lwt server + cmdliner + logging.
- prometheus-eio: a cohttp-eio handler; async collection needs no special
  machinery under Eio, and timing reuses the core's direct-style helpers.

Lower bounds are 4.08 for the non-Eio packages and 5.0 for prometheus-eio.
Tests cover the core, the Lwt sync+async merge, and the effects-driven Eio
path under Eio_main. README updated.
@mtelvers mtelvers force-pushed the proto/backend-agnostic branch from 6fc4251 to 794d5cb Compare June 2, 2026 06:59
@dinosaure dinosaure self-assigned this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants