Skip to content

fix(hybridcloud): Use distribution metric for webhook delivery time#108289

Merged
armenzg merged 3 commits intomasterfrom
add_region_send_to/armenzg
Feb 17, 2026
Merged

fix(hybridcloud): Use distribution metric for webhook delivery time#108289
armenzg merged 3 commits intomasterfrom
add_region_send_to/armenzg

Conversation

@armenzg
Copy link
Member

@armenzg armenzg commented Feb 14, 2026

Replace metrics.timing() with metrics.distribution() for delivery time. timing() expects milliseconds but we were passing seconds, so values were wrong by a factor of 1000. distribution() with unit="millisecond" is explicit and correct.

We also add a tag to track where the webhook is sent to.

Replace `metrics.timing()` with `metrics.distribution()` for delivery time.
`timing()` expects milliseconds but we were passing seconds, so values were
wrong by a factor of 1000. `distribution()` with unit="millisecond" is
explicit and correct.

We also add a tag to track where the webhook is sent to.
@armenzg armenzg self-assigned this Feb 14, 2026
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 14, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if payload.destination_type == DestinationType.SENTRY_REGION
else "codecov"
)
tags = {"region_sent_to": region_sent_to}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tag.

duration = timezone.now() - payload_record.date_added
_record_delivery_time_metrics(payload_record)
metrics.incr("hybridcloud.deliver_webhooks.delivery", tags={"outcome": "ok"})
metrics.timing("hybridcloud.deliver_webhooks.delivery_time", duration.total_seconds())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're replacing this metric which expects milliseconds yet we have been passing seconds.

@armenzg armenzg marked this pull request as ready for review February 14, 2026 01:31
@armenzg armenzg requested a review from a team as a code owner February 14, 2026 01:31
@armenzg armenzg requested a review from a team February 17, 2026 14:15
@armenzg armenzg merged commit b902592 into master Feb 17, 2026
74 checks passed
@armenzg armenzg deleted the add_region_send_to/armenzg branch February 17, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants