feat(metrics): distinguish received and acknowledged CDRs
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user