Skip to main content

Merchandising Exporter Lambda Has Errors

This runbook covers the Grafana alert Merchandising Exporter Lambda Has Errors.

The alert fires when the production MerchandisingExporterLambda records any Lambda error in 5 minutes. The exporter syncs merchandising rules from DynamoDB to Cloudflare KV. While it is failing, merchandising changes may not reach the search proxy and storefront behavior can become stale.

Triage

  1. Check MerchandisingExporterLambda logs in the controller account around the alert window.
  2. Identify whether the failure is for one index/profile/trigger or for the whole scheduled export.
  3. Check the affected rows in prod-MerchandisingTable, especially recently edited rules.
  4. Check whether the error is from DynamoDB parsing, exporter validation, Cloudflare KV writes, or Cloudflare credentials.
  5. If requests are also failing, preserve a failing search request and response before changing rules.

Useful starting point:

aws logs tail /aws/lambda/MerchandisingExporterLambda --since 30m --filter-pattern "?ERROR ?Traceback ?Exception"

See Merchandising Diagnostics and Settings Sync.

Remediation

  • If a rule is malformed, correct it through Console/Admin UI or the controller API. Direct DDB edits should be a last resort and need explicit approval.
  • If the exporter code rejects valid rule data, patch or roll back the exporter.
  • If Cloudflare KV writes are failing, check the Cloudflare API token, namespace, and rate limits.
  • After fixing the root cause, rerun/export the affected index if available, or wait for the next 5 minute schedule and confirm it succeeds.

Validation

  • MerchandisingExporterLambda has no new errors.
  • The affected KV entry reflects the expected merchandising config.
  • The storefront/search request that depended on the rule now behaves as expected.