Customer ID in Traces: The Privacy Trade-off
Adding customer ID to traces enables per-customer debugging. It also adds compliance burden. The trade-off and the right scope.
Benefit
Per-customer debugging: 'why is customer X seeing slow responses?' Trace ID + customer ID together answer it.
Customer-correlated metrics: 'how is customer X's experience this week?'
Cost
PII in traces. GDPR, CCPA, and others apply. The trace storage now contains personal data.
Retention rules tighten. Encryption at rest matters more.
Right scope
Internal customer ID, not email or name. Still PII but more bounded.
Hash if possible; the same customer is consistent across traces but the PII is reduced.