- Set a user ID at the trace level so every span in the trace carries it.
- Use it to filter traces by user in the Laminar UI and analyze patterns across user segments.
Setting User ID
You can associate a user with a trace either by:- Passing
userId/user_idtoobserve/@observe - Calling
setTraceUserId/set_trace_user_idinside a span context
- TypeScript
- Python
observe(..., { userId }) and Laminar.setTraceUserIdPrivacy Considerations
- Prefer anonymous or pseudonymous IDs over PII (avoid emails, phone numbers, names).
- For sensitive operations, avoid recording inputs/outputs with
observe({ ignoreInput: true, ignoreOutput: true })/@observe(ignore_input=True, ignore_output=True).
