Customer events lag
What to do when customer registrations and profile changes stop showing up downstream.
Symptoms
- Support reports a customer who updated their email minutes ago still gets order confirmations at the old address.
- The
customer_event_publish_lag_secondsgauge on the customer health dashboard is above 60s. - Get CustomerQueryv1.0.0Get CustomerQuery to fetch a single customer by their identifier. Ownercustomer-platformSchemaDiagramOpen docs returns the new profile but consumers of Customer UpdatedEventv1.0.0Customer UpdatedPublished when an existing customer's profile has changed. Ownercustomer-platformSchemaDiagramOpen docs have not seen a change.
- Newly registered customers can sign in but downstream systems have no record of them — Customer RegisteredEventv1.0.0Customer RegisteredPublished when a new customer has registered. Ownercustomer-platformSchemaDiagramOpen docs is not arriving.
Likely causes
- Customer APIServicev1.0.0Customer APIThe public-facing API for customer profiles. Handles commands to register and update customers, serves customer reads, a...Publishescustomer-registered, customer-updatedSubscribesregister-customer, update-customer +1APIsOpenAPIOwnercustomer-platformDiagramRepositoryOpen docs is writing to Customer DatabaseContainerv1.0.0Customer DatabasePostgreSQL database that is the system of record for all customer profile data.Ownercustomer-platformDiagramOpen docs but its event publisher is failing or retrying. Check the publish error rate first.
- The broker is rejecting writes or a partition is under-replicated. Check broker health before touching the service.
- A consumer has fallen behind and is reporting lag that is actually theirs, not ours.
Steps
- Confirm the lag is on our side. Compare
customer_event_publish_lag_seconds(publisher) with the consumer group lag of the team reporting the problem. If the publish lag is flat and theirs is growing, the fix is on their side — point them at guides/integrating-with-customers. - If the publisher is failing: look at Customer APIServicev1.0.0Customer APIThe public-facing API for customer profiles. Handles commands to register and update customers, serves customer reads, a...Publishescustomer-registered, customer-updatedSubscribesregister-customer, update-customer +1APIsOpenAPIOwnercustomer-platformDiagramRepositoryOpen docs logs for the failing message. A poison message is usually a profile with a value the schema does not allow. Move it to the dead-letter topic with the
customer-dlqtool and let the publisher continue. Raise a ticket to fix the validation gap in Update CustomerCommandv1.0.0Update CustomerCommand to update an existing customer's profile. Ownercustomer-platformSchemaDiagramOpen docs. - If the broker is unhealthy: page the messaging platform on-call. Do not delete or recreate topics; both customer events are replayed from the database and a lost topic means a full republish.
- If it is a database issue: publish lag often shows up alongside connection pool exhaustion. Scale Customer APIServicev1.0.0Customer APIThe public-facing API for customer profiles. Handles commands to register and update customers, serves customer reads, a...Publishescustomer-registered, customer-updatedSubscribesregister-customer, update-customer +1APIsOpenAPIOwnercustomer-platformDiagramRepositoryOpen docs down to relieve the pool rather than up.
- Watch
customer_event_publish_lag_secondsrecover. If it does not fall below 10s within 10 minutes, escalate.
Replaying events
If events were lost rather than delayed, Customer APIServicev1.0.0Customer APIThe public-facing API for customer profiles. Handles commands to register and update customers, serves customer reads, a...Publishescustomer-registered, customer-updatedSubscribesregister-customer, update-customer +1APIsOpenAPIOwnercustomer-platformDiagramRepositoryOpen docs can republish Customer RegisteredEventv1.0.0Customer RegisteredPublished when a new customer has registered.
Ownercustomer-platformSchemaDiagramOpen docs and Customer UpdatedEventv1.0.0Customer UpdatedPublished when an existing customer's profile has changed.
Ownercustomer-platformSchemaDiagramOpen docs for a time window from the database. Republished events keep their original eventId, so idempotent consumers are unaffected. Announce the replay in #customer-support first — consumers who are not idempotent will see duplicates.