Skip to content

feat(webhooks): Log slow forwarding & more context#108220

Merged
armenzg merged 6 commits intomasterfrom
log_slow_request/armenzg
Feb 19, 2026
Merged

feat(webhooks): Log slow forwarding & more context#108220
armenzg merged 6 commits intomasterfrom
log_slow_request/armenzg

Conversation

@armenzg
Copy link
Copy Markdown
Member

@armenzg armenzg commented Feb 13, 2026

This adds a log to help us find webhooks which were slow to be forwarded and add extra context to all logs.

This adds a log to help us find webhooks which were slow to be forwarded and add extra context to all logs.
@armenzg armenzg requested a review from a team February 13, 2026 15:07
@armenzg armenzg self-assigned this Feb 13, 2026
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 13, 2026
**cls.get_attributes_from_request(request),
)

def as_dict(self) -> dict[str, Any]:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will now be used for all logging in the module so we can slice the logs with these values.

metrics.timing("hybridcloud.deliver_webhooks.delivery_time", duration.total_seconds())
metrics.incr("hybridcloud.deliver_webhooks.delivery", tags={"outcome": "ok"})
if duration >= SLOW_DELIVERY_THRESHOLD:
logger.warning("deliver_webhook.slow_delivery", extra=payload.as_dict())
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the new log I'm adding so we can debug.

@armenzg armenzg marked this pull request as ready for review February 13, 2026 15:09
@armenzg armenzg requested a review from a team as a code owner February 13, 2026 15:09
…ogging

Fixes a bug where payload.as_dict() and payload.date_added were accessed
after payload.delete(), causing id and other fields to be null in log output.
Capture payload_data and date_added before deletion in both deliver_message
and _handle_parallel_delivery_result.

Co-authored-by: Cursor <[email protected]>
Copy link
Copy Markdown
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.

@armenzg armenzg merged commit c67bb83 into master Feb 19, 2026
77 checks passed
@armenzg armenzg deleted the log_slow_request/armenzg branch February 19, 2026 12:56
JonasBa pushed a commit that referenced this pull request Feb 19, 2026
This adds a log to help us find webhooks which were slow to be forwarded
and add extra context to all logs.

---------

Co-authored-by: Cursor <[email protected]>
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
This adds a log to help us find webhooks which were slow to be forwarded
and add extra context to all logs.

---------

Co-authored-by: Cursor <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

claude-code-assisted Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants