/** * Prometheus-style counters + histograms for `email.send`. Exposes a * `.expose()` helper that produces plaintext in the Prometheus * exposition format — hand this to a `/metrics` endpoint in any * framework. * * OTLP export is covered by the existing `withTelemetry` middleware. * * @module */ import type { Middleware } from "../types.mjs"; export interface MetricsRegistry { readonly sends: number; readonly errors: Record; readonly durationsMs: number[]; incSend: (driver: string) => void; incError: (driver: string, code: string) => void; observeDuration: (driver: string, ms: number) => void; expose: () => string; } export declare function createMetricsRegistry(): MetricsRegistry; export interface MetricsMiddlewareOptions { registry: MetricsRegistry; now?: () => number; } /** Middleware that records counters + durations into a registry. */ export declare function withMetrics(options: MetricsMiddlewareOptions): Middleware;