Skip to content

Commit

Permalink
Allow AI to be nullable (#74746)
Browse files Browse the repository at this point in the history
AI is not currently nullable, it would be nice if it was.

This makes ai.total_tokens.used display properly in the frontend if
ai.total_cost has never been sent as a metric
  • Loading branch information
colin-sentry committed Jul 23, 2024
1 parent 76eafc4 commit cf6a758
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sentry/search/events/datasets/spans_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class SpansMetricsDatasetConfig(DatasetConfig):
nullable_metrics = {
constants.SPAN_MESSAGING_LATENCY,
constants.SPAN_METRICS_MAP["cache.item_size"],
constants.SPAN_METRICS_MAP["ai.total_cost"],
constants.SPAN_METRICS_MAP["ai.total_tokens.used"],
}

def __init__(self, builder: spans_metrics.SpansMetricsQueryBuilder):
Expand Down

0 comments on commit cf6a758

Please sign in to comment.