python_outbox_core.publisher.metrics ==================================== .. py:module:: python_outbox_core.publisher.metrics .. autoapi-nested-parse:: Metrics and observability for outbox publishing. Best Practices Applied: 1. Structured logging (machine-readable) 2. Consistent event naming (outbox.*) 3. Rich context (event_id, type, timing) 4. OpenTelemetry-ready structure References: - Structured logging: https://www.structlog.org/ Classes ------- .. autoapisummary:: python_outbox_core.publisher.metrics.OutboxMetrics Module Contents --------------- .. py:class:: OutboxMetrics(logger: Any = None) Structured logging for outbox operations. Projects can extend this to add Prometheus/StatsD metrics. .. py:attribute:: logger .. py:method:: log_no_events() -> None Log when no events are pending. .. py:method:: log_success(event: Any) -> None Log successful event publication. Args: event: The published IOutboxEvent instance .. py:method:: log_batch_complete(published: int, total: int) -> None Log batch processing completion. Args: published: Number of successfully published events total: Total events in batch .. py:method:: log_batch_started(batch_size: int) -> None Log batch processing start.