Inject session user_id into production logs

What does this MR do and why?

Enrich OpenTelemetry log records with structured request attributes (user_id, caller_id, params) so that log entries in SigNoz can be filtered and correlated to specific users, controllers, and actions.

Closes #536

Screenshots

image

Validation steps

  1. Clone SigNoz and start it locally:
    git clone https://github.com/SigNoz/signoz.git
    cd signoz/deploy/docker
    docker compose up -d
  2. Comment out the guard clause in contributors/config/initializers/opentelemetry.rb:
    # return unless Rails.env.production?
  3. Start the Dev Container and make a request while logged in.
  4. Open SigNoz at http://localhost:8080 and navigate to Logs.
  5. Verify log records include structured user_id, caller_id, and params attributes.

/cc @leetickett-gitlab

Edited by Lee Tickett

Merge request reports

Loading