Skip to content

prom-client adapter for MetricsRegistry #64

@pathosDev

Description

@pathosDev

The metrics layer (#11) ships with our own `MetricsRegistry` + `PrometheusExporter`. Many users already have `prom-client` (the de-facto industry-standard Prometheus client for Node) wired up in their app — common case is wanting our framework metrics to show up alongside their existing app metrics in the same registry.

Scope:

  • New file `src/metrics/PromClientAdapter.ts` (peer-dep: `prom-client`).
  • Exports `promClientRegistry(client: prom-client.Registry)` returning our `MetricsRegistry` shape.
  • Methods bridge `Counter` / `Gauge` / `Histogram` to `prom-client`'s equivalents.
  • The registered `prom-client` registry can be exposed via the user's existing `/metrics` endpoint — no extra HTTP server needed.
  • Example: `examples/management/prom-client-shared.ts` showing both framework + app metrics on one endpoint.

Estimate: 1 day.

Out of scope: OpenMetrics-format-only support — `prom-client` already handles both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: lowNice-to-have / niche / demand-driven

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions