feat(metrics): distinguish received and acknowledged CDRs

This commit is contained in:
2026-09-20 10:40:24 +03:30
parent 6ce567646b
commit f45c457dc8
5 changed files with 63 additions and 8 deletions

View File

@@ -133,6 +133,7 @@ class IngestionAPIServer:
await self._error(writer, 404, "not_found", f"Cannot {method} {path}")
async def _handle_raw_cdr_ingestion(self, writer, body):
api_metrics.increment_received(1)
try:
payload = parse_payload(body)
validate_structure(payload)
@@ -158,7 +159,7 @@ class IngestionAPIServer:
logger.warning(str(exc), extra={"raw_id": payload["raw_id"], "event": "kafka_delivery_failed"})
await self._error(writer, 503, "broker_unavailable", "Delivery unconfirmed; retry with the same raw_id and payload")
return
api_metrics.increment_received(1)
api_metrics.increment_acknowledged(1)
await self._json(writer, 202, {"status": "accepted", "raw_id": payload["raw_id"], "queued": True})
async def _error(self, writer, status, error, detail):