Skip to content

Commit

Permalink
fix null duration bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wedamija committed Feb 8, 2025
1 parent 9ad4bb1 commit 8b63351
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sentry/uptime/consumers/results_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@ def handle_result_for_project(
# The amount of time it took for a check result to get from the checker to this consumer and be processed
metrics.distribution(
"uptime.result_processor.completion_time",
datetime.timestamp() - (result["actual_check_time_ms"] + result["duration_ms"]),
datetime.now().timestamp()
- (
result["actual_check_time_ms"] + result["duration_ms"]
if result["duration_ms"]
else 0
),
sample_rate=1.0,
unit="millisecond",
tags=metric_tags,
Expand Down

0 comments on commit 8b63351

Please sign in to comment.