Migrate from sentry-raven to sentry-ruby#8818
Conversation
cf68e11 to
970d210
Compare
|
Awesome, it was about time! See #7553 for previous art. This PR can supersede that one but maybe you find something useful in the code/comments there! |
9c2a457 to
fe8e3f2
Compare
ce2bfe8 to
ca42235
Compare
There was a problem hiding this comment.
Copied from the migration guide here: https://docs.sentry.io/platforms/ruby/migration/#exceptionraven_context
updater/lib/dependabot/setup.rb
Outdated
There was a problem hiding this comment.
This prevents Sentry adding Sentry-Trace and Baggage headers by default to all outgoing requests. It's designed to make it easier to do distributed tracing between microservices or frontend/backend. As we don't have that architecture, and it currently breaks our smoke test cache, I've chosen to disable it by default.
If we want to get this distributed trace information, we'll need to ignore these headers in our updater proxy.
References:
There was a problem hiding this comment.
I think disabling is the right call as Dependabot makes most calls to external endpoints that don't care about our tracing.
updater/lib/dependabot/service.rb
Outdated
There was a problem hiding this comment.
capture_exception now expects kwargs instead of a Hash. See https://github.com/getsentry/sentry-ruby/blob/7666c94f1f2671e4c42cd8c4a6991e3ce7da56f9/sentry-ruby/lib/sentry-ruby.rb#L394-L401
sorbet/rbi/shims/sentry-ruby.rbi
Outdated
There was a problem hiding this comment.
tapioca gem sentry-ruby generates an empty file, so this is minimal handwritten types for our uses.
updater/lib/dependabot/setup.rb
Outdated
There was a problem hiding this comment.
config.processors has been removed in favour of a lambda before_send. I've replicated the behaviour by using a reducer to call processors in order.
I had to migrate raven_context to a custom processor as well, because raven_context is no longer attached to events by default.
ca42235 to
85251aa
Compare
deivid-rodriguez
left a comment
There was a problem hiding this comment.
Fantastic job! ❤️
|
Thanks @JamieMagee for tackling this, one less hanging TODO that I feel bad about not having the time to finish 😊 plus I was always annoyed that Dependabot was relying on an EOL'd library. Reading through this PR was a lot of fun 🎉 because it answered several of my questions from #7553. In case you didn't see this note from my PR:
I suspect this change is harmless, but still, might be worth double-checking when this gets deployed, just in case. More details here, including how to preserve the old behavior through configuration if necessary. |
This migrates from the deprecated
sentry-ravengem to the replacementsentry-rubygem.sentry-ravenwas deprecated in March 2021.The changes mostly follow the Sentry migration guide. The largest changes were around event processors. Previously,
sentry-ravenallowed you to inherit fromRaven::Processorand pass it toprocessorsduring configuration. Insentry-rubythat has been replaced withbefore_sendwhich accepts a single lambda. I've recreated the same behaviour by using a reducer to apply processors consecutively. See the "scrubbing sensitive data" and "Filtering for Ruby" documentation for more information.Once this is merged, it opens up the possibility of using the
sentry-opentelemetrygem as well.