Skip to content

Commit

Permalink
chore(uptime): Switch result consumer duration/delay stats to use dis…
Browse files Browse the repository at this point in the history
…tribition (#76237)

We need this to get the p95/p99 and so on
  • Loading branch information
wedamija authored Aug 15, 2024
1 parent 0f4851b commit 17195f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sentry/uptime/consumers/results_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,17 @@ def handle_result_for_project(
# earliest delay stat for each scheduled check for the monitor here, and so this stat will be a more
# accurate measurement of delay/duration.
if result["duration_ms"]:
metrics.gauge(
metrics.distribution(
"uptime.result_processor.check_result.duration",
result["duration_ms"],
sample_rate=1.0,
unit="millisecond",
)
metrics.gauge(
metrics.distribution(
"uptime.result_processor.check_result.delay",
result["actual_check_time_ms"] - result["scheduled_check_time_ms"],
sample_rate=1.0,
unit="millisecond",
)

if project_subscription.mode == ProjectUptimeSubscriptionMode.AUTO_DETECTED_ONBOARDING:
Expand Down

0 comments on commit 17195f1

Please sign in to comment.