Skip to content

fix(dataplane): capture delivery attempt timestamps around the dispatch call#2707

Merged
mekilis merged 1 commit into
mainfrom
smart/delivery-attempt-timing-accuracy
Jul 7, 2026
Merged

fix(dataplane): capture delivery attempt timestamps around the dispatch call#2707
mekilis merged 1 commit into
mainfrom
smart/delivery-attempt-timing-accuracy

Conversation

@mekilis

@mekilis mekilis commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • requested_at on a delivery attempt was stamped at httpDispatchStart, captured before signature/header/mTLS prep, and responded_at was httpDispatchStart + elapsed duration. So responded_at - requested_at overstated real endpoint latency by our own pre-send prep time.
  • Capture requestSentAt immediately before the SendWebhookWithMTLS call and responseReceivedAt immediately after it returns, in both process_event_delivery.go and process_retry_event_delivery.go, and pass those to parseAttemptFromResponse.
  • The resp != nil && resp.StatusCode >= 100 guard is unchanged, so responded_at stays null on no-response. httpDispatchStart/duration remain for the existing latency logging (no orphans).

Test plan

  • gofmt, go vet, golangci-lint clean on worker/task
  • Full worker/task package green (122 tests)
  • New flow tests TestProcess{Event,RetryEvent}Delivery_AttemptTimingReflectsWireDelay drive a slow loopback server through a real dispatcher and assert responded_at - requested_at reflects the actual round trip (guards against regressing to prep-inclusive timing)

…ch call

requested_at was stamped at httpDispatchStart, before signature/header/mTLS
prep, and responded_at was httpDispatchStart + elapsed duration, so
responded_at - requested_at overstated real endpoint latency by our own
prep time. Capture requestSentAt immediately before SendWebhookWithMTLS and
responseReceivedAt immediately after it in both the primary and retry paths,
and pass those to parseAttemptFromResponse. The resp != nil && StatusCode >=
100 guard is unchanged, so responded_at stays null on no-response.

Adds flow tests driving a slow loopback server through a real dispatcher to
assert responded_at - requested_at reflects the actual round trip.
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Jul 7, 21:48 GMT+1. It flagged 0 findings.

Bugbot on commit b16d18c is skipped.

@mekilis mekilis merged commit baa83e6 into main Jul 7, 2026
33 checks passed
@mekilis mekilis deleted the smart/delivery-attempt-timing-accuracy branch July 7, 2026 22:10
mekilis added a commit that referenced this pull request Jul 8, 2026
bump VERSION to v26.6.2 and backfill CHANGELOG.md through v26.6.2 with
git-cliff. the changelog had frozen at 26.3.6 while tags advanced to
v26.6.1, and VERSION had frozen at v26.2.2 (nothing in the release flow
bumps it). regenerate the missing 26.3.7, 26.6.0, 26.6.1 sections and add
26.6.2 for the three commits since v26.6.1 (#2705, #2706, #2707).
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.

1 participant