Skip to content

Commit

Permalink
Merge pull request #2305 from Agenta-AI/fix/observability-analytics-n…
Browse files Browse the repository at this point in the history
…one-values

[Fix] Set default values in LegacySummary for Observability Analytics
  • Loading branch information
jp-agenta authored Nov 26, 2024
2 parents 9619cc0 + ac62dfc commit 3ab6204
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,11 @@ 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,
failure_count=bucket_dto.error.count,
cost=bucket_dto.total.cost,
latency=bucket_dto.total.duration,
total_tokens=bucket_dto.total.tokens,
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,
total_tokens=bucket_dto.total.tokens or 0,
)

data_points.append(data_point)
Expand Down

0 comments on commit 3ab6204

Please sign in to comment.