Financial-Times/dotcom-reliability-kit

Add user details to error logs

Closed this issue · 1 comments

We should see whether we can add information to our default error logging about the logged in user who experienced an error.

What problem does this feature solve?

We currently can't answer the question "what errors has X user seen?", which would be really useful in helping us to debug user-specific issues that Customer Care bring to us. Having this information in Splunk would also be useful to Customer Care: e.g. they could query for "which systems logged an error when X user tried to complete a task".

Ideal solution

I think adding something to the log-error package which attaches user details (probably just uuid) if they're available at the point where an error is logged. I don't currently know how each app gets this information, is it a header from preflight or something else? There may not be a neat solution but worth investigating.

Alternatives

We could potentially log in next-errors instead, but then we're less able to tie a user ID to the specific thrown error. We also wouldn't get user IDs tied into crashing or recoverable errors without some work in Reliability Kit and the apps.

I think we're unlikely to do this any time soon and the better way to add this is for teams to add user details to the errors themselves when they're thrown. We can always reopen this later if we change our mind or if someone comes up with a neat way of doing it.