INNER CODE UNIT · Python
list_indexes
kaito-project/kaito · presets/ragengine/main.py:467
def list_indexes():
start_time = time.perf_counter()
status = STATUS_FAILURE # Default status
try:
result = rag_ops.list_indexes()
status = STATUS_SUCCESS
return result
except Exception as e:
logger.error("List indexes failed", exc_info=True)
raise HTTPException(status_code=500, detail=str(e))
finally:
# Record metrics once in finally block
rag_indexes_requests_total.labels(status=status).inc()
rag_indexes_latency.labels(status=status).observe(
time.perf_counter() - start_time
)