Skip to content

Observability

The metrics protocol and shipped backends. For the conceptual model see the Operating in production guide.

Metrics protocol

Bases: Protocol

Three methods, all best-effort, all non-throwing.

Implementations MUST tolerate unknown metric names. Unknown tag keys are also accepted; cardinality discipline is the caller's job.

Backends

Default Metrics implementation. Does nothing.

Three method bodies, each a single return. The runtime is fully functional with NoOpMetrics. Profile-checked for zero allocation pressure under steady load.

Drop-in Metrics implementation backed by prometheus_client.

Instruments are lazy. Tag keys for an instrument are fixed by the first observation; subsequent observations with a different key set raise (prometheus_client behavior). This matches the standard metric list's fixed tag schemas.