Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Set default values in LegacySummary for Observability Analytics #2305

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading