Closed jd-bus closed 9 months ago
@jd-bus you need to do the sentry stuff before requiring sinatra, see here.
Unfortunately this is about the at_exit
order that sinatra also hooks into, so no clean way to do this.
Would that be worth putting in docs, since that came up a couple of times? Perhaps here? https://docs.sentry.io/platforms/ruby/guides/rack/
Alright! I know this is not an optimal solution, but hope this helps folks for now ⬆️
@jd-bus, cool if we close this issue? Did the example above solve the problem for you?
This looks great, thank you! Amazing to get an actual response here 😄
Issue Description
In Sinatra, most everything including middleware works fine when you have an app that you just launch with
bundle exec ruby app.rb
.But for Sentry, the rack integration didn't work (exceptions silently not reported) unless you use a config.ru and use rackup.
Reproduction Steps
app.rb:
Expected Behavior
bundle exec ruby app.rb
and post to test500, expect it will report to sentryActual Behavior
it does not report to sentry. actually the backtrace doesn't include sentry almost all:
compare if you make a config.ru and use
bundle exec rackup
, the excepton reporting DOES work and the stack trace is totally different:as you can see, protection and other middleware are loaded fine ine
bundle exec ruby app.rb
case but Sentry doesn't work at all. if it's going to be like this, at least it should be documented :(Ruby Version
2.7.5
SDK Version
5.13.0
Integration and Its Version
No response
Sentry Config
No response