sentry-ruby
sentry-ruby copied to clipboard
Add rake command for adding rails initializer
we want to make it easier for rails users to setup sentry, see https://fly.io/docs/reference/sentry/#ruby-on-rails and https://github.com/getsentry/sentry-wizard
- add new rake command like
bundle exec sentry:setup
- auto create default initializer
- some questions TBD (see sentry-wizard and how they do it)
- DSN
- enable performance
- enable profiling
If this only targets Rails apps, maybe we can use Rails' generator instead?
It also supports cli options. So once this is completed, we can just generate a one line command on the web UI like:
bundle exec bin/rails generate sentry --dsn <user DSN> --enable-profiling true
yep also a possibility!
some questions TBD (see sentry-wizard and how they do it)
- DSN
- enable performance
- enable profiling
We do not enable profiling OOTB with wizards, and there are not prompts as far as I know, to ask the user if they want the wizard to add it.
Ruby doesn't have to worry about uploading source context, it automatically sends sessions and attempts to set unique release values. Those would be the typical prompts we'd try to solve for, we should validate the release detection works as we expect.
For the DSN there is a login flow, which there are some cases we manage via the wizard well, and some we do not manage well. see -> https://github.com/getsentry/sentry-wizard/issues/357 but this is more related to the org auth token
Setup Wizards: dev spec
fwiw I don't think detailed feature selection is first prio, but they are considering it for the other wizards as well: https://github.com/getsentry/sentry-wizard/issues/558
Also, after chatting with Neel, I understand the steps for rails set up could become install and configure with this initializer command, which could trigger a CLI wizard like flow
is there a way that the install step could be combined? Like what we do with the other wizards?
npx @sentry/wizard@latest -i nextjs
Personally, I wouldn't want to install a npm package just to have it help me set up a SDK, unless it provides significantly better experience. In the Rails community, installing a gem and run its associated Rails generator command for configuration is a pretty standard practice. For example, bugsnag and airbrake have Rails generators too. But I don't think Rails generators can provide the same interactive experience like the wizard does.
FWIW, appsignal provides a library-agnostic executable to provide a rich installation or even diagnose experience. This may be closer to what we want to achieve with wizard? That said, IMO this is not something the Ruby SDK team should prioritize the resource for.
For the DSN there is a login flow
Is there any doc or example to show this is achieved?
Personally, I wouldn't want to install a npm package just to have it help me set up a SDK
fair, we also made it available via brew
for mobile platforms, for similar reasons. I don't know if something similar is possible for ruby gem's, to make it available in way that would make sense for ruby devs, and even ideally delete it after the wizard is complete.
FWIW, appsignal provides a library-agnostic executable to provide a rich installation or even diagnose experience. This may be closer to what we want to achieve with wizard? That said, IMO this is not something the Ruby SDK team should prioritize the resource for.
without any insight into how much effort it would be, I don't think it is a high prio either, we can create a different ticket to track it for possible future work
For the DSN there is a login flow
Is there any doc or example to show this is achieved?
@Lms24 do you have more insights to share about the project selection to fetch the correct DSN?
added in https://github.com/getsentry/sentry-ruby/releases/tag/5.18.0