feat(production): sync all modified production files to git
Includes updates across gateway, router, node-worker, memory-service, aurora-service, swapper, sofiia-console UI and node2 infrastructure: - gateway-bot: Dockerfile, http_api.py, druid/aistalk prompts, doc_service - services/router: main.py, router-config.yml, fabric_metrics, memory_retrieval, offload_client, prompt_builder - services/node-worker: worker.py, main.py, config.py, fabric_metrics - services/memory-service: Dockerfile, database.py, main.py, requirements - services/aurora-service: main.py (+399), kling.py, quality_report.py - services/swapper-service: main.py, swapper_config_node2.yaml - services/sofiia-console: static/index.html (console UI update) - config: agent_registry, crewai_agents/teams, router_agents - ops/fabric_preflight.sh: updated preflight checks - router-config.yml, docker-compose.node2.yml: infra updates - docs: NODA1-AGENT-ARCHITECTURE, fabric_contract updated Made-with: Cursor
This commit is contained in:
@@ -40,6 +40,31 @@ try:
|
||||
registry=REGISTRY,
|
||||
)
|
||||
|
||||
# ── Voice HA metrics ──────────────────────────────────────────────────────
|
||||
# cap label: "voice_tts" | "voice_llm" | "voice_stt"
|
||||
voice_cap_requests = Counter(
|
||||
"fabric_voice_capability_requests_total",
|
||||
"Voice HA capability routing requests",
|
||||
["cap", "status"], registry=REGISTRY,
|
||||
)
|
||||
voice_offload_total = Counter(
|
||||
"fabric_voice_offload_total",
|
||||
"Voice HA offload attempts (node selected + NATS sent)",
|
||||
["cap", "node", "status"], registry=REGISTRY,
|
||||
)
|
||||
voice_breaker_state = Gauge(
|
||||
"fabric_voice_breaker_state",
|
||||
"Voice HA circuit breaker per node+cap (1=open)",
|
||||
["cap", "node"], registry=REGISTRY,
|
||||
)
|
||||
voice_score_hist = Histogram(
|
||||
"fabric_voice_score_ms",
|
||||
"Voice HA node scoring distribution",
|
||||
["cap"],
|
||||
buckets=[0, 50, 100, 200, 400, 800, 1600, 3200],
|
||||
registry=REGISTRY,
|
||||
)
|
||||
|
||||
except ImportError:
|
||||
PROM_AVAILABLE = False
|
||||
REGISTRY = None
|
||||
@@ -76,6 +101,26 @@ def observe_score(score: int):
|
||||
score_hist.observe(score)
|
||||
|
||||
|
||||
def inc_voice_cap_request(cap: str, status: str):
|
||||
if PROM_AVAILABLE:
|
||||
voice_cap_requests.labels(cap=cap, status=status).inc()
|
||||
|
||||
|
||||
def inc_voice_offload(cap: str, node: str, status: str):
|
||||
if PROM_AVAILABLE:
|
||||
voice_offload_total.labels(cap=cap, node=node, status=status).inc()
|
||||
|
||||
|
||||
def set_voice_breaker(cap: str, node: str, is_open: bool):
|
||||
if PROM_AVAILABLE:
|
||||
voice_breaker_state.labels(cap=cap, node=node).set(1 if is_open else 0)
|
||||
|
||||
|
||||
def observe_voice_score(cap: str, score: float):
|
||||
if PROM_AVAILABLE:
|
||||
voice_score_hist.labels(cap=cap).observe(score)
|
||||
|
||||
|
||||
def get_metrics_text() -> Optional[bytes]:
|
||||
if PROM_AVAILABLE and REGISTRY:
|
||||
return generate_latest(REGISTRY)
|
||||
|
||||
Reference in New Issue
Block a user