Inject session user id into logs
Following a recent error https://gitlab.com/gitlab-org/developer-relations/contributor-success/team-task/-/issues/1222 I realised we are missing a key piece of the puzzle in our logs (the session user id). Let's see if we can easily add it? We're also not splitting out any of the "other data" which could be really helpful for searching logs (like the controller, or action): ``` { "body": "I, [2026-06-11T06:34:03.218120 #42] INFO -- : [deb9c255-7fd0-4105-9329-912daea6ea5f] Started POST \"/api/v1/users/submit_onboarding_response\" for 162.158.41.82 at 2026-06-11 06:34:03 +0000\n", "date": "2026-06-11T06:34:03.218120293Z", "id": "0knFpOGf00hSp2Z4SrbIT3cHac1", "timestamp": "2026-06-11T06:34:03.218120293Z", "attributes": {}, "resources": { "deployment.environment": "production", "process.command": "bin/rails", "process.pid": "28", "process.runtime.description": "ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [x86_64-linux-musl]", "process.runtime.name": "ruby", "process.runtime.version": "4.0.5", "service.name": "contributors-svc", "telemetry.sdk.language": "ruby", "telemetry.sdk.name": "opentelemetry", "telemetry.sdk.version": "1.10.0" }, "scope": {}, "severity_text": "INFO", "severity_number": 9, "scope_name": "opentelemetry-instrumentation-logger", "scope_version": "0.3.1", "span_id": "9541bf1567e43639", "trace_flags": 0, "trace_id": "0884b4f5822e1a7ef4e109764e250a8b" } ``` Although I think we can search the body easy enough? ## Recreation steps <!-- For bugs please complete this section. --> ## Implementation plan <!-- If you can provide any steps around how to address this issue, please do so. --> /cc @gitlab-org/developer-relations/contributor-success
issue