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
Validation steps
- Clone SigNoz and start it locally:
git clone https://github.com/SigNoz/signoz.git cd signoz/deploy/docker docker compose up -d - Comment out the guard clause in
contributors/config/initializers/opentelemetry.rb:# return unless Rails.env.production? - Start the Dev Container and make a request while logged in.
- Open SigNoz at http://localhost:8080 and navigate to Logs.
- Verify log records include structured
user_id,caller_id, andparamsattributes.
Edited by Lee Tickett
