wms.metrics#

Prometheus metrics definitions module.

The metrics are grouped in dataclasses by service. They can be namespaced and are prefixed by default with the app and service names to make downstream filtering easier. All metrics are attached to the default prometheus_client.registry.CollectorRegistry.

Module Contents#

Classes#

MonitorMetrics

Collection of metrics for the monitor subsystem.

PersistenceMetrics

Collection of metrics for the persistence subsystem.

class wms.metrics.MonitorMetrics#

Collection of metrics for the monitor subsystem.

request_latency :prometheus_client.Histogram#
request_errors :prometheus_client.Counter#
messages_produced :prometheus_client.Counter#
queue_size :prometheus_client.Gauge#
classmethod build(namespace: str = 'wms', subsystem: str = 'monitor') MonitorMetrics#

Builder function.

property total_request_errors int#

Return the latest value for the counter.

property total_messages_produced int#

Return the latest value for the counter.

property queue_size_value int#

Return the current gauge value.

class wms.metrics.PersistenceMetrics#

Collection of metrics for the persistence subsystem.

messages_consumed :prometheus_client.Counter#
messages_persisted :prometheus_client.Counter#
batch_size_histogram :prometheus_client.Histogram#
batch_duration_histogram :prometheus_client.Histogram#
subscriber_errors :prometheus_client.Counter#
persist_errors :prometheus_client.Counter#
commit_errors :prometheus_client.Counter#
classmethod build(namespace: str = 'wms', subsystem: str = 'writer') PersistenceMetrics#

Builder function.

property total_messages_consumed int#

Return the latest value for the counter.

property total_messages_persisted int#

Return the latest value for the counter.