Adapters¶
Drop-in MetricsHook implementations for popular observability stacks. Each is a no-op until installed via the corresponding optional extra.
Prometheus¶
Install with mneme[prometheus].
PrometheusMetricsHook ¶
Callable hook that emits the documented Prometheus metric series.
Construct with an explicit CollectorRegistry to keep mneme's metrics
isolated from the global default registry (recommended for tests and
multi-tenant exposition).
update_gauges ¶
Refresh the entry-count and memory gauges from a cache.stats()
snapshot. Call from a periodic task or readiness handler.
OpenTelemetry¶
Install with mneme[otel].
OTelMetricsHook ¶
Callable hook that records OpenTelemetry metrics.
Pass an explicit Meter (e.g. from MeterProvider.get_meter(...))
to keep mneme's metrics under a known scope. If omitted, a meter is
obtained from the global MeterProvider.
update_gauges ¶
Refresh entry-count + memory gauges from a cache.stats() snapshot.