symfonic.core.observability.postgres_metrics_store¶
postgres_metrics_store ¶
PostgresMetricsStore — durable :class:MetricsStore on llm_calls (v8.8.0).
Backed by the scaffold-owned Alembic migration 005_llm_calls. Mirrors
postgres_budget_store.py: a framework-agnostic async session factory,
lazy sqlalchemy.text import (core never hard-requires SQLAlchemy at
module load), and best-effort semantics (the :class:BufferedMetricsSink
that wraps this store swallows + logs write failures).
All reads are tenant-scoped by the caller and return the snapshot dict
shape ConversationMetricsCollector.snapshots() emits, so the scaffold's
build_conversation_detail() and response models work unchanged.