- ID
- 0eb402f5-f289-4b95-baf6-e5136b16a615
BE-7142 Add monitoring for signup flow failures after customer creation
- source :: https://hungryroot.atlassian.net/browse/BE-7142
- tags :: Hungryroot API Project
- epic :: EP-411 Eng Parking Lot
- sprint :: HR BE Sprint 104
- status :: Status - To Do
Description
Our DB Customer creation counts matching logger.info("Create customer", ...) in
app/services/api/customer.py, but Datadog customer.signup is lower (see DD
links below). This suggests failures between customer creation and metrics
emission in the /api/v2/auth/signup/ flow (app/rest/signup.py).
DataDog Metric (short counted)
DataDog Endpoint Sum (complete count)
Context
Customer creation log: app/services/api/customer.py line ~58
Metric emission happens after auth.authenticate, auth.login, and
enqueue_segment_precheckout_trk in app/rest/signup.py lines ~104–125.
Acceptance criteria
Add structured logging and/or a dedicated counter for “post-signup events
failed” including a reason category (authenticate_failed, login_failed,
segment_enqueue_failed, unknown).
Dashboard/monitor shows rate of these failures over time in prod.
Runbook note: how to correlate failed post-signup events with created customers
and/or to make Datadog metrics match database by moving signup metric closer to
the `Create customer` log
Notes: enqueue_segment_precheckout_trk asserts on request.user.customer.user_id
and runs before the Datadog increment, so a failure there can suppress the
Datadog signup metric.