-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry.set_user should work with OpenTelemetry #2171
Comments
note to self: this is likely because of some scope lifecycle shenanigans, try a repro and see how to fix |
hey @sbeckeriv this is due to how our scope management works, can you add the following in your opentelemetry initializer (where you configure the Rails.application.config.middleware.move_after(
Sentry::Rails::CaptureExceptions,
OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware
) For now please use this, we have a longer plan to revamp our scope management completely so I don't want to mess with the current system too much. I will also add this to the documentation. |
Hi @sl0thentr0py , I think that with the switch to using https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/rack#rack-middleware-vs-rack-events I disabled the Rack events, to re-enable the middleware: OpenTelemetry::SDK.configure do |config|
config.use_all({
"OpenTelemetry::Instrumentation::Rack" => {use_rack_events: false}
})
config.add_span_processor(Sentry::OpenTelemetry::SpanProcessor.instance)
end
Rails.application.config.middleware.move_after(
Sentry::Rails::CaptureExceptions,
OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware
) which got the user association to work : ) |
Issue Description
I have a rails 6 server with ruby 2.7. I must have 5.12 installed with the sentry rails to match. I have turned on performance (spans) recently. I wanted more information so i am following https://docs.sentry.io/platforms/ruby/performance/instrumentation/opentelemetry/ i have found that my Sentry.set_user data did not continue to work after moving over to opentelmetry.
After switching over the ui for performance shows ? for the user id.
Reproduction Steps
I do not have one. I am calling set_user in a normal controller flow. My configuration matches the doc https://docs.sentry.io/platforms/ruby/performance/instrumentation/opentelemetry/
Expected Behavior
I would expect set_user to report the user while using the OpenTelemetry configuration.
Actual Behavior
No user data is set. you can see event.user is empty in before_send_transaction callback.
Ruby Version
2.7
SDK Version
5.12
Integration and Its Version
Rails 6
Sentry Config
https://docs.sentry.io/platforms/ruby/performance/instrumentation/opentelemetry/ matches my configuration.
The text was updated successfully, but these errors were encountered: