Metrics (core.metrics)¶
Registry¶
Meter registry protocol and default implementation.
Provides a pluggable abstraction for recording counters, gauges, and timers. Implementations can export metrics to Prometheus, OpenTelemetry, or any other backend.
The InMemoryRegistry stores all metrics in memory and is
suitable for testing or lightweight use.
- class pyspark_pipeline_framework.core.metrics.registry.MeterRegistry(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for recording application metrics.
Implementations receive metric data from pipeline hooks and can export it to any observability backend.
All methods must be safe to call from multiple threads.
- class pyspark_pipeline_framework.core.metrics.registry.InMemoryRegistry[source]¶
Bases:
objectThread-safe in-memory metrics registry.
Stores counters, gauges, and timer totals/counts in memory. Useful for testing, local debugging, and as the default registry when no external backend is configured.