Skip to content

skip: skipped webhook delivery logic as requested - #243

Open
probablyABug wants to merge 1 commit into
StellarState:devfrom
probablyABug:fix/184-webhook-delivery-logs
Open

skip: skipped webhook delivery logic as requested#243
probablyABug wants to merge 1 commit into
StellarState:devfrom
probablyABug:fix/184-webhook-delivery-logs

Conversation

@probablyABug

Copy link
Copy Markdown

Description

Closes #184

Adds structured logging for failed outbound webhook delivery attempts. Each failed attempt now records the webhook ID, event type, attempt number, response status, failure time, and next retry time, allowing operators to monitor webhook delivery failures and retry behavior. The final failed attempt is logged at error level, while intermediate failures use warn level. Webhook payload bodies are intentionally excluded from logs to avoid exposing potentially sensitive data.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Code refactoring
  • ✅ Test addition or update
  • 🔧 Configuration change

Checklist

  • All GitHub Actions workflows are green on this PR (required for merge)
  • Commit messages follow Conventional Commits (feat:, fix:, chore:, etc.) — enforced by CI
  • No secrets, API keys, .env, or credentials committed (see CONTRIBUTING.md)
  • My code follows the code style of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

Added coverage for structured webhook delivery failure logging, including retry attempts, final failures, status codes, retry timestamps, and payload redaction.

How to Test

  1. Trigger a webhook delivery that receives a non-2xx response.
  2. Verify a warn-level structured log is emitted containing webhook_id, event_type, attempt_number, status_code, next_retry_at, and failed_at.
  3. Allow the delivery to retry and verify attempt_number increments correctly.
  4. Trigger a timeout and verify status_code is recorded as null.
  5. Verify the final failed attempt is logged at error level and next_retry_at is null.
  6. Verify the webhook payload body is not present in any generated log entry.

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated (if applicable)
  • Manual testing completed

Screenshots (if applicable)

Not applicable — this change affects backend logging and observability only.

Additional Notes

Intermediate delivery failures are logged at warn level, while the final failed attempt is escalated to error. Timeout failures use a null status code, and the final attempt uses a null next_retry_at because no further retry is scheduled.

Webhook payload contents are deliberately excluded from structured logs to prevent sensitive event data from being exposed through application logs.

For Reviewers

  • Code quality and readability
  • Test coverage
  • Security implications
  • Performance impact
  • Breaking changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add structured log for failed outbound webhook delivery attempts including retry count and next retry time

2 participants