MetricsExtension
Defined in: src/metrics/MetricsExtension.ts:25
MetricsExtension — the system.extension(MetricsExtensionId)
accessor that hands back a MetricsRegistry. By default the
extension creates a NoopMetricsRegistry (zero-cost) so framework
instrumentation pays nothing when the user doesn’t enable metrics.
Opt in:
const metrics = system.extension(MetricsExtensionId).enable(); // … or pre-register a custom registry: system.extension(MetricsExtensionId).useRegistry(myCustomRegistry);
After enable(), the same system.extension(MetricsExtensionId)
accessor returns the live DefaultMetricsRegistry; calls
before that return the noop.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MetricsExtension(
_system):MetricsExtension
Defined in: src/metrics/MetricsExtension.ts:28
Parameters
Section titled “Parameters”_system
Section titled “_system”Returns
Section titled “Returns”MetricsExtension
Methods
Section titled “Methods”enable()
Section titled “enable()”enable():
MetricsRegistry
Defined in: src/metrics/MetricsExtension.ts:39
Replace the noop registry with a real one. Returns the live registry so callers can wire counters / gauges immediately. Idempotent — repeated calls return the same instance once a real registry is in place.
Returns
Section titled “Returns”get():
MetricsRegistry
Defined in: src/metrics/MetricsExtension.ts:31
Current registry — noop until enable() has been called.
Returns
Section titled “Returns”isEnabled()
Section titled “isEnabled()”isEnabled():
boolean
Defined in: src/metrics/MetricsExtension.ts:56
True if a real (non-noop) registry is installed.
Returns
Section titled “Returns”boolean
useRegistry()
Section titled “useRegistry()”useRegistry(
registry):void
Defined in: src/metrics/MetricsExtension.ts:51
Plug in a custom registry — useful when you want to share a
single registry across multiple ActorSystems (rare) or to
instrument with a third-party Prom client library directly.
Parameters
Section titled “Parameters”registry
Section titled “registry”Returns
Section titled “Returns”void