diff --git a/agenta-backend/agenta_backend/apis/fastapi/observability/utils.py b/agenta-backend/agenta_backend/apis/fastapi/observability/utils.py index 71c6eac314..188f93cfa8 100644 --- a/agenta-backend/agenta_backend/apis/fastapi/observability/utils.py +++ b/agenta-backend/agenta_backend/apis/fastapi/observability/utils.py @@ -909,7 +909,7 @@ def parse_legacy_analytics( for bucket_dto in bucket_dtos: data_point = LegacyDataPoint( timestamp=bucket_dto.timestamp, - success_count=(bucket_dto.total.count - bucket_dto.error.count) or 0, + success_count=(bucket_dto.total.count or 0) - (bucket_dto.error.count or 0), failure_count=bucket_dto.error.count or 0, cost=bucket_dto.total.cost or 0.0, latency=bucket_dto.total.duration or 0.0,