├── .craft.yml ├── .devcontainer ├── .env.example ├── Dockerfile ├── devcontainer.json └── docker-compose.yml ├── .github ├── ISSUE_TEMPLATE │ ├── 01-feature.yml │ ├── 02-improvement.yml │ ├── 03-bug.yml │ ├── config.yml │ └── maintainer-blank.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── build_batch_release.yml │ ├── build_release.yml │ ├── codeql-analysis.yml │ ├── danger.yml │ ├── lint.yml │ ├── prepare_batch_release.yml │ ├── prepare_raven_release.yml │ ├── sentry_delayed_job_test.yml │ ├── sentry_opentelemetry_test.yml │ ├── sentry_rails_test.yml │ ├── sentry_raven_test.yml │ ├── sentry_resque_test.yml │ ├── sentry_ruby_test.yml │ ├── sentry_sidekiq_test.yml │ └── tests.yml ├── .gitignore ├── .rubocop.yml ├── .scripts ├── batch_build.rb ├── batch_release.rb └── bump-version.rb ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── EXTENSION.md ├── Gemfile ├── LICENSE ├── MIGRATION.md ├── README.md ├── codecov.yml ├── sentry-delayed_job ├── .gitignore ├── .rspec ├── .rubocop.yml ├── CHANGELOG.md ├── Gemfile ├── LICENSE.txt ├── Makefile ├── README.md ├── Rakefile ├── bin │ ├── console │ └── setup ├── example │ ├── Gemfile │ └── app.rb ├── lib │ ├── sentry-delayed_job.rb │ └── sentry │ │ └── delayed_job │ │ ├── configuration.rb │ │ ├── plugin.rb │ │ └── version.rb ├── sentry-delayed_job.gemspec └── spec │ ├── sentry │ ├── delayed_job │ │ └── configuration_spec.rb │ └── delayed_job_spec.rb │ └── spec_helper.rb ├── sentry-opentelemetry ├── .gitignore ├── .rspec ├── .rubocop.yml ├── Gemfile ├── LICENSE.txt ├── Makefile ├── README.md ├── Rakefile ├── bin │ ├── console │ └── setup ├── lib │ ├── sentry-opentelemetry.rb │ └── sentry │ │ └── opentelemetry │ │ ├── propagator.rb │ │ ├── span_processor.rb │ │ └── version.rb ├── sentry-opentelemetry.gemspec └── spec │ ├── sentry │ └── opentelemetry │ │ ├── propagator_spec.rb │ │ └── span_processor_spec.rb │ └── spec_helper.rb ├── sentry-rails ├── .gitignore ├── .rspec ├── .rubocop.yml ├── CHANGELOG.md ├── Gemfile ├── LICENSE.txt ├── Makefile ├── README.md ├── Rakefile ├── app │ └── jobs │ │ └── sentry │ │ └── send_event_job.rb ├── benchmarks │ ├── allocation_comparison.rb │ ├── allocation_report.rb │ └── application.rb ├── bin │ ├── console │ └── setup ├── examples │ ├── minimum-rails │ │ └── app.rb │ ├── rails-5.2 │ │ ├── .gitignore │ │ ├── Gemfile │ │ ├── README.md │ │ ├── Rakefile │ │ ├── app │ │ │ ├── assets │ │ │ │ ├── javascripts │ │ │ │ │ └── posts.coffee │ │ │ │ └── stylesheets │ │ │ │ │ ├── posts.scss │ │ │ │ │ └── scaffolds.scss │ │ │ ├── channels │ │ │ │ └── application_cable │ │ │ │ │ ├── channel.rb │ │ │ │ │ └── connection.rb │ │ │ ├── controllers │ │ │ │ ├── application_controller.rb │ │ │ │ ├── concerns │ │ │ │ │ └── .keep │ │ │ │ ├── posts_controller.rb │ │ │ │ └── welcome_controller.rb │ │ │ ├── helpers │ │ │ │ └── posts_helper.rb │ │ │ ├── jobs │ │ │ │ └── application_job.rb │ │ │ ├── models │ │ │ │ ├── application_record.rb │ │ │ │ ├── concerns │ │ │ │ │ └── .keep │ │ │ │ └── post.rb │ │ │ └── views │ │ │ │ ├── layouts │ │ │ │ ├── application.html.erb │ │ │ │ ├── mailer.html.erb │ │ │ │ └── mailer.text.erb │ │ │ │ ├── posts │ │ │ │ ├── _form.html.erb │ │ │ │ ├── _post.json.jbuilder │ │ │ │ ├── edit.html.erb │ │ │ │ ├── index.html.erb │ │ │ │ ├── index.json.jbuilder │ │ │ │ ├── new.html.erb │ │ │ │ ├── show.html.erb │ │ │ │ └── show.json.jbuilder │ │ │ │ └── welcome │ │ │ │ └── report_demo.html.erb │ │ ├── bin │ │ │ ├── bundle │ │ │ ├── rails │ │ │ ├── rake │ │ │ ├── setup │ │ │ ├── spring │ │ │ └── update │ │ ├── config.ru │ │ ├── config │ │ │ ├── application.rb │ │ │ ├── boot.rb │ │ │ ├── cable.yml │ │ │ ├── database.yml │ │ │ ├── environment.rb │ │ │ ├── environments │ │ │ │ ├── development.rb │ │ │ │ ├── production.rb │ │ │ │ └── test.rb │ │ │ ├── initializers │ │ │ │ ├── application_controller_renderer.rb │ │ │ │ ├── assets.rb │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ ├── cookies_serializer.rb │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ ├── inflections.rb │ │ │ │ ├── mime_types.rb │ │ │ │ ├── new_framework_defaults.rb │ │ │ │ ├── sentry.rb │ │ │ │ ├── session_store.rb │ │ │ │ └── wrap_parameters.rb │ │ │ ├── locales │ │ │ │ └── en.yml │ │ │ ├── puma.rb │ │ │ ├── routes.rb │ │ │ └── secrets.yml │ │ ├── db │ │ │ ├── migrate │ │ │ │ └── 20210112160711_create_posts.rb │ │ │ ├── schema.rb │ │ │ └── seeds.rb │ │ ├── public │ │ │ ├── 404.html │ │ │ ├── 422.html │ │ │ ├── apple-touch-icon-precomposed.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon.ico │ │ │ └── robots.txt │ │ └── test │ │ │ ├── controllers │ │ │ └── posts_controller_test.rb │ │ │ ├── fixtures │ │ │ └── posts.yml │ │ │ ├── models │ │ │ └── post_test.rb │ │ │ └── system │ │ │ └── posts_test.rb │ ├── rails-6.0 │ │ ├── .browserslistrc │ │ ├── .gitignore │ │ ├── Gemfile │ │ ├── README.md │ │ ├── Rakefile │ │ ├── app │ │ │ ├── assets │ │ │ │ ├── config │ │ │ │ │ └── manifest.js │ │ │ │ ├── images │ │ │ │ │ └── .keep │ │ │ │ └── stylesheets │ │ │ │ │ ├── application.css │ │ │ │ │ ├── posts.scss │ │ │ │ │ └── scaffolds.scss │ │ │ ├── channels │ │ │ │ ├── appearance_channel.rb │ │ │ │ └── application_cable │ │ │ │ │ ├── channel.rb │ │ │ │ │ └── connection.rb │ │ │ ├── controllers │ │ │ │ ├── application_controller.rb │ │ │ │ ├── concerns │ │ │ │ │ └── .keep │ │ │ │ ├── posts_controller.rb │ │ │ │ └── welcome_controller.rb │ │ │ ├── delayed_jobs │ │ │ │ └── error_delayed_job.rb │ │ │ ├── helpers │ │ │ │ ├── application_helper.rb │ │ │ │ └── posts_helper.rb │ │ │ ├── javascript │ │ │ │ ├── channels │ │ │ │ │ ├── appearance_channel.js │ │ │ │ │ ├── consumer.js │ │ │ │ │ └── index.js │ │ │ │ └── packs │ │ │ │ │ └── application.js │ │ │ ├── jobs │ │ │ │ ├── application_job.rb │ │ │ │ └── error_job.rb │ │ │ ├── mailers │ │ │ │ └── application_mailer.rb │ │ │ ├── models │ │ │ │ ├── application_record.rb │ │ │ │ ├── concerns │ │ │ │ │ └── .keep │ │ │ │ └── post.rb │ │ │ ├── resque_jobs │ │ │ │ └── raise_error.rb │ │ │ ├── views │ │ │ │ ├── layouts │ │ │ │ │ ├── application.html.erb │ │ │ │ │ ├── mailer.html.erb │ │ │ │ │ └── mailer.text.erb │ │ │ │ ├── posts │ │ │ │ │ ├── _form.html.erb │ │ │ │ │ ├── _post.json.jbuilder │ │ │ │ │ ├── edit.html.erb │ │ │ │ │ ├── index.html.erb │ │ │ │ │ ├── index.json.jbuilder │ │ │ │ │ ├── new.html.erb │ │ │ │ │ ├── show.html.erb │ │ │ │ │ └── show.json.jbuilder │ │ │ │ └── welcome │ │ │ │ │ ├── appearance.html.erb │ │ │ │ │ ├── report_demo.html.erb │ │ │ │ │ └── view_error.html.erb │ │ │ └── workers │ │ │ │ └── error_worker.rb │ │ ├── babel.config.js │ │ ├── bin │ │ │ ├── bundle │ │ │ ├── delayed_job │ │ │ ├── rails │ │ │ ├── rake │ │ │ ├── setup │ │ │ ├── spring │ │ │ ├── webpack │ │ │ ├── webpack-dev-server │ │ │ └── yarn │ │ ├── config.ru │ │ ├── config │ │ │ ├── application.rb │ │ │ ├── boot.rb │ │ │ ├── cable.yml │ │ │ ├── credentials.yml.enc │ │ │ ├── database.yml │ │ │ ├── environment.rb │ │ │ ├── environments │ │ │ │ ├── development.rb │ │ │ │ ├── production.rb │ │ │ │ └── test.rb │ │ │ ├── initializers │ │ │ │ ├── application_controller_renderer.rb │ │ │ │ ├── assets.rb │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ ├── content_security_policy.rb │ │ │ │ ├── cookies_serializer.rb │ │ │ │ ├── delayed_job.rb │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ ├── inflections.rb │ │ │ │ ├── mime_types.rb │ │ │ │ ├── resque.rb │ │ │ │ ├── sentry.rb │ │ │ │ └── wrap_parameters.rb │ │ │ ├── locales │ │ │ │ └── en.yml │ │ │ ├── puma.rb │ │ │ ├── routes.rb │ │ │ ├── spring.rb │ │ │ ├── storage.yml │ │ │ ├── unicorn.rb │ │ │ ├── webpack │ │ │ │ ├── development.js │ │ │ │ ├── environment.js │ │ │ │ ├── production.js │ │ │ │ └── test.js │ │ │ └── webpacker.yml │ │ ├── db │ │ │ ├── migrate │ │ │ │ ├── 20201120074001_create_posts.rb │ │ │ │ ├── 20211002044752_create_active_storage_tables.active_storage.rb │ │ │ │ └── 20211219212232_create_delayed_jobs.rb │ │ │ ├── schema.rb │ │ │ └── seeds.rb │ │ ├── lib │ │ │ ├── assets │ │ │ │ └── .keep │ │ │ └── tasks │ │ │ │ ├── .keep │ │ │ │ └── resque.rake │ │ ├── package.json │ │ ├── postcss.config.js │ │ ├── public │ │ │ ├── 404.html │ │ │ ├── 422.html │ │ │ ├── 500.html │ │ │ ├── apple-touch-icon-precomposed.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon.ico │ │ │ └── robots.txt │ │ ├── storage │ │ │ └── .keep │ │ ├── test │ │ │ ├── application_system_test_case.rb │ │ │ ├── channels │ │ │ │ └── application_cable │ │ │ │ │ └── connection_test.rb │ │ │ ├── controllers │ │ │ │ ├── .keep │ │ │ │ └── posts_controller_test.rb │ │ │ ├── fixtures │ │ │ │ ├── .keep │ │ │ │ ├── files │ │ │ │ │ └── .keep │ │ │ │ └── posts.yml │ │ │ ├── helpers │ │ │ │ └── .keep │ │ │ ├── integration │ │ │ │ └── .keep │ │ │ ├── mailers │ │ │ │ └── .keep │ │ │ ├── models │ │ │ │ ├── .keep │ │ │ │ └── post_test.rb │ │ │ ├── system │ │ │ │ ├── .keep │ │ │ │ └── posts_test.rb │ │ │ └── test_helper.rb │ │ ├── vendor │ │ │ └── .keep │ │ └── yarn.lock │ ├── rails-7.0 │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .rspec │ │ ├── Gemfile │ │ ├── README.md │ │ ├── Rakefile │ │ ├── app │ │ │ ├── assets │ │ │ │ ├── config │ │ │ │ │ └── manifest.js │ │ │ │ ├── images │ │ │ │ │ └── .keep │ │ │ │ └── stylesheets │ │ │ │ │ ├── application.css │ │ │ │ │ ├── posts.scss │ │ │ │ │ └── scaffolds.scss │ │ │ ├── channels │ │ │ │ ├── appearance_channel.rb │ │ │ │ └── application_cable │ │ │ │ │ ├── channel.rb │ │ │ │ │ └── connection.rb │ │ │ ├── controllers │ │ │ │ ├── application_controller.rb │ │ │ │ ├── concerns │ │ │ │ │ └── .keep │ │ │ │ ├── posts_controller.rb │ │ │ │ └── welcome_controller.rb │ │ │ ├── delayed_jobs │ │ │ │ └── error_delayed_job.rb │ │ │ ├── helpers │ │ │ │ ├── application_helper.rb │ │ │ │ └── posts_helper.rb │ │ │ ├── javascript │ │ │ │ ├── channels │ │ │ │ │ ├── appearance_channel.js │ │ │ │ │ ├── consumer.js │ │ │ │ │ └── index.js │ │ │ │ └── packs │ │ │ │ │ └── application.js │ │ │ ├── jobs │ │ │ │ ├── application_job.rb │ │ │ │ └── error_job.rb │ │ │ ├── mailers │ │ │ │ └── application_mailer.rb │ │ │ ├── models │ │ │ │ ├── application_record.rb │ │ │ │ ├── concerns │ │ │ │ │ └── .keep │ │ │ │ └── post.rb │ │ │ ├── resque_jobs │ │ │ │ └── raise_error.rb │ │ │ ├── views │ │ │ │ ├── layouts │ │ │ │ │ ├── application.html.erb │ │ │ │ │ ├── mailer.html.erb │ │ │ │ │ └── mailer.text.erb │ │ │ │ ├── posts │ │ │ │ │ ├── _form.html.erb │ │ │ │ │ ├── _post.json.jbuilder │ │ │ │ │ ├── edit.html.erb │ │ │ │ │ ├── index.html.erb │ │ │ │ │ ├── index.json.jbuilder │ │ │ │ │ ├── new.html.erb │ │ │ │ │ ├── show.html.erb │ │ │ │ │ └── show.json.jbuilder │ │ │ │ └── welcome │ │ │ │ │ ├── appearance.html.erb │ │ │ │ │ ├── report_demo.html.erb │ │ │ │ │ └── view_error.html.erb │ │ │ └── workers │ │ │ │ └── error_worker.rb │ │ ├── bin │ │ │ ├── bundle │ │ │ ├── rails │ │ │ ├── rake │ │ │ └── setup │ │ ├── config.ru │ │ ├── config │ │ │ ├── application.rb │ │ │ ├── boot.rb │ │ │ ├── cable.yml │ │ │ ├── credentials.yml.enc │ │ │ ├── database.yml │ │ │ ├── environment.rb │ │ │ ├── environments │ │ │ │ ├── development.rb │ │ │ │ ├── production.rb │ │ │ │ └── test.rb │ │ │ ├── initializers │ │ │ │ ├── assets.rb │ │ │ │ ├── content_security_policy.rb │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ ├── inflections.rb │ │ │ │ ├── permissions_policy.rb │ │ │ │ └── sentry.rb │ │ │ ├── locales │ │ │ │ └── en.yml │ │ │ ├── puma.rb │ │ │ ├── routes.rb │ │ │ └── storage.yml │ │ ├── db │ │ │ ├── migrate │ │ │ │ └── 20220403110436_create_posts.rb │ │ │ ├── schema.rb │ │ │ └── seeds.rb │ │ ├── lib │ │ │ ├── assets │ │ │ │ └── .keep │ │ │ └── tasks │ │ │ │ └── .keep │ │ ├── public │ │ │ ├── 404.html │ │ │ ├── 422.html │ │ │ ├── 500.html │ │ │ ├── apple-touch-icon-precomposed.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon.ico │ │ │ └── robots.txt │ │ ├── spec │ │ │ ├── rails_helper.rb │ │ │ ├── requests │ │ │ │ └── welcomes_spec.rb │ │ │ └── spec_helper.rb │ │ ├── storage │ │ │ └── .keep │ │ ├── test │ │ │ ├── application_system_test_case.rb │ │ │ ├── channels │ │ │ │ └── application_cable │ │ │ │ │ └── connection_test.rb │ │ │ ├── controllers │ │ │ │ └── .keep │ │ │ ├── fixtures │ │ │ │ └── files │ │ │ │ │ └── .keep │ │ │ ├── helpers │ │ │ │ └── .keep │ │ │ ├── integration │ │ │ │ └── .keep │ │ │ ├── mailers │ │ │ │ └── .keep │ │ │ ├── models │ │ │ │ └── .keep │ │ │ ├── system │ │ │ │ └── .keep │ │ │ └── test_helper.rb │ │ └── vendor │ │ │ └── .keep │ └── rails-8.0 │ │ ├── .dockerignore │ │ ├── .gitattributes │ │ ├── .github │ │ ├── dependabot.yml │ │ └── workflows │ │ │ └── ci.yml │ │ ├── .gitignore │ │ ├── .kamal │ │ ├── hooks │ │ │ ├── docker-setup.sample │ │ │ ├── post-deploy.sample │ │ │ ├── post-proxy-reboot.sample │ │ │ ├── pre-build.sample │ │ │ ├── pre-connect.sample │ │ │ ├── pre-deploy.sample │ │ │ └── pre-proxy-reboot.sample │ │ └── secrets │ │ ├── .rubocop.yml │ │ ├── Dockerfile │ │ ├── Gemfile │ │ ├── README.md │ │ ├── Rakefile │ │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── javascript │ │ │ ├── application.js │ │ │ └── controllers │ │ │ │ ├── application.js │ │ │ │ ├── hello_controller.js │ │ │ │ └── index.js │ │ ├── jobs │ │ │ ├── application_job.rb │ │ │ └── error_job.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ ├── models │ │ │ ├── application_record.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ ├── layouts │ │ │ ├── application.html.erb │ │ │ ├── mailer.html.erb │ │ │ └── mailer.text.erb │ │ │ └── pwa │ │ │ ├── manifest.json.erb │ │ │ └── service-worker.js │ │ ├── bin │ │ ├── brakeman │ │ ├── bundle │ │ ├── dev │ │ ├── docker-entrypoint │ │ ├── importmap │ │ ├── jobs │ │ ├── kamal │ │ ├── rails │ │ ├── rake │ │ ├── rubocop │ │ ├── setup │ │ └── thrust │ │ ├── config.ru │ │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── cable.yml │ │ ├── cache.yml │ │ ├── credentials.yml.enc │ │ ├── database.yml │ │ ├── deploy.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ └── production.rb │ │ ├── importmap.rb │ │ ├── initializers │ │ │ ├── assets.rb │ │ │ ├── content_security_policy.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ └── sentry.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── puma.rb │ │ ├── queue.yml │ │ ├── recurring.yml │ │ ├── routes.rb │ │ └── storage.yml │ │ ├── db │ │ ├── cable_schema.rb │ │ ├── cache_schema.rb │ │ ├── queue_schema.rb │ │ ├── schema.rb │ │ └── seeds.rb │ │ ├── lib │ │ └── tasks │ │ │ └── .keep │ │ ├── public │ │ ├── 400.html │ │ ├── 404.html │ │ ├── 406-unsupported-browser.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── icon.png │ │ ├── icon.svg │ │ └── robots.txt │ │ ├── script │ │ └── .keep │ │ ├── storage │ │ └── .keep │ │ ├── test │ │ ├── application_system_test_case.rb │ │ ├── controllers │ │ │ └── .keep │ │ ├── fixtures │ │ │ └── files │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ └── .keep │ │ ├── jobs │ │ │ └── error_job_test.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ └── test_helper.rb │ │ └── vendor │ │ ├── .keep │ │ └── javascript │ │ └── .keep ├── lib │ ├── generators │ │ └── sentry_generator.rb │ ├── sentry-rails.rb │ └── sentry │ │ ├── rails.rb │ │ └── rails │ │ ├── action_cable.rb │ │ ├── active_job.rb │ │ ├── background_worker.rb │ │ ├── backtrace_cleaner.rb │ │ ├── breadcrumb │ │ ├── active_support_logger.rb │ │ └── monotonic_active_support_logger.rb │ │ ├── capture_exceptions.rb │ │ ├── configuration.rb │ │ ├── controller_methods.rb │ │ ├── controller_transaction.rb │ │ ├── engine.rb │ │ ├── error_subscriber.rb │ │ ├── instrument_payload_cleanup_helper.rb │ │ ├── overrides │ │ └── streaming_reporter.rb │ │ ├── railtie.rb │ │ ├── rescued_exception_interceptor.rb │ │ ├── tracing.rb │ │ ├── tracing │ │ ├── abstract_subscriber.rb │ │ ├── action_controller_subscriber.rb │ │ ├── action_view_subscriber.rb │ │ ├── active_record_subscriber.rb │ │ ├── active_storage_subscriber.rb │ │ └── active_support_subscriber.rb │ │ └── version.rb ├── sentry-rails.gemspec └── spec │ ├── dummy │ └── test_rails_app │ │ ├── app.rb │ │ ├── app │ │ └── assets │ │ │ └── config │ │ │ └── manifest.js │ │ ├── apps │ │ ├── 5-0.rb │ │ ├── 5-2.rb │ │ ├── 6-0.rb │ │ ├── 6-1.rb │ │ ├── 7-0.rb │ │ └── 7-1.rb │ │ ├── config.ru │ │ ├── config │ │ ├── database.yml │ │ └── storage.yml │ │ ├── configs │ │ ├── 5-0.rb │ │ ├── 5-2.rb │ │ ├── 6-0.rb │ │ ├── 6-1.rb │ │ ├── 7-0.rb │ │ ├── 7-1.rb │ │ └── 7-2.rb │ │ ├── public │ │ ├── sentry-logo.png │ │ └── static.html │ │ └── test_template.html.erb │ ├── isolated │ └── active_job_activation.rb │ ├── sentry │ ├── generator_spec.rb │ ├── rails │ │ ├── action_cable_spec.rb │ │ ├── activejob_spec.rb │ │ ├── breadcrumbs │ │ │ ├── active_support_logger_spec.rb │ │ │ └── monotonic_active_support_logger_spec.rb │ │ ├── client_spec.rb │ │ ├── configuration_spec.rb │ │ ├── controller_methods_spec.rb │ │ ├── error_subscriber_spec.rb │ │ ├── event_spec.rb │ │ ├── tracing │ │ │ ├── action_controller_subscriber_spec.rb │ │ │ ├── action_view_subscriber_spec.rb │ │ │ ├── active_record_subscriber_spec.rb │ │ │ ├── active_storage_subscriber_spec.rb │ │ │ └── active_support_subscriber_spec.rb │ │ └── tracing_spec.rb │ ├── rails_spec.rb │ └── send_event_job_spec.rb │ ├── spec_helper.rb │ ├── support │ └── test_jobs.rb │ └── versioned │ └── 2.7 │ └── activejob_spec.rb ├── sentry-raven ├── .craft.yml ├── .scripts │ └── bump-version.rb ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Gemfile ├── LICENSE ├── Makefile ├── README.md ├── Rakefile ├── benchmarks │ ├── allocation_report.rb │ ├── application.rb │ ├── profile.rb │ ├── rails_integration_allocation_comparison.rb │ └── rails_integration_allocation_report.rb ├── exe │ └── raven ├── lib │ ├── raven.rb │ ├── raven │ │ ├── backtrace.rb │ │ ├── base.rb │ │ ├── breadcrumbs.rb │ │ ├── breadcrumbs │ │ │ ├── active_support_logger.rb │ │ │ ├── logger.rb │ │ │ └── sentry_logger.rb │ │ ├── cli.rb │ │ ├── client.rb │ │ ├── configuration.rb │ │ ├── context.rb │ │ ├── core_ext │ │ │ └── object │ │ │ │ ├── deep_dup.rb │ │ │ │ └── duplicable.rb │ │ ├── event.rb │ │ ├── helpers │ │ │ └── deprecation_helper.rb │ │ ├── instance.rb │ │ ├── integrations │ │ │ ├── delayed_job.rb │ │ │ ├── rack-timeout.rb │ │ │ ├── rack.rb │ │ │ ├── rails.rb │ │ │ ├── rails │ │ │ │ ├── active_job.rb │ │ │ │ ├── backtrace_cleaner.rb │ │ │ │ ├── controller_methods.rb │ │ │ │ ├── controller_transaction.rb │ │ │ │ └── overrides │ │ │ │ │ ├── debug_exceptions_catcher.rb │ │ │ │ │ └── streaming_reporter.rb │ │ │ ├── railties.rb │ │ │ ├── rake.rb │ │ │ ├── sidekiq.rb │ │ │ ├── sidekiq │ │ │ │ ├── cleanup_middleware.rb │ │ │ │ └── error_handler.rb │ │ │ └── tasks.rb │ │ ├── interface.rb │ │ ├── interfaces │ │ │ ├── exception.rb │ │ │ ├── http.rb │ │ │ ├── message.rb │ │ │ ├── single_exception.rb │ │ │ └── stack_trace.rb │ │ ├── linecache.rb │ │ ├── logger.rb │ │ ├── processor.rb │ │ ├── processor │ │ │ ├── cookies.rb │ │ │ ├── http_headers.rb │ │ │ ├── post_data.rb │ │ │ ├── removecircularreferences.rb │ │ │ ├── removestacktrace.rb │ │ │ ├── sanitizedata.rb │ │ │ └── utf8conversion.rb │ │ ├── transports.rb │ │ ├── transports │ │ │ ├── dummy.rb │ │ │ ├── http.rb │ │ │ └── stdout.rb │ │ ├── utils │ │ │ ├── context_filter.rb │ │ │ ├── deep_merge.rb │ │ │ ├── exception_cause_chain.rb │ │ │ ├── real_ip.rb │ │ │ └── request_id.rb │ │ └── version.rb │ ├── sentry-raven-without-integrations.rb │ ├── sentry-raven.rb │ └── sentry_raven_without_integrations.rb ├── sentry-raven.gemspec └── spec │ ├── raven │ ├── backtrace_spec.rb │ ├── breadcrumbs │ │ ├── active_support_breadcrumbs_spec.rb │ │ └── sentry_logger_spec.rb │ ├── breadcrumbs_spec.rb │ ├── cli_spec.rb │ ├── client_spec.rb │ ├── client_state_spec.rb │ ├── configuration_spec.rb │ ├── event_spec.rb │ ├── instance_spec.rb │ ├── integration_spec.rb │ ├── integrations │ │ ├── delayed_job_spec.rb │ │ ├── rack_spec.rb │ │ ├── rack_timeout_spec.rb │ │ ├── rails │ │ │ ├── activejob_spec.rb │ │ │ ├── controller_methods_spec.rb │ │ │ ├── event_spec.rb │ │ │ └── overrides │ │ │ │ └── debug_exceptions_catcher_spec.rb │ │ ├── rails_spec.rb │ │ ├── rake_spec.rb │ │ ├── sidekiq │ │ │ └── error_handler_spec.rb │ │ └── sidekiq_spec.rb │ ├── interface_spec.rb │ ├── interfaces │ │ └── stack_trace_spec.rb │ ├── json_spec.rb │ ├── linecache_spec.rb │ ├── logger_spec.rb │ ├── processors │ │ ├── cookies_spec.rb │ │ ├── http_headers_spec.rb │ │ ├── post_data_spec.rb │ │ ├── removecirculareferences_spec.rb │ │ ├── removestacktrace_spec.rb │ │ ├── sanitizedata_processor_spec.rb │ │ └── utf8conversion_spec.rb │ ├── raven_spec.rb │ ├── transports │ │ ├── http_spec.rb │ │ └── stdout_spec.rb │ └── utils │ │ ├── context_filter_spec.rb │ │ ├── exception_cause_chain_spec.rb │ │ ├── real_ip_spec.rb │ │ └── request_id_spec.rb │ ├── spec_helper.rb │ └── support │ ├── Rakefile │ ├── linecache.txt │ └── test_rails_app │ └── app.rb ├── sentry-resque ├── .gitignore ├── .rspec ├── .rubocop.yml ├── Gemfile ├── LICENSE.txt ├── Makefile ├── README.md ├── Rakefile ├── bin │ ├── console │ └── setup ├── example │ ├── Gemfile │ └── app.rb ├── lib │ ├── sentry-resque.rb │ └── sentry │ │ ├── resque.rb │ │ └── resque │ │ ├── configuration.rb │ │ └── version.rb ├── sentry-resque.gemspec └── spec │ ├── sentry │ ├── resque │ │ └── configuration_spec.rb │ ├── resque_spec.rb │ └── tracing_spec.rb │ └── spec_helper.rb ├── sentry-ruby.code-workspace ├── sentry-ruby ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .yardopts ├── CHANGELOG.md ├── Gemfile ├── LICENSE.txt ├── Makefile ├── README.md ├── Rakefile ├── benchmarks │ ├── allocation_comparison.rb │ ├── allocation_report.rb │ └── exception_locals_capturing.rb ├── bin │ ├── console │ └── setup ├── examples │ ├── crons │ │ ├── Gemfile │ │ ├── README.md │ │ └── Rakefile.rb │ ├── rails-6.0 │ ├── rake │ │ ├── Gemfile │ │ └── Rakefile.rb │ ├── sinatra │ │ ├── Gemfile │ │ ├── README.md │ │ └── app.rb │ └── without_integrations │ │ ├── Gemfile │ │ └── app.rb ├── lib │ ├── sentry-ruby.rb │ └── sentry │ │ ├── attachment.rb │ │ ├── background_worker.rb │ │ ├── backpressure_monitor.rb │ │ ├── backtrace.rb │ │ ├── baggage.rb │ │ ├── breadcrumb.rb │ │ ├── breadcrumb │ │ └── sentry_logger.rb │ │ ├── breadcrumb_buffer.rb │ │ ├── check_in_event.rb │ │ ├── client.rb │ │ ├── configuration.rb │ │ ├── core_ext │ │ └── object │ │ │ ├── deep_dup.rb │ │ │ └── duplicable.rb │ │ ├── cron │ │ ├── configuration.rb │ │ ├── monitor_check_ins.rb │ │ ├── monitor_config.rb │ │ └── monitor_schedule.rb │ │ ├── dsn.rb │ │ ├── envelope.rb │ │ ├── envelope │ │ └── item.rb │ │ ├── error_event.rb │ │ ├── event.rb │ │ ├── exceptions.rb │ │ ├── excon.rb │ │ ├── excon │ │ └── middleware.rb │ │ ├── faraday.rb │ │ ├── graphql.rb │ │ ├── hub.rb │ │ ├── integrable.rb │ │ ├── interface.rb │ │ ├── interfaces │ │ ├── exception.rb │ │ ├── mechanism.rb │ │ ├── request.rb │ │ ├── single_exception.rb │ │ ├── stacktrace.rb │ │ ├── stacktrace_builder.rb │ │ └── threads.rb │ │ ├── linecache.rb │ │ ├── log_event.rb │ │ ├── log_event_buffer.rb │ │ ├── logger.rb │ │ ├── metrics.rb │ │ ├── metrics │ │ ├── aggregator.rb │ │ ├── configuration.rb │ │ ├── counter_metric.rb │ │ ├── distribution_metric.rb │ │ ├── gauge_metric.rb │ │ ├── local_aggregator.rb │ │ ├── metric.rb │ │ ├── set_metric.rb │ │ └── timing.rb │ │ ├── net │ │ └── http.rb │ │ ├── profiler.rb │ │ ├── profiler │ │ └── helpers.rb │ │ ├── propagation_context.rb │ │ ├── puma.rb │ │ ├── rack.rb │ │ ├── rack │ │ └── capture_exceptions.rb │ │ ├── rake.rb │ │ ├── redis.rb │ │ ├── release_detector.rb │ │ ├── rspec.rb │ │ ├── scope.rb │ │ ├── session.rb │ │ ├── session_flusher.rb │ │ ├── span.rb │ │ ├── structured_logger.rb │ │ ├── test_helper.rb │ │ ├── threaded_periodic_worker.rb │ │ ├── transaction.rb │ │ ├── transaction_event.rb │ │ ├── transport.rb │ │ ├── transport │ │ ├── configuration.rb │ │ ├── dummy_transport.rb │ │ ├── http_transport.rb │ │ └── spotlight_transport.rb │ │ ├── utils │ │ ├── argument_checking_helper.rb │ │ ├── custom_inspection.rb │ │ ├── encoding_helper.rb │ │ ├── env_helper.rb │ │ ├── exception_cause_chain.rb │ │ ├── http_tracing.rb │ │ ├── logging_helper.rb │ │ ├── real_ip.rb │ │ ├── request_id.rb │ │ └── uuid.rb │ │ ├── vernier │ │ ├── output.rb │ │ └── profiler.rb │ │ └── version.rb ├── sentry-ruby-core.gemspec ├── sentry-ruby.gemspec └── spec │ ├── contexts │ └── with_request_mock.rb │ ├── fixtures │ └── attachment.txt │ ├── initialization_check_spec.rb │ ├── isolated │ ├── init.rb │ ├── init_spec.rb │ └── puma_spec.rb │ ├── sentry │ ├── background_worker_spec.rb │ ├── backpressure_monitor_spec.rb │ ├── backtrace │ │ └── lines_spec.rb │ ├── backtrace_spec.rb │ ├── baggage_spec.rb │ ├── breadcrumb │ │ ├── http_logger_spec.rb │ │ ├── redis_logger_spec.rb │ │ └── sentry_logger_spec.rb │ ├── breadcrumb_buffer_spec.rb │ ├── breadcrumb_spec.rb │ ├── client │ │ └── event_sending_spec.rb │ ├── client_spec.rb │ ├── configuration_spec.rb │ ├── cron │ │ ├── monitor_check_ins_spec.rb │ │ ├── monitor_config_spec.rb │ │ └── monitor_schedule_spec.rb │ ├── dsn_spec.rb │ ├── envelope │ │ └── item_spec.rb │ ├── event_spec.rb │ ├── excon_spec.rb │ ├── faraday_spec.rb │ ├── graphql_spec.rb │ ├── hub_spec.rb │ ├── integrable_spec.rb │ ├── interface_spec.rb │ ├── interfaces │ │ ├── request_interface_spec.rb │ │ ├── stacktrace_builder_spec.rb │ │ └── stacktrace_spec.rb │ ├── linecache_spec.rb │ ├── log_event_buffer_spec.rb │ ├── log_event_spec.rb │ ├── metrics │ │ ├── aggregator_spec.rb │ │ ├── configuration_spec.rb │ │ ├── counter_metric_spec.rb │ │ ├── distribution_metric_spec.rb │ │ ├── gauge_metric_spec.rb │ │ ├── local_aggregator_spec.rb │ │ ├── metric_spec.rb │ │ ├── set_metric_spec.rb │ │ └── timing_spec.rb │ ├── metrics_spec.rb │ ├── net │ │ └── http_spec.rb │ ├── profiler_spec.rb │ ├── propagation_context_spec.rb │ ├── rack │ │ └── capture_exceptions_spec.rb │ ├── rake_spec.rb │ ├── redis_spec.rb │ ├── rspec │ │ └── matchers_spec.rb │ ├── scope │ │ └── setters_spec.rb │ ├── scope_spec.rb │ ├── session_flusher_spec.rb │ ├── span_spec.rb │ ├── structured_logger_spec.rb │ ├── test_helper_spec.rb │ ├── transaction_spec.rb │ ├── transactions │ │ └── profiler_spec.rb │ ├── transport │ │ ├── configuration_spec.rb │ │ ├── http_transport_rate_limiting_spec.rb │ │ ├── http_transport_spec.rb │ │ └── spotlight_transport_spec.rb │ ├── transport_spec.rb │ ├── utils │ │ ├── real_ip_spec.rb │ │ └── request_id_spec.rb │ └── vernier │ │ └── profiler_spec.rb │ ├── sentry_spec.rb │ ├── spec_helper.rb │ └── support │ ├── Rakefile.rb │ ├── linecache.txt │ ├── profiler.rb │ ├── stackprof_results.json │ └── stacktrace_test_fixture.rb └── sentry-sidekiq ├── .gitignore ├── .rspec ├── .rubocop.yml ├── CHANGELOG.md ├── Gemfile ├── LICENSE.txt ├── Makefile ├── README.md ├── Rakefile ├── bin ├── console └── setup ├── example ├── Gemfile ├── README.md ├── config │ └── sidekiq.yml └── error_worker.rb ├── lib ├── sentry-sidekiq.rb └── sentry │ ├── sidekiq-scheduler │ └── scheduler.rb │ └── sidekiq │ ├── configuration.rb │ ├── context_filter.rb │ ├── cron │ ├── helpers.rb │ └── job.rb │ ├── error_handler.rb │ ├── sentry_context_middleware.rb │ └── version.rb ├── sentry-sidekiq.gemspec └── spec ├── fixtures ├── sidekiq-cron-schedule.yml └── sidekiq-scheduler-schedule.yml ├── sentry ├── rails_spec.rb ├── sidekiq-scheduler │ └── scheduler_spec.rb ├── sidekiq │ ├── configuration_spec.rb │ ├── context_filter_spec.rb │ ├── cron │ │ └── job_spec.rb │ ├── error_handler_spec.rb │ └── sentry_context_middleware_spec.rb └── sidekiq_spec.rb └── spec_helper.rb /.craft.yml: -------------------------------------------------------------------------------- 1 | minVersion: '1.8.1' 2 | changelogPolicy: simple 3 | preReleaseCommand: ruby .scripts/batch_release.rb 4 | requireNames: 5 | - /^sentry-ruby-.*\.gem$/ 6 | - /^sentry-ruby-core-.*\.gem$/ 7 | - /^sentry-rails-.*\.gem$/ 8 | - /^sentry-sidekiq-.*\.gem$/ 9 | - /^sentry-resque-.*\.gem$/ 10 | - /^sentry-delayed_job-.*\.gem$/ 11 | - /^sentry-opentelemetry-.*\.gem$/ 12 | targets: 13 | - name: gem 14 | - name: registry 15 | sdks: 16 | 'gem:sentry-ruby': 17 | 'gem:sentry-ruby-core': 18 | 'gem:sentry-rails': 19 | 'gem:sentry-sidekiq': 20 | 'gem:sentry-delayed_job': 21 | 'gem:sentry-opentelemetry': 22 | 'gem:sentry-resque': 23 | - name: github 24 | -------------------------------------------------------------------------------- /.devcontainer/.env.example: -------------------------------------------------------------------------------- 1 | IMAGE=bitnami/ruby 2 | 3 | # Adjust as needed 4 | TAG=3.4 5 | 6 | # IMAGE=jruby 7 | # TAG=latest 8 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sentry-ruby", 3 | "dockerComposeFile": "docker-compose.yml", 4 | "service": "app", 5 | "workspaceFolder": "/workspace/sentry-ruby", 6 | "customizations": { 7 | "vscode": { 8 | "extensions": [ 9 | "sleistner.vscode-fileutils", 10 | "Shopify.ruby-lsp" 11 | ], 12 | "settings": {} 13 | }, 14 | "rubyLsp.rubyVersionManager": { 15 | "identifier": "none" 16 | } 17 | }, 18 | "remoteUser": "sentry", 19 | "postCreateCommand": "ruby --version" 20 | } 21 | -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | app: 3 | build: 4 | context: . 5 | dockerfile: Dockerfile 6 | args: 7 | IMAGE: ${IMAGE} 8 | TAG: ${TAG} 9 | volumes: 10 | - ..:/workspace/sentry-ruby:cached 11 | command: sleep infinity 12 | environment: 13 | - REDIS_URL=${REDIS_URL:-redis://redis:6379/0} 14 | depends_on: 15 | - redis 16 | 17 | redis: 18 | image: redis:latest 19 | environment: 20 | - ALLOW_EMPTY_PASSWORD=yes 21 | ports: 22 | - "6379:6379" 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 📚 SDK Documentation 4 | url: https://docs.sentry.io/platforms/ruby/ 5 | about: Check the SDK's documentation 6 | 7 | - name: 📚 SDK API Documentation 8 | url: https://www.rubydoc.info/gems/sentry-ruby-core/Sentry 9 | about: Check the SDK's API documentation 10 | 11 | - name: 💬 Community Discord 12 | url: https://discord.gg/PXa5Apfe7K 13 | about: Ping us on Discord if you have questions 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/maintainer-blank.yml: -------------------------------------------------------------------------------- 1 | name: Blank Issue 2 | description: Blank Issue. Reserved for maintainers. 3 | labels: ["Ruby"] 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description 9 | description: Please describe the issue. 10 | validations: 11 | required: true 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "bundler" 4 | schedule: 5 | interval: "daily" 6 | allow: 7 | - dependency-type: "direct" 8 | directories: 9 | - "sentry-delayed_job" 10 | - "sentry-opentelemetry" 11 | - "sentry-rails" 12 | - "sentry-ruby" 13 | - "sentry-resque" 14 | - "sentry-sidekiq" 15 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Thanks for your Pull Request 🎉 2 | 3 | **Please keep these instructions in mind so we can review it more efficiently:** 4 | 5 | - Add the references of all the related issues/PRs in the description 6 | - Whether it's a new feature or a bug fix, make sure they're covered by new test cases 7 | - If this PR contains any refactoring work, please give it its own commit(s) 8 | - Finally, please add an entry to the corresponding changelog 9 | 10 | 11 | **Other Notes** 12 | - We squash all commits before merging 13 | - We generally review new PRs within a week 14 | - If you have any question, you can ask for feedback in our [discord community](https://discord.gg/Ww9hbqr) first 15 | 16 | ## Description 17 | Describe your changes: 18 | -------------------------------------------------------------------------------- /.github/workflows/build_batch_release.yml: -------------------------------------------------------------------------------- 1 | name: Build Batch Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - release/** 7 | jobs: 8 | build: 9 | name: Build gems 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Set up Ruby 14 | uses: ruby/setup-ruby@v1 15 | with: 16 | ruby-version: 3.4 17 | - name: Build gem source 18 | run: ruby .scripts/batch_build.rb 19 | - name: Archive Artifacts 20 | uses: actions/upload-artifact@v4 21 | with: 22 | name: ${{ github.sha }} 23 | path: sentry*/*.gem 24 | -------------------------------------------------------------------------------- /.github/workflows/danger.yml: -------------------------------------------------------------------------------- 1 | name: Danger 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, reopened, edited, ready_for_review] 6 | 7 | jobs: 8 | danger: 9 | uses: getsentry/github-workflows/.github/workflows/danger.yml@v2 10 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | pull_request: 5 | jobs: 6 | lint: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - name: Set up Ruby 11 | uses: ruby/setup-ruby@v1 12 | with: 13 | ruby-version: "3.4" 14 | bundler-cache: true 15 | - name: Run rubocop 16 | run: bundle exec rubocop 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | pkg 3 | tmp 4 | ruby/ 5 | log/ 6 | .bundle 7 | *.gem 8 | gemfiles/*.lock 9 | Gemfile.lock 10 | .coveralls.yml 11 | .ruby-version 12 | .ruby-gemset 13 | .idea 14 | *.rdb 15 | .rgignore 16 | 17 | examples/**/node_modules 18 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_gem: 2 | rubocop-rails-omakase: rubocop.yml 3 | 4 | Layout/SpaceInsideArrayLiteralBrackets: 5 | Enabled: false 6 | 7 | Layout/EmptyLineAfterMagicComment: 8 | Enabled: true 9 | 10 | Style/FrozenStringLiteralComment: 11 | Enabled: true 12 | 13 | Style/RedundantFreeze: 14 | Enabled: true 15 | 16 | AllCops: 17 | Exclude: 18 | - "sentry-raven/**/*" 19 | - "sentry-*/tmp/**/*" 20 | - "sentry-*/examples/**/*" 21 | - "sentry-*/spec/versioned/2.7/**/*" 22 | -------------------------------------------------------------------------------- /.scripts/batch_build.rb: -------------------------------------------------------------------------------- 1 | INTEGRATIONS = %w(sentry-rails sentry-sidekiq sentry-delayed_job sentry-resque sentry-opentelemetry) 2 | GEMS = %w(sentry-ruby) + INTEGRATIONS 3 | 4 | success = GEMS.map do |gem_name| 5 | puts(`cd #{gem_name}; make build`) 6 | $?.success? 7 | end.all? 8 | 9 | exit success ? 0 : 1 10 | -------------------------------------------------------------------------------- /.scripts/bump-version.rb: -------------------------------------------------------------------------------- 1 | ref_name = `git branch --show-current` 2 | sdk_name_capture_regex = /release-(sentry-\w+)\/.*/ 3 | 4 | file_name = 5 | if sdk_name_match = ref_name.match(sdk_name_capture_regex) 6 | case sdk_name = sdk_name_match[1] 7 | when "sentry-ruby" 8 | "lib/sentry/version.rb" 9 | else 10 | integration_name = sdk_name.sub("sentry-", "") 11 | "lib/sentry/#{integration_name}/version.rb" 12 | end 13 | else 14 | # old SDK 15 | "lib/raven/version.rb" 16 | end 17 | 18 | text = File.read(file_name) 19 | new_contents = text.gsub(/VERSION = ".*"/, "VERSION = \"#{ARGV[1]}\"") 20 | File.open(file_name, "w") {|file| file.puts new_contents } 21 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "shopify.ruby-lsp", 4 | "koichisasada.vscode-rdbg" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[ruby]": { 3 | "editor.tabSize": 2, 4 | "editor.insertSpaces": true, 5 | // ruby-lsp's formatOnSave uses syntax-tree's rules, which may not be the rules we want 6 | "editor.formatOnSave": false, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /MIGRATION.md: -------------------------------------------------------------------------------- 1 | # Migrating from sentry-raven to sentry-ruby 2 | 3 | This document has been deprecated and moved to https://docs.sentry.io/platforms/ruby/migration. 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | sentry-ruby/README.md -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | disable_default_path_fixes: true 3 | notify: 4 | manual_trigger: true 5 | ignore: 6 | - "**/spec/**" 7 | comment: 8 | layout: "header, diff, flags, components, tree" 9 | component_management: 10 | individual_components: 11 | - component_id: "sentry-ruby" 12 | paths: 13 | - "sentry-ruby/" 14 | - component_id: "sentry-rails" 15 | paths: 16 | - "sentry-rails/" 17 | - component_id: "sentry-sidekiq" 18 | paths: 19 | - "sentry-sidekiq/" 20 | - component_id: "sentry-resque" 21 | paths: 22 | - "sentry-resque/" 23 | - component_id: "sentry-delayed_job" 24 | paths: 25 | - "sentry-delayed_job/" 26 | - component_id: "sentry-opentelemetry" 27 | paths: 28 | - "sentry-opentelemetry/" 29 | -------------------------------------------------------------------------------- /sentry-delayed_job/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /tmp/ 9 | 10 | # rspec failure tracking 11 | .rspec_status 12 | -------------------------------------------------------------------------------- /sentry-delayed_job/.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | -------------------------------------------------------------------------------- /sentry-delayed_job/.rubocop.yml: -------------------------------------------------------------------------------- 1 | ../.rubocop.yml -------------------------------------------------------------------------------- /sentry-delayed_job/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-delayed_job.gemspec 4 | -------------------------------------------------------------------------------- /sentry-delayed_job/Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "bundler/gem_tasks" 4 | require "rspec/core/rake_task" 5 | 6 | RSpec::Core::RakeTask.new(:spec).tap do |task| 7 | task.rspec_opts = "--order rand" 8 | end 9 | 10 | task default: :spec 11 | -------------------------------------------------------------------------------- /sentry-delayed_job/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "sentry/ruby" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /sentry-delayed_job/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /sentry-delayed_job/example/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "rails" 6 | gem "sqlite3" 7 | gem "delayed_job" 8 | gem 'delayed_job_active_record' 9 | gem "sentry-delayed_job", path: "../" 10 | gem "sentry-ruby", path: "../../sentry-ruby" 11 | 12 | gem "debug", github: "ruby/debug" 13 | -------------------------------------------------------------------------------- /sentry-delayed_job/lib/sentry/delayed_job/configuration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class Configuration 5 | attr_reader :delayed_job 6 | 7 | add_post_initialization_callback do 8 | @delayed_job = Sentry::DelayedJob::Configuration.new 9 | end 10 | end 11 | 12 | module DelayedJob 13 | class Configuration 14 | # Set this option to true if you want Sentry to only capture the last job 15 | # retry if it fails. 16 | attr_accessor :report_after_job_retries 17 | 18 | def initialize 19 | @report_after_job_retries = false 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /sentry-delayed_job/lib/sentry/delayed_job/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module DelayedJob 5 | VERSION = "5.24.0" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-delayed_job/spec/sentry/delayed_job/configuration_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "spec_helper" 4 | 5 | RSpec.describe Sentry::DelayedJob::Configuration do 6 | it "adds #delayed_job option to Sentry::Configuration" do 7 | config = Sentry::Configuration.new 8 | 9 | expect(config.delayed_job).to be_a(described_class) 10 | end 11 | 12 | describe "#report_after_job_retries" do 13 | it "has correct default value" do 14 | expect(subject.report_after_job_retries).to eq(false) 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /sentry-opentelemetry/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /tmp/ 9 | 10 | # rspec failure tracking 11 | .rspec_status 12 | -------------------------------------------------------------------------------- /sentry-opentelemetry/.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | --require spec_helper 4 | -------------------------------------------------------------------------------- /sentry-opentelemetry/.rubocop.yml: -------------------------------------------------------------------------------- 1 | ../.rubocop.yml -------------------------------------------------------------------------------- /sentry-opentelemetry/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | git_source(:github) { |name| "https://github.com/#{name}.git" } 5 | 6 | eval_gemfile "../Gemfile" 7 | 8 | # Specify your gem's dependencies in sentry-ruby.gemspec 9 | gemspec 10 | 11 | gem "ostruct" if RUBY_VERSION >= "3.4" 12 | 13 | gem "opentelemetry-sdk" 14 | gem "opentelemetry-instrumentation-rails" 15 | 16 | gem "sentry-ruby", path: "../sentry-ruby" 17 | -------------------------------------------------------------------------------- /sentry-opentelemetry/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-opentelemetry.gemspec 4 | -------------------------------------------------------------------------------- /sentry-opentelemetry/Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "bundler/gem_tasks" 4 | require "rspec/core/rake_task" 5 | 6 | RSpec::Core::RakeTask.new(:spec).tap do |task| 7 | task.rspec_opts = "--order rand" 8 | end 9 | 10 | task default: :spec 11 | -------------------------------------------------------------------------------- /sentry-opentelemetry/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "sentry/opentelemetry" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /sentry-opentelemetry/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /sentry-opentelemetry/lib/sentry-opentelemetry.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "sentry-ruby" 4 | require "opentelemetry-sdk" 5 | 6 | require "sentry/opentelemetry/version" 7 | require "sentry/opentelemetry/span_processor" 8 | require "sentry/opentelemetry/propagator" 9 | -------------------------------------------------------------------------------- /sentry-opentelemetry/lib/sentry/opentelemetry/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module OpenTelemetry 5 | VERSION = "5.24.0" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /spec/dummy/test_rails_app/db* 9 | /tmp/ 10 | 11 | # rspec failure tracking 12 | .rspec_status 13 | -------------------------------------------------------------------------------- /sentry-rails/.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | --require spec_helper 4 | -------------------------------------------------------------------------------- /sentry-rails/.rubocop.yml: -------------------------------------------------------------------------------- 1 | ../.rubocop.yml -------------------------------------------------------------------------------- /sentry-rails/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-rails.gemspec 4 | -------------------------------------------------------------------------------- /sentry-rails/benchmarks/application.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "active_support/all" 4 | require "action_controller" 5 | require_relative "../spec/support/test_rails_app/app" 6 | 7 | def create_app(&block) 8 | app = make_basic_app(&block) 9 | 10 | session = ActionDispatch::Integration::Session.new(app) 11 | session.host! "www.example.com" 12 | session.extend(app.routes.url_helpers) 13 | session.extend(app.routes.mounted_helpers) 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "sentry/ruby" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /sentry-rails/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore Byebug command history file. 21 | .byebug_history 22 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/assets/javascripts/posts.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/assets/stylesheets/posts.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the posts controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-5.2/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | 1 / 0 4 | end 5 | 6 | def report_demo 7 | render(status: 500) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/helpers/posts_helper.rb: -------------------------------------------------------------------------------- 1 | module PostsHelper 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-5.2/app/models/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/models/post.rb: -------------------------------------------------------------------------------- 1 | class Post < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rails50 5 | <%= csrf_meta_tags %> 6 | 7 | 8 | 15 | 16 | 17 | 18 | <%= yield %> 19 | 20 | 21 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with(model: post, local: true) do |form| %> 2 | <% if post.errors.any? %> 3 |
4 |

<%= pluralize(post.errors.count, "error") %> prohibited this post from being saved:

5 | 6 | 11 |
12 | <% end %> 13 | 14 |
15 | <%= form.label :title %> 16 | <%= form.text_field :title %> 17 |
18 | 19 |
20 | <%= form.label :content %> 21 | <%= form.text_area :content %> 22 |
23 | 24 |
25 | <%= form.submit %> 26 |
27 | <% end %> 28 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/_post.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! post, :id, :title, :content, :created_at, :updated_at 2 | json.url post_url(post, format: :json) 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editing Post

2 | 3 | <%= render 'form', post: @post %> 4 | 5 | <%= link_to 'Show', @post %> | 6 | <%= link_to 'Back', posts_path %> 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Posts

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% @posts.each do |post| %> 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <% end %> 24 | 25 |
TitleContent
<%= post.title %><%= post.content %><%= link_to 'Show', post %><%= link_to 'Edit', edit_post_path(post) %><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %>
26 | 27 |
28 | 29 | <%= link_to 'New Post', new_post_path %> 30 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @posts, partial: "posts/post", as: :post 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Post

2 | 3 | <%= render 'form', post: @post %> 4 | 5 | <%= link_to 'Back', posts_path %> 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

4 | Title: 5 | <%= @post.title %> 6 |

7 | 8 |

9 | Content: 10 | <%= @post.content %> 11 |

12 | 13 | <%= link_to 'Edit', edit_post_path(@post) %> | 14 | <%= link_to 'Back', posts_path %> 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/posts/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "posts/post", post: @post 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/app/views/welcome/report_demo.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Internal Server Error 5 | 6 | 7 | 8 |

Internal Server Error

9 | 10 |

='(

11 | 12 | <% if @sentry_event_id %> 13 | 19 | <% end %> 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) 11 | Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } 12 | gem 'spring', match[1] 13 | require 'spring/binstub' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module Rails50 10 | class Application < Rails::Application 11 | # https://github.com/getsentry/raven-ruby/issues/494 12 | config.exceptions_app = self.routes 13 | 14 | # With this enabled 'exceptions_app' isnt executed, so instead we 15 | # set ``config.consider_all_requests_local = false`` in development. 16 | # config.action_dispatch.show_exceptions = false 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/sentry.rb: -------------------------------------------------------------------------------- 1 | Sentry.init do |config| 2 | config.breadcrumbs_logger = [:active_support_logger] 3 | config.send_default_pii = true 4 | config.traces_sample_rate = 1.0 # set a float between 0.0 and 1.0 to enable performance monitoring 5 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 6 | config.release = `git branch --show-current` 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_rails-5_0_session' 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | resources :posts 3 | root to: "welcome#index" 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/db/migrate/20210112160711_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | t.text :content 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-5.2/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-5.2/public/apple-touch-icon.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-5.2/public/favicon.ico -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/test/fixtures/posts.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | title: MyString 5 | content: MyText 6 | 7 | two: 8 | title: MyString 9 | content: MyText 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-5.2/test/models/post_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/app/assets/images/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/assets/stylesheets/posts.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the posts controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/channels/appearance_channel.rb: -------------------------------------------------------------------------------- 1 | class AppearanceChannel < ApplicationCable::Channel 2 | def subscribed 3 | end 4 | 5 | def unsubscribed 6 | end 7 | 8 | def hello 9 | end 10 | 11 | def goodbye(data) 12 | 1 / 0 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | def connect 4 | end 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/delayed_jobs/error_delayed_job.rb: -------------------------------------------------------------------------------- 1 | class ErrorDelayedJob 2 | def self.perform 3 | 1/0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/helpers/posts_helper.rb: -------------------------------------------------------------------------------- 1 | module PostsHelper 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/javascript/channels/consumer.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command. 3 | 4 | import { createConsumer } from "@rails/actioncable" 5 | 6 | export default createConsumer() 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/javascript/channels/index.js: -------------------------------------------------------------------------------- 1 | // Load all the channels within this directory and all subdirectories. 2 | // Channel files must be named *_channel.js. 3 | 4 | const channels = require.context('.', true, /_channel\.js$/) 5 | channels.keys().forEach(channels) 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/jobs/error_job.rb: -------------------------------------------------------------------------------- 1 | class ErrorJob < ApplicationJob 2 | self.queue_adapter = :async 3 | 4 | def perform 5 | a = 1 6 | b = 2 7 | raise "Job failed" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/app/models/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/models/post.rb: -------------------------------------------------------------------------------- 1 | class Post < ApplicationRecord 2 | has_one_attached :cover 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/resque_jobs/raise_error.rb: -------------------------------------------------------------------------------- 1 | class RaiseError 2 | @queue = :default 3 | 4 | def self.perform 5 | 1/0 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rails60 5 | <%= csrf_meta_tags %> 6 | <%= csp_meta_tag %> 7 | 8 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 9 | <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> 10 | 11 | 12 | 13 | <%= yield %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/_post.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! post, :id, :title, :content, :created_at, :updated_at 2 | json.url post_url(post, format: :json) 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editing Post

2 | 3 | <%= render 'form', post: @post %> 4 | 5 | <%= link_to 'Show', @post %> | 6 | <%= link_to 'Back', posts_path %> 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Posts

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% @posts.each do |post| %> 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <% end %> 24 | 25 |
TitleContent
<%= post.title %><%= post.content %><%= link_to 'Show', post %><%= link_to 'Edit', edit_post_path(post) %><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %>
26 | 27 |
28 | 29 | <%= link_to 'New Post', new_post_path %> 30 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @posts, partial: "posts/post", as: :post 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Post

2 | 3 | <%= render 'form', post: @post %> 4 | 5 | <%= link_to 'Back', posts_path %> 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

4 | Title: 5 | <%= @post.title %> 6 |

7 | 8 |

9 | Content: 10 | <%= @post.content %> 11 |

12 | 13 |

14 | Cover: 15 | <%= image_tag @post.cover.variant(resize_to_limit: [100, 100]) %> 16 |

17 | 18 | <%= link_to 'Edit', edit_post_path(@post) %> | 19 | <%= link_to 'Back', posts_path %> 20 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/posts/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "posts/post", post: @post 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/welcome/appearance.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/welcome/report_demo.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Internal Server Error 5 | 6 | 7 | 8 |

Internal Server Error

9 | 10 |

='(

11 | 12 | <% if @sentry_event_id %> 13 | 19 | <% end %> 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/views/welcome/view_error.html.erb: -------------------------------------------------------------------------------- 1 | hey <%= foo %> 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/app/workers/error_worker.rb: -------------------------------------------------------------------------------- 1 | class ErrorWorker 2 | include Sidekiq::Worker 3 | sidekiq_options retry: false 4 | 5 | def perform 6 | a = 1 7 | raise "Worker failed" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/delayed_job: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) 4 | require 'delayed/command' 5 | Delayed::Command.new(ARGV).daemonize 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads Spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == 'spring' } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/webpack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/webpack_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::WebpackRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/webpack-dev-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/dev_server_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::DevServerRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | begin 5 | exec "yarnpkg", *ARGV 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: rails_6_0_production 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | hDXHlKlYVp8a2hbUQivxYb2pDDtIRbzhkcRR0Xj8a3AYwFdRYHQ3DHqyvKsUGKZAddX8M9cEZ7RdPOZ2OO5szycKkecUKsgXgMjk645FdklX8p+oLAXgTkobTJZ90B6Bhkwm+Rf5of8cPSFDRwC+G0DwmiRnKy833BXFm2kxpiOmjtl8f9nzHmaT8ojK34ZdNiOOQOnr7MAjZwF0uGq6hYNqIbCF9Gz1v7+iICFM26mPOU+K3Fo9KVGQ23nx5m0VENpv97Dvo0cklrto3DEK6E9lH2FPecBD1sdIn/bYkIST7jhxT8JRYs3JwEdt8PyTYOBhH2WiZVNcJiBzTsbt5iCj7ggLscVyGe8/99GmY3/L/ZP+7bhFztZP/yF30oW61xy/jE8W+kkfguAV3i6KeMNFRj5YmSusRSxu--2uC96PHVlR9eYeAb--vADqgojfdxPaeOcD4js7xA== -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/delayed_job.rb: -------------------------------------------------------------------------------- 1 | Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log')) 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/resque.rb: -------------------------------------------------------------------------------- 1 | Resque.logger = Logger.new("#{Rails.root}/log/resque.log") 2 | Resque.logger.level = Logger::DEBUG 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/sentry.rb: -------------------------------------------------------------------------------- 1 | Sentry.init do |config| 2 | config.breadcrumbs_logger = [:active_support_logger] 3 | config.background_worker_threads = 0 4 | config.send_default_pii = true 5 | config.traces_sample_rate = 1.0 # set a float between 0.0 and 1.0 to enable performance monitoring 6 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 7 | config.release = `git branch --show-current` 8 | config.capture_exception_frame_locals = true 9 | # you can use the pre-defined job for the async callback 10 | # 11 | # config.async = lambda do |event, hint| 12 | # Sentry::SendEventJob.perform_later(event, hint) 13 | # end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/routes.rb: -------------------------------------------------------------------------------- 1 | require "resque/server" 2 | 3 | Rails.application.routes.draw do 4 | resources :posts 5 | get '500', to: 'welcome#report_demo' 6 | root to: "welcome#index" 7 | 8 | get 'appearance', to: 'welcome#appearance' 9 | get 'connect_trace', to: 'welcome#connect_trace' 10 | get 'view_error', to: 'welcome#view_error' 11 | get 'sidekiq_error', to: 'welcome#sidekiq_error' 12 | get 'resque_error', to: 'welcome#resque_error' 13 | get 'delayed_job_error', to: 'welcome#delayed_job_error' 14 | get 'job_error', to: 'welcome#job_error' 15 | 16 | require 'sidekiq/web' 17 | 18 | mount Sidekiq::Web => '/sidekiq' 19 | mount Resque::Server.new, at: "/resque" 20 | end 21 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/unicorn.rb: -------------------------------------------------------------------------------- 1 | worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) 2 | timeout 200 3 | preload_app true 4 | 5 | before_fork do |server, worker| 6 | Signal.trap 'TERM' do 7 | puts 'Unicorn master intercepting TERM and sending myself QUIT instead' 8 | Process.kill 'QUIT', Process.pid 9 | end 10 | 11 | defined?(ActiveRecord::Base) and 12 | ActiveRecord::Base.connection.disconnect! 13 | end 14 | 15 | after_fork do |server, worker| 16 | Signal.trap 'TERM' do 17 | puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' 18 | end 19 | 20 | defined?(ActiveRecord::Base) and 21 | ActiveRecord::Base.establish_connection 22 | end 23 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/webpack/development.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/webpack/environment.js: -------------------------------------------------------------------------------- 1 | const { environment } = require('@rails/webpacker') 2 | 3 | module.exports = environment 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/webpack/production.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'production' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/config/webpack/test.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/db/migrate/20201120074001_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | t.text :content 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/lib/assets/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/lib/tasks/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/lib/tasks/resque.rake: -------------------------------------------------------------------------------- 1 | require 'resque/tasks' 2 | task "resque:setup" => :environment 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rails_6_0", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/actioncable": "^6.0.0-alpha", 6 | "@rails/activestorage": "^6.0.0-alpha", 7 | "@rails/ujs": "^6.0.0-alpha", 8 | "@rails/webpacker": "4.2.2", 9 | "turbolinks": "^5.2.0" 10 | }, 11 | "version": "0.1.0", 12 | "devDependencies": { 13 | "webpack-dev-server": "^3.11.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/public/apple-touch-icon.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/public/favicon.ico -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/storage/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/controllers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/fixtures/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/fixtures/files/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/fixtures/posts.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | title: MyString 5 | content: MyText 6 | 7 | two: 8 | title: MyString 9 | content: MyText 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/helpers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/integration/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/mailers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/models/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/models/post_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/test/system/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative '../config/environment' 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-6.0/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-6.0/vendor/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark any vendored files as having been vendored. 7 | vendor/* linguist-vendored 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/app/assets/images/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/assets/stylesheets/posts.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the posts controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/channels/appearance_channel.rb: -------------------------------------------------------------------------------- 1 | class AppearanceChannel < ApplicationCable::Channel 2 | def subscribed 3 | end 4 | 5 | def unsubscribed 6 | end 7 | 8 | def hello 9 | end 10 | 11 | def goodbye(data) 12 | 1 / 0 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | def connect 4 | end 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/delayed_jobs/error_delayed_job.rb: -------------------------------------------------------------------------------- 1 | class ErrorDelayedJob 2 | def self.perform 3 | 1/0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/helpers/posts_helper.rb: -------------------------------------------------------------------------------- 1 | module PostsHelper 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/javascript/channels/consumer.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command. 3 | 4 | import { createConsumer } from "@rails/actioncable" 5 | 6 | export default createConsumer() 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/javascript/channels/index.js: -------------------------------------------------------------------------------- 1 | // Load all the channels within this directory and all subdirectories. 2 | // Channel files must be named *_channel.js. 3 | 4 | const channels = require.context('.', true, /_channel\.js$/) 5 | channels.keys().forEach(channels) 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/jobs/error_job.rb: -------------------------------------------------------------------------------- 1 | class ErrorJob < ApplicationJob 2 | self.queue_adapter = :async 3 | 4 | def perform 5 | a = 1 6 | b = 2 7 | raise "Job failed" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/app/models/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/models/post.rb: -------------------------------------------------------------------------------- 1 | class Post < ApplicationRecord 2 | has_one_attached :cover 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/resque_jobs/raise_error.rb: -------------------------------------------------------------------------------- 1 | class RaiseError 2 | @queue = :default 3 | 4 | def self.perform 5 | 1/0 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rails60 5 | <%= csrf_meta_tags %> 6 | <%= csp_meta_tag %> 7 | 8 | <%# <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %1> %> 9 | <%# <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %1> %> 10 | 11 | 12 | 13 | <%= yield %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/_post.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! post, :id, :title, :content, :created_at, :updated_at 2 | json.url post_url(post, format: :json) 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editing Post

2 | 3 | <%= render 'form', post: @post %> 4 | 5 | <%= link_to 'Show', @post %> | 6 | <%= link_to 'Back', posts_path %> 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Posts

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% @posts.each do |post| %> 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <% end %> 24 | 25 |
TitleContent
<%= post.title %><%= post.content %><%= link_to 'Show', post %><%= link_to 'Edit', edit_post_path(post) %><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %>
26 | 27 |
28 | 29 | <%= link_to 'New Post', new_post_path %> 30 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @posts, partial: "posts/post", as: :post 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Post

2 | 3 | <%= render 'form', post: @post %> 4 | 5 | <%= link_to 'Back', posts_path %> 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

4 | Title: 5 | <%= @post.title %> 6 |

7 | 8 |

9 | Content: 10 | <%= @post.content %> 11 |

12 | 13 |

14 | Cover: 15 | <%= image_tag @post.cover.variant(resize_to_limit: [100, 100]) %> 16 |

17 | 18 | <%= link_to 'Edit', edit_post_path(@post) %> | 19 | <%= link_to 'Back', posts_path %> 20 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/posts/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "posts/post", post: @post 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/welcome/appearance.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/welcome/report_demo.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Internal Server Error 5 | 6 | 7 | 8 |

Internal Server Error

9 | 10 |

='(

11 | 12 | <% if @sentry_event_id %> 13 | 19 | <% end %> 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/views/welcome/view_error.html.erb: -------------------------------------------------------------------------------- 1 | hey <%= foo %> 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/app/workers/error_worker.rb: -------------------------------------------------------------------------------- 1 | class ErrorWorker 2 | include Sidekiq::Worker 3 | sidekiq_options retry: false 4 | 5 | def perform 6 | a = 1 7 | raise "Worker failed" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: example_app_production 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | hMzcp7KTXzFwv/URv0QKZFpTPQ7sm+euY78sT1+HM4blQSEHN2M5t9ngtyOlBFL5BXuOBMOeHeAbieS6cfTbxGszRV3tF4BhyzTF8lxpuCbC3Bz39KRO3Z4SW0PiCmE01v9CryvlL7T9cQ33BAGD+g6j5OfFaKZ01nLsLficUKtPKMSVb98k9a/fEGnmBnNaMQ50qr+uZ3ZEEFwmZdpZXUeONmbaJGPRibLMnrl3C8uD0OmHTVj2SahA+IF7pE3z0U5DY7gMeIr26shuuqbKlV/sPNNeeYctL0vH1B5bq4defA1Oh3/QSntyR4+yNBWeWtvKHa37h8Sx6QOnzuu4JcsLZWzJ2Gxv2vgdTK6ay+b5o/NMMPc3VPrfoq5BKQZa6o6KK47NYD1OeUPB8R+6hikSkxAJdA2waoAp--IMbuQeA4ovMZSNMw--XsI3lyNbL2NLWxm6EGstyw== -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem "sqlite3" 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in the app/assets 11 | # folder are already added. 12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 13 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/initializers/sentry.rb: -------------------------------------------------------------------------------- 1 | Sentry.init do |config| 2 | config.breadcrumbs_logger = [:active_support_logger] 3 | config.background_worker_threads = 0 4 | config.send_default_pii = true 5 | config.traces_sample_rate = 1.0 # set a float between 0.0 and 1.0 to enable performance monitoring 6 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 7 | config.release = `git branch --show-current` 8 | config.capture_exception_frame_locals = true 9 | # you can use the pre-defined job for the async callback 10 | # 11 | # config.async = lambda do |event, hint| 12 | # Sentry::SendEventJob.perform_later(event, hint) 13 | # end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/config/routes.rb: -------------------------------------------------------------------------------- 1 | require "resque/server" 2 | 3 | Rails.application.routes.draw do 4 | resources :posts 5 | get '500', to: 'welcome#report_demo' 6 | root to: "welcome#index" 7 | 8 | get 'appearance', to: 'welcome#appearance' 9 | get 'connect_trace', to: 'welcome#connect_trace' 10 | get 'view_error', to: 'welcome#view_error' 11 | get 'sidekiq_error', to: 'welcome#sidekiq_error' 12 | get 'resque_error', to: 'welcome#resque_error' 13 | get 'delayed_job_error', to: 'welcome#delayed_job_error' 14 | get 'job_error', to: 'welcome#job_error' 15 | 16 | require 'sidekiq/web' 17 | 18 | mount Sidekiq::Web => '/sidekiq' 19 | mount Resque::Server.new, at: "/resque" 20 | end 21 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/db/migrate/20220403110436_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | t.text :content 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) 7 | # Character.create(name: "Luke", movie: movies.first) 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/lib/assets/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/lib/tasks/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/public/apple-touch-icon.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/public/favicon.ico -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/storage/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/controllers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/fixtures/files/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/helpers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/integration/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/mailers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/models/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/test/system/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-7.0/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-7.0/vendor/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark any vendored files as having been vendored. 7 | vendor/* linguist-vendored 8 | config/credentials/*.yml.enc diff=rails_credentials 9 | config/credentials.yml.enc diff=rails_credentials 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: bundler 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | - package-ecosystem: github-actions 9 | directory: "/" 10 | schedule: 11 | interval: daily 12 | open-pull-requests-limit: 10 13 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.kamal/hooks/docker-setup.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Docker set up on $KAMAL_HOSTS..." 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.kamal/hooks/post-deploy.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A sample post-deploy hook 4 | # 5 | # These environment variables are available: 6 | # KAMAL_RECORDED_AT 7 | # KAMAL_PERFORMER 8 | # KAMAL_VERSION 9 | # KAMAL_HOSTS 10 | # KAMAL_ROLE (if set) 11 | # KAMAL_DESTINATION (if set) 12 | # KAMAL_RUNTIME 13 | 14 | echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds" 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.kamal/hooks/post-proxy-reboot.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Rebooted kamal-proxy on $KAMAL_HOSTS" 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.kamal/hooks/pre-proxy-reboot.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Rebooting kamal-proxy on $KAMAL_HOSTS..." 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/.rubocop.yml: -------------------------------------------------------------------------------- 1 | # Omakase Ruby styling for Rails 2 | inherit_gem: { rubocop-rails-omakase: rubocop.yml } 3 | 4 | # Overwrite or add rules to create your own house style 5 | # 6 | # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` 7 | # Layout/SpaceInsideArrayLiteralBrackets: 8 | # Enabled: false 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/app/assets/images/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css. 3 | * 4 | * With Propshaft, assets are served efficiently without preprocessing steps. You can still include 5 | * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard 6 | * cascading order, meaning styles declared later in the document or manifest will override earlier ones, 7 | * depending on specificity. 8 | * 9 | * Consider organizing styles into separate files for maintainability. 10 | */ 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. 3 | allow_browser versions: :modern 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/javascript/application.js: -------------------------------------------------------------------------------- 1 | // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails 2 | import "@hotwired/turbo-rails" 3 | import "controllers" 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/javascript/controllers/application.js: -------------------------------------------------------------------------------- 1 | import { Application } from "@hotwired/stimulus" 2 | 3 | const application = Application.start() 4 | 5 | // Configure Stimulus development experience 6 | application.debug = false 7 | window.Stimulus = application 8 | 9 | export { application } 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/javascript/controllers/hello_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | connect() { 5 | this.element.textContent = "Hello World!" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/javascript/controllers/index.js: -------------------------------------------------------------------------------- 1 | // Import and register all your controllers from the importmap via controllers/**/*_controller 2 | import { application } from "controllers/application" 3 | import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" 4 | eagerLoadControllersFrom("controllers", application) 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/jobs/error_job.rb: -------------------------------------------------------------------------------- 1 | class ErrorJob < ApplicationJob 2 | queue_as :default 3 | 4 | def perform(*args) 5 | foo 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/app/models/concerns/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/app/views/pwa/manifest.json.erb: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rails80", 3 | "icons": [ 4 | { 5 | "src": "/icon.png", 6 | "type": "image/png", 7 | "sizes": "512x512" 8 | }, 9 | { 10 | "src": "/icon.png", 11 | "type": "image/png", 12 | "sizes": "512x512", 13 | "purpose": "maskable" 14 | } 15 | ], 16 | "start_url": "/", 17 | "display": "standalone", 18 | "scope": "/", 19 | "description": "Rails80.", 20 | "theme_color": "red", 21 | "background_color": "red" 22 | } 23 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/brakeman: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | require "bundler/setup" 4 | 5 | ARGV.unshift("--ensure-latest") 6 | 7 | load Gem.bin_path("brakeman", "brakeman") 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | exec "./bin/rails", "server", *ARGV 3 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/docker-entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Enable jemalloc for reduced memory usage and latency. 4 | if [ -z "${LD_PRELOAD+x}" ]; then 5 | LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit) 6 | export LD_PRELOAD 7 | fi 8 | 9 | # If running the rails server then create or migrate existing database 10 | if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then 11 | ./bin/rails db:prepare 12 | fi 13 | 14 | exec "${@}" 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/importmap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/application" 4 | require "importmap/commands" 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/jobs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/environment" 4 | require "solid_queue/cli" 5 | 6 | SolidQueue::Cli.start(ARGV) 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/rubocop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | require "bundler/setup" 4 | 5 | # explicit rubocop config increases performance slightly while avoiding config confusion. 6 | ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) 7 | 8 | load Gem.bin_path("rubocop", "rubocop") 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/bin/thrust: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | require "bundler/setup" 4 | 5 | load Gem.bin_path("thruster", "thrust") 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/cable.yml: -------------------------------------------------------------------------------- 1 | # Async adapter only works within the same process, so for manually triggering cable updates from a console, 2 | # and seeing results in the browser, you must do so from the web console (running inside the dev process), 3 | # not a terminal started via bin/rails console! Add "console" to any action or any ERB template view 4 | # to make the web console appear. 5 | development: 6 | adapter: async 7 | 8 | test: 9 | adapter: test 10 | 11 | production: 12 | adapter: solid_cable 13 | connects_to: 14 | database: 15 | writing: cable 16 | polling_interval: 0.1.seconds 17 | message_retention: 1.day 18 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/cache.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | store_options: 3 | # Cap age of oldest cache entry to fulfill retention policies 4 | # max_age: <%= 60.days.to_i %> 5 | max_size: <%= 256.megabytes %> 6 | namespace: <%= Rails.env %> 7 | 8 | development: 9 | <<: *default 10 | 11 | test: 12 | <<: *default 13 | 14 | production: 15 | database: cache 16 | <<: *default 17 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | E+SIdgyaMdcLJJ1uDfpAixhzBM/NtLAAAei4QsxywnDDfUHLO/Xt0Epk8rFz2v4B3NBBjj04p08rDLSxIzOLHZC5rbknqTt7gpqkPwtxrnaqml7hOI6H/NKg4ORBppsw3uksdTwwxZHz7ZMj+wAycf4bbiSnnyRikAffxCy93ckZBeGTj7c11laGzF+M1hGPsFZn7vU2ZqTYGXBNE+zw3Dh3Uhg8CeyyKk02O5x06StyeLLOIsXVM3KoFnyORn2NxLerFOHueXFAEDZKQnnVxaYxXuAkBBEOVVh7SGHbJOXqWoSxnqKhVg92+apQFsCnjkjEJ6bUONtym3an1K+T43GsTOzAhGKPT+u0+fDYgZEC7nscOjekPJTPxR9sjVEelaQHmOCCzgvUio0jxsMc+ecDFq3MUmoxz7ofG27IvzwWSTJETJMzOcukOePxfaXt8BHiQ80Vkm0EgAz6jMcFGPxqb06vHeCll206/x3gENKd0cOr0rK0vl1t--nfjbRzwAXJP+xi5h--t+Gj+uuKI40mdFBWYeGHKg== -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/importmap.rb: -------------------------------------------------------------------------------- 1 | # Pin npm packages by running ./bin/importmap 2 | 3 | pin "application" 4 | pin "@hotwired/turbo-rails", to: "turbo.min.js" 5 | pin "@hotwired/stimulus", to: "stimulus.min.js" 6 | pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" 7 | pin_all_from "app/javascript/controllers", under: "controllers" 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. 4 | # Use this to limit dissemination of sensitive information. 5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc 8 | ] 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/initializers/sentry.rb: -------------------------------------------------------------------------------- 1 | Sentry.init do |config| 2 | config.breadcrumbs_logger = [:active_support_logger] 3 | config.background_worker_threads = 0 4 | config.send_default_pii = true 5 | config.traces_sample_rate = 1.0 # set a float between 0.0 and 1.0 to enable performance monitoring 6 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 7 | config.release = `git branch --show-current` 8 | end 9 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/queue.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | dispatchers: 3 | - polling_interval: 1 4 | batch_size: 500 5 | workers: 6 | - queues: "*" 7 | threads: 3 8 | processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> 9 | polling_interval: 0.1 10 | 11 | development: 12 | <<: *default 13 | 14 | test: 15 | <<: *default 16 | 17 | production: 18 | <<: *default 19 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/recurring.yml: -------------------------------------------------------------------------------- 1 | # production: 2 | # periodic_cleanup: 3 | # class: CleanSoftDeletedRecordsJob 4 | # queue: background 5 | # args: [ 1000, { batch_size: 500 } ] 6 | # schedule: every hour 7 | # periodic_command: 8 | # command: "SoftDeletedRecord.due.delete_all" 9 | # priority: 2 10 | # schedule: at 5am every day 11 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html 3 | 4 | # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. 5 | # Can be used by load balancers and uptime monitors to verify that the app is live. 6 | get "up" => "rails/health#show", as: :rails_health_check 7 | 8 | # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb) 9 | # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest 10 | # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker 11 | 12 | # Defines the root path route ("/") 13 | # root "posts#index" 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/db/cable_schema.rb: -------------------------------------------------------------------------------- 1 | ActiveRecord::Schema[7.1].define(version: 1) do 2 | create_table "solid_cable_messages", force: :cascade do |t| 3 | t.binary "channel", limit: 1024, null: false 4 | t.binary "payload", limit: 536870912, null: false 5 | t.datetime "created_at", null: false 6 | t.integer "channel_hash", limit: 8, null: false 7 | t.index ["channel"], name: "index_solid_cable_messages_on_channel" 8 | t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash" 9 | t.index ["created_at"], name: "index_solid_cable_messages_on_created_at" 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/db/cache_schema.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ActiveRecord::Schema[7.2].define(version: 1) do 4 | create_table "solid_cache_entries", force: :cascade do |t| 5 | t.binary "key", limit: 1024, null: false 6 | t.binary "value", limit: 536870912, null: false 7 | t.datetime "created_at", null: false 8 | t.integer "key_hash", limit: 8, null: false 9 | t.integer "byte_size", limit: 4, null: false 10 | t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size" 11 | t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size" 12 | t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should ensure the existence of records required to run the application in every environment (production, 2 | # development, test). The code here should be idempotent so that it can be executed at any point in every environment. 3 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 4 | # 5 | # Example: 6 | # 7 | # ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| 8 | # MovieGenre.find_or_create_by!(name: genre_name) 9 | # end 10 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/lib/tasks/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/public/icon.png -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/public/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/script/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/script/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/storage/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] 5 | end 6 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/controllers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/fixtures/files/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/helpers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/integration/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/jobs/error_job_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ErrorJobTest < ActiveJob::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/mailers/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/models/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/test/system/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | module ActiveSupport 6 | class TestCase 7 | # Run tests in parallel with specified workers 8 | parallelize(workers: :number_of_processors) 9 | 10 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 11 | fixtures :all 12 | 13 | # Add more helper methods to be used by all tests here... 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/vendor/.keep -------------------------------------------------------------------------------- /sentry-rails/examples/rails-8.0/vendor/javascript/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/examples/rails-8.0/vendor/javascript/.keep -------------------------------------------------------------------------------- /sentry-rails/lib/sentry-rails.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "sentry/rails/version" 4 | require "sentry/rails" 5 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "rails" 4 | require "sentry-ruby" 5 | require "sentry/integrable" 6 | require "sentry/rails/tracing" 7 | require "sentry/rails/configuration" 8 | require "sentry/rails/engine" 9 | require "sentry/rails/railtie" 10 | 11 | module Sentry 12 | module Rails 13 | extend Integrable 14 | register_integration name: "rails", version: Sentry::Rails::VERSION 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails/background_worker.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class BackgroundWorker 5 | def _perform(&block) 6 | block.call 7 | ensure 8 | # some applications have partial or even no AR connection 9 | if ActiveRecord::Base.connected? 10 | # make sure the background worker returns AR connection if it accidentally acquire one during serialization 11 | ActiveRecord::Base.connection_pool.release_connection 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails/controller_methods.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Rails 5 | module ControllerMethods 6 | def capture_message(message, options = {}) 7 | with_request_scope do 8 | Sentry::Rails.capture_message(message, **options) 9 | end 10 | end 11 | 12 | def capture_exception(exception, options = {}) 13 | with_request_scope do 14 | Sentry::Rails.capture_exception(exception, **options) 15 | end 16 | end 17 | 18 | private 19 | 20 | def with_request_scope 21 | Sentry.with_scope do |scope| 22 | scope.set_rack_env(request.env) 23 | yield 24 | end 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails/engine.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class Engine < ::Rails::Engine 5 | isolate_namespace Sentry 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails/instrument_payload_cleanup_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Rails 5 | module InstrumentPayloadCleanupHelper 6 | IGNORED_DATA_TYPES = [:request, :response, :headers, :exception, :exception_object, Tracing::START_TIMESTAMP_NAME] 7 | 8 | def cleanup_data(data) 9 | IGNORED_DATA_TYPES.each do |key| 10 | data.delete(key) if data.key?(key) 11 | end 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails/overrides/streaming_reporter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Rails 5 | module Overrides 6 | module StreamingReporter 7 | def log_error(exception) 8 | Sentry::Rails.capture_exception(exception) 9 | super 10 | end 11 | end 12 | 13 | module OldStreamingReporter 14 | def self.included(base) 15 | base.send(:alias_method_chain, :log_error, :raven) 16 | end 17 | 18 | def log_error_with_raven(exception) 19 | Sentry::Rails.capture_exception(exception) 20 | log_error_without_raven(exception) 21 | end 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /sentry-rails/lib/sentry/rails/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Rails 5 | VERSION = "5.24.0" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/app/assets/config/manifest.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/spec/dummy/test_rails_app/app/assets/config/manifest.js -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/config.ru: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/spec/dummy/test_rails_app/config.ru -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/config/database.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: sqlite3 3 | 4 | test: 5 | <<: *default 6 | database: db 7 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/configs/5-0.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | def run_pre_initialize_cleanup; end 4 | 5 | def configure_app(app); end 6 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/configs/5-2.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "active_storage/engine" 4 | 5 | def run_pre_initialize_cleanup; end 6 | 7 | def configure_app(app) 8 | app.config.active_storage.service = :test 9 | end 10 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/configs/6-0.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "active_storage/engine" 4 | require "action_cable/engine" 5 | 6 | def run_pre_initialize_cleanup 7 | ActionCable::Channel::Base.reset_callbacks(:subscribe) 8 | ActionCable::Channel::Base.reset_callbacks(:unsubscribe) 9 | end 10 | 11 | def configure_app(app) 12 | app.config.active_storage.service = :test 13 | app.config.active_record.sqlite3 = ActiveSupport::OrderedOptions.new 14 | app.config.active_record.sqlite3.represent_boolean_as_integer = nil 15 | end 16 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/configs/6-1.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "active_storage/engine" 4 | require "action_cable/engine" 5 | 6 | def run_pre_initialize_cleanup 7 | ActionCable::Channel::Base.reset_callbacks(:subscribe) 8 | ActionCable::Channel::Base.reset_callbacks(:unsubscribe) 9 | end 10 | 11 | def configure_app(app) 12 | app.config.active_storage.service = :test 13 | end 14 | -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/public/sentry-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/spec/dummy/test_rails_app/public/sentry-logo.png -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/public/static.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getsentry/sentry-ruby/213558f3aa4d8967365dc4c23b9a8128ad9d81e2/sentry-rails/spec/dummy/test_rails_app/public/static.html -------------------------------------------------------------------------------- /sentry-rails/spec/dummy/test_rails_app/test_template.html.erb: -------------------------------------------------------------------------------- 1 | "foo" 2 | -------------------------------------------------------------------------------- /sentry-raven/.craft.yml: -------------------------------------------------------------------------------- 1 | minVersion: '0.13.2' 2 | github: 3 | owner: getsentry 4 | repo: sentry-ruby 5 | changelogPolicy: simple 6 | preReleaseCommand: ruby .scripts/bump-version.rb 7 | releaseBranchPrefix: release-sentry-raven 8 | statusProvider: 9 | name: github 10 | artifactProvider: 11 | name: github 12 | targets: 13 | - name: gem 14 | - name: registry 15 | type: sdk 16 | config: 17 | canonical: 'gem:sentry-raven' 18 | - name: github 19 | tagPrefix: sentry-raven-v 20 | -------------------------------------------------------------------------------- /sentry-raven/.scripts/bump-version.rb: -------------------------------------------------------------------------------- 1 | file_name = "lib/raven/version.rb" 2 | 3 | text = File.read(file_name) 4 | new_contents = text.gsub(/VERSION = ".*"/, "VERSION = \"#{ARGV[1]}\"") 5 | File.open(file_name, "w") {|file| file.puts new_contents } 6 | -------------------------------------------------------------------------------- /sentry-raven/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-raven.gemspec 4 | -------------------------------------------------------------------------------- /sentry-raven/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'raven' 3 | require 'rubygems/package_task' 4 | require 'bundler/gem_tasks' 5 | 6 | gemspec = Gem::Specification.load(Dir['*.gemspec'].first) 7 | 8 | Gem::PackageTask.new(gemspec).define 9 | 10 | begin 11 | require 'rubygems' 12 | require 'rspec/core/rake_task' 13 | 14 | RSpec::Core::RakeTask.new(:spec) do |spec| 15 | spec.pattern = 'spec/**/*_spec.rb' 16 | end 17 | 18 | rescue LoadError 19 | task :spec do 20 | abort "Rspec is not available. bundle install to run unit tests" 21 | end 22 | end 23 | 24 | task :default => [:spec] 25 | -------------------------------------------------------------------------------- /sentry-raven/benchmarks/allocation_report.rb: -------------------------------------------------------------------------------- 1 | require 'benchmark/ips' 2 | require 'benchmark/ipsa' 3 | require 'sentry-raven-without-integrations' 4 | 5 | Raven.configure do |config| 6 | config.logger = Logger.new(nil) 7 | config.dsn = "dummy://12345:67890@sentry.localdomain:3000/sentry/42" 8 | end 9 | 10 | exception = begin 11 | 1/0 12 | rescue => e 13 | e 14 | end 15 | 16 | Raven.capture_exception(exception) 17 | 18 | report = MemoryProfiler.report do 19 | Raven.capture_exception(exception) 20 | end 21 | 22 | report.pretty_print 23 | -------------------------------------------------------------------------------- /sentry-raven/benchmarks/application.rb: -------------------------------------------------------------------------------- 1 | require "active_support/all" 2 | require "action_controller" 3 | require_relative "../spec/support/test_rails_app/app" 4 | 5 | def app(create = false) 6 | @app_integration_instance = nil if create 7 | @app_integration_instance ||= new_session do |sess| 8 | sess.host! "www.example.com" 9 | end 10 | end 11 | 12 | def new_session 13 | app = make_basic_app 14 | session = ActionDispatch::Integration::Session.new(app) 15 | yield session if block_given? 16 | 17 | # This makes app.url_for and app.foo_path available in the console 18 | session.extend(app.routes.url_helpers) 19 | session.extend(app.routes.mounted_helpers) 20 | 21 | session 22 | end 23 | -------------------------------------------------------------------------------- /sentry-raven/benchmarks/rails_integration_allocation_comparison.rb: -------------------------------------------------------------------------------- 1 | require "benchmark/memory" 2 | require 'raven' 3 | require_relative 'application' 4 | 5 | Raven.configure do |config| 6 | config.logger = Logger.new(nil) 7 | config.breadcrumbs_logger = [:active_support_logger] 8 | config.dsn = "dummy://12345:67890@sentry.localdomain:3000/sentry/42" 9 | end 10 | 11 | TestApp.configure do |config| 12 | config.middleware.delete ActionDispatch::DebugExceptions 13 | config.middleware.delete ActionDispatch::ShowExceptions 14 | end 15 | 16 | app.get("/exception") 17 | 18 | Benchmark.memory do |x| 19 | x.report("master") { app.get("/exception") } 20 | x.report("branch") { app.get("/exception") } 21 | 22 | x.compare! 23 | x.hold!("/tmp/allocation_comparison.json") 24 | end 25 | 26 | -------------------------------------------------------------------------------- /sentry-raven/benchmarks/rails_integration_allocation_report.rb: -------------------------------------------------------------------------------- 1 | require 'benchmark/ips' 2 | require 'benchmark/ipsa' 3 | require 'raven' 4 | require 'raven/breadcrumbs/logger' 5 | require_relative 'application' 6 | 7 | Raven.configure do |config| 8 | config.logger = Logger.new(nil) 9 | config.breadcrumbs_logger = [:active_support_logger] 10 | config.dsn = "dummy://12345:67890@sentry.localdomain:3000/sentry/42" 11 | end 12 | 13 | TestApp.configure do |config| 14 | config.middleware.delete ActionDispatch::DebugExceptions 15 | config.middleware.delete ActionDispatch::ShowExceptions 16 | end 17 | 18 | app.get("/exception") 19 | 20 | report = MemoryProfiler.report do 21 | app.get("/exception") 22 | end 23 | 24 | report.pretty_print 25 | -------------------------------------------------------------------------------- /sentry-raven/exe/raven: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "raven" 4 | require "raven/cli" 5 | require "optparse" 6 | 7 | parser = OptionParser.new do |opt| 8 | opt.banner = "Usage: raven COMMAND [OPTIONS]" 9 | opt.separator "" 10 | opt.separator "Commands" 11 | opt.separator " test: send a test event" 12 | opt.separator "" 13 | opt.separator "Options" 14 | 15 | opt.on("-h", "--help", "help") do 16 | puts parser 17 | end 18 | end 19 | 20 | parser.parse! 21 | 22 | case ARGV[0] 23 | when "test" 24 | dsn = ARGV[1] if ARGV.length > 1 25 | if !dsn 26 | puts "Usage: raven test " 27 | else 28 | Raven::CLI.test(dsn) 29 | end 30 | else 31 | puts parser 32 | end 33 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven.rb: -------------------------------------------------------------------------------- 1 | require 'raven/base' 2 | 3 | Raven.inject 4 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/breadcrumbs/logger.rb: -------------------------------------------------------------------------------- 1 | DeprecationHelper.deprecate_old_breadcrumbs_configuration(:sentry_logger) 2 | 3 | require "raven/breadcrumbs/sentry_logger" 4 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/rails/controller_methods.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Rails 3 | module ControllerMethods 4 | def capture_message(message, options = {}) 5 | Raven::Rack.capture_message(message, request.env, options) 6 | end 7 | 8 | def capture_exception(exception, options = {}) 9 | Raven::Rack.capture_exception(exception, request.env, options) 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/rails/controller_transaction.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Rails 3 | module ControllerTransaction 4 | def self.included(base) 5 | base.prepend_around_action do |controller, block| 6 | Raven.context.transaction.push "#{controller.class}##{controller.action_name}" 7 | block.call 8 | Raven.context.transaction.pop 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/rails/overrides/streaming_reporter.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Rails 3 | module Overrides 4 | module StreamingReporter 5 | def log_error(exception) 6 | Raven.capture_exception(exception) 7 | super 8 | end 9 | end 10 | 11 | module OldStreamingReporter 12 | def self.included(base) 13 | base.send(:alias_method_chain, :log_error, :raven) 14 | end 15 | 16 | def log_error_with_raven(exception) 17 | Raven.capture_exception(exception) 18 | log_error_without_raven(exception) 19 | end 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/railties.rb: -------------------------------------------------------------------------------- 1 | require 'raven/integrations/rails' 2 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/rake.rb: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rake/task' 3 | require 'raven/integrations/tasks' 4 | 5 | module Rake 6 | class Application 7 | alias orig_display_error_messsage display_error_message 8 | def display_error_message(ex) 9 | Raven.capture_exception( 10 | ex, 11 | :transaction => top_level_tasks.join(' '), 12 | :logger => 'rake', 13 | :tags => { 'rake_task' => top_level_tasks.join(' ') } 14 | ) 15 | orig_display_error_messsage(ex) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/sidekiq.rb: -------------------------------------------------------------------------------- 1 | require 'time' 2 | require 'sidekiq' 3 | require 'raven/integrations/sidekiq/cleanup_middleware' 4 | require 'raven/integrations/sidekiq/error_handler' 5 | 6 | if Sidekiq::VERSION > '3' 7 | Sidekiq.configure_server do |config| 8 | config.error_handlers << Raven::Sidekiq::ErrorHandler.new 9 | config.server_middleware do |chain| 10 | chain.add Raven::Sidekiq::CleanupMiddleware 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/sidekiq/cleanup_middleware.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Sidekiq 3 | class CleanupMiddleware 4 | def call(_worker, job, queue) 5 | Raven.context.transaction.push "Sidekiq/#{job['class']}" 6 | Raven.extra_context(:sidekiq => job.merge("queue" => queue)) 7 | yield 8 | Context.clear! 9 | BreadcrumbBuffer.clear! 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/integrations/tasks.rb: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'raven/cli' 3 | 4 | namespace :raven do 5 | desc "Send a test event to the remote Sentry server" 6 | task :test, [:dsn] do |_t, args| 7 | Rake::Task["environment"].invoke if Rake::Task.tasks.map(&:to_s).include?("environment") 8 | 9 | Raven::CLI.test(args.dsn) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/interface.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Interface 3 | def initialize(attributes = nil) 4 | attributes&.each do |attr, value| 5 | public_send "#{attr}=", value 6 | end 7 | 8 | yield self if block_given? 9 | end 10 | 11 | def self.inherited(klass) 12 | name = klass.name.split("::").last.downcase.gsub("interface", "") 13 | registered[name.to_sym] = klass 14 | super 15 | end 16 | 17 | def self.registered 18 | @@registered ||= {} # rubocop:disable Style/ClassVars 19 | end 20 | 21 | def to_hash 22 | Hash[instance_variables.map { |name| [name[1..-1].to_sym, instance_variable_get(name)] }] 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/interfaces/exception.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class ExceptionInterface < Interface 3 | attr_accessor :values 4 | 5 | def self.sentry_alias 6 | :exception 7 | end 8 | 9 | def to_hash(*args) 10 | data = super(*args) 11 | data[:values] = data[:values].map(&:to_hash) if data[:values] 12 | data 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/interfaces/http.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class HttpInterface < Interface 3 | attr_accessor :url, :method, :data, :query_string, :cookies, :headers, :env 4 | 5 | def initialize(*arguments) 6 | self.headers = {} 7 | self.env = {} 8 | self.cookies = nil 9 | super(*arguments) 10 | end 11 | 12 | def self.sentry_alias 13 | :request 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/interfaces/message.rb: -------------------------------------------------------------------------------- 1 | require 'raven/interface' 2 | 3 | module Raven 4 | class MessageInterface < Interface 5 | attr_accessor :message, :params 6 | 7 | def initialize(*arguments) 8 | self.params = [] 9 | super(*arguments) 10 | end 11 | 12 | def unformatted_message 13 | Array(params).empty? ? message : message % params 14 | end 15 | 16 | def self.sentry_alias 17 | :logentry 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/interfaces/single_exception.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class SingleExceptionInterface < Interface 3 | attr_accessor :type 4 | attr_accessor :value 5 | attr_accessor :module 6 | attr_accessor :stacktrace 7 | 8 | def to_hash(*args) 9 | data = super(*args) 10 | data[:stacktrace] = data[:stacktrace].to_hash if data[:stacktrace] 11 | data 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/logger.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'logger' 4 | 5 | module Raven 6 | class Logger < ::Logger 7 | LOG_PREFIX = "** [Raven] " 8 | PROGNAME = "sentry" 9 | 10 | def initialize(*) 11 | super 12 | @level = ::Logger::INFO 13 | original_formatter = ::Logger::Formatter.new 14 | @default_formatter = proc do |severity, datetime, _progname, msg| 15 | msg = "#{LOG_PREFIX}#{msg}" 16 | original_formatter.call(severity, datetime, PROGNAME, msg) 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/processor.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Processor 3 | STRING_MASK = '********'.freeze 4 | INT_MASK = 0 5 | REGEX_SPECIAL_CHARACTERS = %w(. $ ^ { [ ( | ) * + ?).freeze 6 | 7 | def initialize(client = nil) 8 | @client = client 9 | end 10 | 11 | def process(_data) 12 | raise NotImplementedError 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/processor/post_data.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Processor::PostData < Processor 3 | def process(data) 4 | process_if_symbol_keys(data) if data[:request] 5 | process_if_string_keys(data) if data["request"] 6 | 7 | data 8 | end 9 | 10 | private 11 | 12 | def process_if_symbol_keys(data) 13 | return unless data[:request][:method] == "POST" 14 | 15 | data[:request][:data] = STRING_MASK 16 | end 17 | 18 | def process_if_string_keys(data) 19 | return unless data["request"]["method"] == "POST" 20 | 21 | data["request"]["data"] = STRING_MASK 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/processor/removecircularreferences.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Processor::RemoveCircularReferences < Processor 3 | ELISION_STRING = "(...)".freeze 4 | def process(value, visited = []) 5 | return ELISION_STRING if visited.include?(value.__id__) 6 | 7 | visited << value.__id__ if value.is_a?(Array) || value.is_a?(Hash) 8 | 9 | case value 10 | when Hash 11 | !value.frozen? ? value.merge!(value) { |_, v| process v, visited } : value.merge(value) { |_, v| process v, visited } 12 | when Array 13 | !value.frozen? ? value.map! { |v| process v, visited } : value.map { |v| process v, visited } 14 | else 15 | value 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/processor/removestacktrace.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | class Processor::RemoveStacktrace < Processor 3 | def process(data) 4 | process_if_symbol_keys(data) if data[:exception] 5 | process_if_string_keys(data) if data["exception"] 6 | 7 | data 8 | end 9 | 10 | private 11 | 12 | def process_if_symbol_keys(data) 13 | data[:exception][:values].map do |single_exception| 14 | single_exception.delete(:stacktrace) if single_exception[:stacktrace] 15 | end 16 | end 17 | 18 | def process_if_string_keys(data) 19 | data["exception"]["values"].map do |single_exception| 20 | single_exception.delete("stacktrace") if single_exception["stacktrace"] 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/transports.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Transports 3 | class Transport 4 | attr_accessor :configuration 5 | 6 | def initialize(configuration) 7 | @configuration = configuration 8 | end 9 | 10 | def send_event # (auth_header, data, options = {}) 11 | raise NotImplementedError, 'Abstract method not implemented' 12 | end 13 | end 14 | end 15 | end 16 | 17 | require "raven/transports/dummy" 18 | require "raven/transports/http" 19 | require "raven/transports/stdout" 20 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/transports/dummy.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Transports 3 | class Dummy < Transport 4 | attr_accessor :events 5 | 6 | def initialize(*) 7 | super 8 | @events = [] 9 | end 10 | 11 | def send_event(auth_header, data, options = {}) 12 | @events << [auth_header, data, options] 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/transports/stdout.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Transports 3 | class Stdout < Transport 4 | attr_accessor :events 5 | 6 | def initialize(*) 7 | super 8 | end 9 | 10 | def send_event(_auth_header, data, _options = {}) 11 | unless configuration.sending_allowed? 12 | logger.debug("Event not sent: #{configuration.error_messages}") 13 | end 14 | 15 | $stdout.puts data 16 | $stdout.flush 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/utils/deep_merge.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Utils 3 | # ported from ActiveSupport 4 | module DeepMergeHash 5 | def self.deep_merge(hash, other_hash, &block) 6 | deep_merge!(hash, other_hash, &block) 7 | end 8 | 9 | def self.deep_merge!(hash, other_hash, &block) 10 | hash.merge!(other_hash) do |key, this_val, other_val| 11 | if this_val.is_a?(Hash) && other_val.is_a?(Hash) 12 | deep_merge(this_val, other_val, &block) 13 | elsif block_given? 14 | block.call(key, this_val, other_val) 15 | else 16 | other_val 17 | end 18 | end 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/utils/exception_cause_chain.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Utils 3 | module ExceptionCauseChain 4 | def self.exception_to_array(exception) 5 | if exception.respond_to?(:cause) && exception.cause 6 | exceptions = [exception] 7 | while exception.cause 8 | exception = exception.cause 9 | break if exceptions.any? { |e| e.object_id == exception.object_id } 10 | 11 | exceptions << exception 12 | end 13 | exceptions 14 | else 15 | [exception] 16 | end 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/utils/request_id.rb: -------------------------------------------------------------------------------- 1 | module Raven 2 | module Utils 3 | module RequestId 4 | REQUEST_ID_HEADERS = %w(action_dispatch.request_id HTTP_X_REQUEST_ID).freeze 5 | 6 | # Request ID based on ActionDispatch::RequestId 7 | def self.read_from(env_hash) 8 | REQUEST_ID_HEADERS.each do |key| 9 | request_id = env_hash[key] 10 | return request_id if request_id 11 | end 12 | nil 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /sentry-raven/lib/raven/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Raven 4 | VERSION = "3.1.2" 5 | end 6 | -------------------------------------------------------------------------------- /sentry-raven/lib/sentry-raven-without-integrations.rb: -------------------------------------------------------------------------------- 1 | require "raven/helpers/deprecation_helper" 2 | 3 | filename = "sentry_raven_without_integrations" 4 | DeprecationHelper.deprecate_dasherized_filename(filename) 5 | 6 | require filename 7 | -------------------------------------------------------------------------------- /sentry-raven/lib/sentry-raven.rb: -------------------------------------------------------------------------------- 1 | require "raven" 2 | -------------------------------------------------------------------------------- /sentry-raven/lib/sentry_raven_without_integrations.rb: -------------------------------------------------------------------------------- 1 | require 'raven/base' 2 | -------------------------------------------------------------------------------- /sentry-raven/spec/raven/integrations/rack_timeout_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | require "rack/timeout/base" 3 | require "raven/integrations/rack-timeout" 4 | 5 | RSpec.describe "Rack timeout" do 6 | it "should have a raven_context method defined" do 7 | exc = Rack::Timeout::RequestTimeoutException.new("REQUEST_URI" => "This is a URI") 8 | 9 | expect(exc.raven_context[:fingerprint]).to eq(["{{ default }}", "This is a URI"]) 10 | end 11 | 12 | it "should return an empty context if env is missing" do 13 | exception = Object.new 14 | exception.extend(RackTimeoutExtensions) 15 | 16 | expect(exception.raven_context).to eq({}) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /sentry-raven/spec/raven/integrations/rake_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe 'Rake tasks' do 4 | it "should capture exceptions in Rake tasks" do 5 | expect(`cd spec/support && bundle exec rake raise_exception 2>&1`).to match(/Sending event [abcdef0-9]+ to Sentry/) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-raven/spec/raven/interfaces/stack_trace_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Raven::StacktraceInterface::Frame do 4 | it "should convert pathnames to strings" do 5 | frame = Raven::StacktraceInterface::Frame.new 6 | $LOAD_PATH.unshift Pathname.pwd # Oh no, a Pathname in the $LOAD_PATH! 7 | frame.abs_path = __FILE__ 8 | expect(frame.filename).to match(/stack_trace_spec.rb/) 9 | $LOAD_PATH.shift 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-raven/spec/raven/logger_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Raven::Logger do 4 | it "should log to a given IO" do 5 | stringio = StringIO.new 6 | log = Raven::Logger.new(stringio) 7 | 8 | log.fatal("Oh noes!") 9 | 10 | expect(stringio.string).to end_with("FATAL -- sentry: ** [Raven] Oh noes!\n") 11 | end 12 | 13 | it "should allow exceptions to be logged" do 14 | stringio = StringIO.new 15 | log = Raven::Logger.new(stringio) 16 | 17 | log.fatal(Exception.new("Oh exceptions")) 18 | 19 | expect(stringio.string).to end_with("FATAL -- sentry: ** [Raven] Oh exceptions\n") 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /sentry-raven/spec/raven/transports/stdout_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Raven::Transports::Stdout do 4 | let(:config) { Raven::Configuration.new.tap { |c| c.dsn = 'stdout://12345:67890@sentry.localdomain/sentry/42' } } 5 | let(:client) { Raven::Client.new(config) } 6 | 7 | it 'should write to stdout' do 8 | event = JSON.generate(Raven.capture_message("this is an STDOUT transport test").to_hash) 9 | expect { client.send(:transport).send_event("stdout test", event) }.to output(/\"message\":\"this is an STDOUT transport test\"/).to_stdout 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-raven/spec/support/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rubygems' 3 | require 'raven' 4 | require 'raven/transports/dummy' 5 | 6 | Raven.configure do |config| 7 | config.dsn = 'dummy://12345:67890@sentry.localdomain/sentry/42' 8 | end 9 | 10 | task :raise_exception do 11 | 1 / 0 12 | end 13 | -------------------------------------------------------------------------------- /sentry-raven/spec/support/linecache.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | qux 5 | lorem 6 | ipsum 7 | -------------------------------------------------------------------------------- /sentry-resque/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | Gemfile_with_rails.rb.lock 7 | /pkg/ 8 | /spec/reports/ 9 | /tmp/ 10 | 11 | # rspec failure tracking 12 | .rspec_status 13 | -------------------------------------------------------------------------------- /sentry-resque/.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | -------------------------------------------------------------------------------- /sentry-resque/.rubocop.yml: -------------------------------------------------------------------------------- 1 | ../.rubocop.yml -------------------------------------------------------------------------------- /sentry-resque/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | git_source(:github) { |name| "https://github.com/#{name}.git" } 5 | 6 | eval_gemfile "../Gemfile" 7 | 8 | # Specify your gem's dependencies in sentry-ruby.gemspec 9 | gemspec 10 | 11 | gem "ostruct" if RUBY_VERSION >= "3.4" 12 | 13 | gem "sentry-ruby", path: "../sentry-ruby" 14 | 15 | gem "resque-retry", "~> 1.8" 16 | 17 | group :rails do 18 | gem "sentry-rails", path: "../sentry-rails" 19 | gem "rails" 20 | end 21 | -------------------------------------------------------------------------------- /sentry-resque/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-resque.gemspec 4 | -------------------------------------------------------------------------------- /sentry-resque/Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "bundler/gem_tasks" 4 | require "rspec/core/rake_task" 5 | 6 | RSpec::Core::RakeTask.new(:spec).tap do |task| 7 | task.rspec_opts = "--order rand" 8 | end 9 | 10 | task default: :spec 11 | -------------------------------------------------------------------------------- /sentry-resque/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "sentry/ruby" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /sentry-resque/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /sentry-resque/example/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "rails" 6 | gem "sqlite3" 7 | gem "resque" 8 | gem "sentry-resque", path: "../" 9 | gem "sentry-ruby", path: "../../sentry-ruby" 10 | 11 | gem "debug", github: "ruby/debug" 12 | -------------------------------------------------------------------------------- /sentry-resque/lib/sentry-resque.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "resque" 4 | require "sentry-ruby" 5 | require "sentry/integrable" 6 | require "sentry/resque/configuration" 7 | require "sentry/resque/version" 8 | require "sentry/resque" 9 | 10 | module Sentry 11 | module Resque 12 | extend Sentry::Integrable 13 | 14 | register_integration name: "resque", version: Sentry::Resque::VERSION 15 | 16 | if defined?(::Rails::Railtie) 17 | class Railtie < ::Rails::Railtie 18 | config.after_initialize do 19 | next unless Sentry.initialized? && defined?(::Sentry::Rails) 20 | 21 | Sentry.configuration.rails.skippable_job_adapters << "ActiveJob::QueueAdapters::ResqueAdapter" 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /sentry-resque/lib/sentry/resque/configuration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class Configuration 5 | attr_reader :resque 6 | 7 | add_post_initialization_callback do 8 | @resque = Sentry::Resque::Configuration.new 9 | end 10 | end 11 | 12 | module Resque 13 | class Configuration 14 | # Set this option to true if you want Sentry to only capture the last job 15 | # retry if it fails. 16 | attr_accessor :report_after_job_retries 17 | 18 | def initialize 19 | @report_after_job_retries = false 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /sentry-resque/lib/sentry/resque/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Resque 5 | VERSION = "5.24.0" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-resque/spec/sentry/resque/configuration_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "spec_helper" 4 | 5 | RSpec.describe Sentry::Resque::Configuration do 6 | it "adds #resque option to Sentry::Configuration" do 7 | config = Sentry::Configuration.new 8 | 9 | expect(config.resque).to be_a(described_class) 10 | end 11 | 12 | describe "#report_after_job_retries" do 13 | it "has correct default value" do 14 | expect(subject.report_after_job_retries).to eq(false) 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /sentry-ruby/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /tmp/ 9 | 10 | # rspec failure tracking 11 | .rspec_status 12 | -------------------------------------------------------------------------------- /sentry-ruby/.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | --format progress 3 | --color 4 | --order rand 5 | -------------------------------------------------------------------------------- /sentry-ruby/.rubocop.yml: -------------------------------------------------------------------------------- 1 | ../.rubocop.yml -------------------------------------------------------------------------------- /sentry-ruby/.yardopts: -------------------------------------------------------------------------------- 1 | --exclude lib/sentry/utils/ 2 | --exclude lib/sentry/core_ext 3 | -------------------------------------------------------------------------------- /sentry-ruby/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-ruby-core.gemspec 4 | gem build sentry-ruby.gemspec 5 | -------------------------------------------------------------------------------- /sentry-ruby/Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "rake/clean" 4 | CLOBBER.include "pkg" 5 | 6 | require "bundler/gem_helper" 7 | Bundler::GemHelper.install_tasks(name: "sentry-ruby") 8 | 9 | require "rspec/core/rake_task" 10 | 11 | ISOLATED_SPECS = "spec/isolated/**/*_spec.rb" 12 | 13 | RSpec::Core::RakeTask.new(:spec).tap do |task| 14 | task.exclude_pattern = ISOLATED_SPECS 15 | end 16 | 17 | RSpec::Core::RakeTask.new(:isolated_specs).tap do |task| 18 | task.pattern = ISOLATED_SPECS 19 | end 20 | 21 | task default: [:spec, :isolated_specs] 22 | -------------------------------------------------------------------------------- /sentry-ruby/benchmarks/allocation_report.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'benchmark/ipsa' 4 | require "sentry-ruby" 5 | require "sentry/benchmarks/benchmark_transport" 6 | 7 | Sentry.init do |config| 8 | config.logger = ::Logger.new(nil) 9 | config.dsn = "dummy://12345:67890@sentry.localdomain:3000/sentry/42" 10 | config.transport.transport_class = Sentry::BenchmarkTransport 11 | config.breadcrumbs_logger = [:sentry_logger] 12 | end 13 | 14 | exception = begin 15 | 1/0 16 | rescue => exp 17 | exp 18 | end 19 | 20 | Sentry.capture_exception(exception) 21 | 22 | report = MemoryProfiler.report do 23 | Sentry.capture_exception(exception) 24 | end 25 | 26 | report.pretty_print 27 | -------------------------------------------------------------------------------- /sentry-ruby/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "debug" 6 | require "sentry-ruby" 7 | 8 | # You can add fixtures and/or initialization code here to make experimenting 9 | # with your gem easier. You can also use a different console, if you like. 10 | 11 | # (If you use this, don't forget to add pry to your Gemfile!) 12 | # require "pry" 13 | # Pry.start 14 | 15 | # Sentry.init do |config| 16 | # config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 17 | # end 18 | 19 | require "irb" 20 | IRB.start(__FILE__) 21 | -------------------------------------------------------------------------------- /sentry-ruby/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /sentry-ruby/examples/crons/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby '> 2.6' 5 | 6 | gem "rake" 7 | gem 'sentry-ruby', path: "../../" 8 | -------------------------------------------------------------------------------- /sentry-ruby/examples/crons/README.md: -------------------------------------------------------------------------------- 1 | # sentry-ruby Crons example 2 | 3 | Crons monitoring allows you to track that certain that should be performed 4 | on a certain schedule are indeed performed on time and without errors. See 5 | [documentation](https://docs.sentry.io/platforms/ruby/crons/) for more details. 6 | 7 | This example project has a few rake tasks that manually send monitor check-ins 8 | to Sentry. 9 | -------------------------------------------------------------------------------- /sentry-ruby/examples/rails-6.0: -------------------------------------------------------------------------------- 1 | ../../sentry-rails/examples/rails-6.0 -------------------------------------------------------------------------------- /sentry-ruby/examples/rake/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby '> 2.6' 5 | 6 | gem "rake" 7 | gem 'sentry-ruby', path: "../../" 8 | -------------------------------------------------------------------------------- /sentry-ruby/examples/rake/Rakefile.rb: -------------------------------------------------------------------------------- 1 | require "sentry-ruby" 2 | 3 | Sentry.init do |config| 4 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 5 | end 6 | 7 | # bundle exec rake raise_exception 8 | task :raise_exception do 9 | 1/0 10 | end 11 | 12 | # bundle exec rake send_message[foo] 13 | task :send_message, ['name'] do |_task, args| 14 | Sentry.capture_message("message from #{args[:name]}") 15 | end 16 | -------------------------------------------------------------------------------- /sentry-ruby/examples/sinatra/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby '> 2.6' 5 | 6 | gem "sinatra" 7 | 8 | # Use Puma as the app server 9 | gem 'puma', '~> 3.11' 10 | 11 | gem 'sentry-ruby', path: "../../" 12 | 13 | gem "debug", github: "ruby/debug" 14 | -------------------------------------------------------------------------------- /sentry-ruby/examples/sinatra/README.md: -------------------------------------------------------------------------------- 1 | # Sinatra Example For Sentry's Ruby SDK 2 | 3 | ## Setup 4 | 5 | 1. `bundle install` 6 | 2. Set your own Sentry DSN in `app.rb` 7 | 8 | ## Send Some Events To Sentry 9 | 10 | ### Exception & Performance Monitoring 11 | 12 | 1. Start the server - `bundle exec ruby app.rb` 13 | 2. Visit `localhost:4567/exception` 14 | 3. You should see both exception and transaction events in Sentry. 15 | 16 | -------------------------------------------------------------------------------- /sentry-ruby/examples/without_integrations/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby '> 2.6' 5 | 6 | gem 'sentry-ruby', path: "../../" 7 | gem "debug", github: "ruby/debug" 8 | -------------------------------------------------------------------------------- /sentry-ruby/examples/without_integrations/app.rb: -------------------------------------------------------------------------------- 1 | require "sentry-ruby" 2 | 3 | Sentry.init do |config| 4 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 5 | end 6 | 7 | Sentry.capture_message("test Sentry", hint: { background: false }) 8 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/envelope.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | # @api private 5 | class Envelope 6 | attr_accessor :headers, :items 7 | 8 | def initialize(headers = {}) 9 | @headers = headers 10 | @items = [] 11 | end 12 | 13 | def add_item(headers, payload) 14 | @items << Item.new(headers, payload) 15 | end 16 | 17 | def item_types 18 | @items.map(&:type) 19 | end 20 | 21 | def event_id 22 | @headers[:event_id] 23 | end 24 | end 25 | end 26 | 27 | require_relative "envelope/item" 28 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/exceptions.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class Error < StandardError 5 | end 6 | 7 | class ExternalError < Error 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/excon.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Sentry.register_patch(:excon) do 4 | if defined?(::Excon) 5 | require "sentry/excon/middleware" 6 | if Excon.defaults[:middlewares] 7 | Excon.defaults[:middlewares] << Sentry::Excon::Middleware unless Excon.defaults[:middlewares].include?(Sentry::Excon::Middleware) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/graphql.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Sentry.register_patch(:graphql) do |config| 4 | if defined?(::GraphQL::Schema) && defined?(::GraphQL::Tracing::SentryTrace) && ::GraphQL::Schema.respond_to?(:trace_with) 5 | ::GraphQL::Schema.trace_with(::GraphQL::Tracing::SentryTrace, set_transaction_name: true) 6 | else 7 | config.logger.warn(Sentry::LOGGER_PROGNAME) { "You tried to enable the GraphQL integration but no GraphQL gem was detected. Make sure you have the `graphql` gem (>= 2.2.6) in your Gemfile." } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/interface.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class Interface 5 | # @return [Hash] 6 | def to_hash 7 | Hash[instance_variables.map { |name| [name[1..-1].to_sym, instance_variable_get(name)] }] 8 | end 9 | end 10 | end 11 | 12 | require "sentry/interfaces/exception" 13 | require "sentry/interfaces/request" 14 | require "sentry/interfaces/single_exception" 15 | require "sentry/interfaces/stacktrace" 16 | require "sentry/interfaces/threads" 17 | require "sentry/interfaces/mechanism" 18 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/interfaces/mechanism.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class Mechanism < Interface 5 | # Generic identifier, mostly the source integration for this exception. 6 | # @return [String] 7 | attr_accessor :type 8 | 9 | # A manually captured exception has handled set to true, 10 | # false if coming from an integration where we intercept an uncaught exception. 11 | # Defaults to true here and will be set to false explicitly in integrations. 12 | # @return [Boolean] 13 | attr_accessor :handled 14 | 15 | def initialize(type: "generic", handled: true) 16 | @type = type 17 | @handled = handled 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/logger.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "logger" 4 | 5 | module Sentry 6 | class Logger < ::Logger 7 | LOG_PREFIX = "** [Sentry] " 8 | PROGNAME = "sentry" 9 | 10 | def initialize(*) 11 | super 12 | @level = ::Logger::INFO 13 | original_formatter = ::Logger::Formatter.new 14 | @default_formatter = proc do |severity, datetime, _progname, msg| 15 | msg = "#{LOG_PREFIX}#{msg}" 16 | original_formatter.call(severity, datetime, PROGNAME, msg) 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/metrics/counter_metric.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Metrics 5 | class CounterMetric < Metric 6 | attr_reader :value 7 | 8 | def initialize(value) 9 | @value = value.to_f 10 | end 11 | 12 | def add(value) 13 | @value += value.to_f 14 | end 15 | 16 | def serialize 17 | [value] 18 | end 19 | 20 | def weight 21 | 1 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/metrics/distribution_metric.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Metrics 5 | class DistributionMetric < Metric 6 | attr_reader :value 7 | 8 | def initialize(value) 9 | @value = [value.to_f] 10 | end 11 | 12 | def add(value) 13 | @value << value.to_f 14 | end 15 | 16 | def serialize 17 | value 18 | end 19 | 20 | def weight 21 | value.size 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/metrics/gauge_metric.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Metrics 5 | class GaugeMetric < Metric 6 | attr_reader :last, :min, :max, :sum, :count 7 | 8 | def initialize(value) 9 | value = value.to_f 10 | @last = value 11 | @min = value 12 | @max = value 13 | @sum = value 14 | @count = 1 15 | end 16 | 17 | def add(value) 18 | value = value.to_f 19 | @last = value 20 | @min = [@min, value].min 21 | @max = [@max, value].max 22 | @sum += value 23 | @count += 1 24 | end 25 | 26 | def serialize 27 | [last, min, max, sum, count] 28 | end 29 | 30 | def weight 31 | 5 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/metrics/metric.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Metrics 5 | class Metric 6 | def add(value) 7 | raise NotImplementedError 8 | end 9 | 10 | def serialize 11 | raise NotImplementedError 12 | end 13 | 14 | def weight 15 | raise NotImplementedError 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/metrics/set_metric.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "set" 4 | require "zlib" 5 | 6 | module Sentry 7 | module Metrics 8 | class SetMetric < Metric 9 | attr_reader :value 10 | 11 | def initialize(value) 12 | @value = Set[value] 13 | end 14 | 15 | def add(value) 16 | @value << value 17 | end 18 | 19 | def serialize 20 | value.map { |x| x.is_a?(String) ? Zlib.crc32(x) : x.to_i } 21 | end 22 | 23 | def weight 24 | value.size 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/rack.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "rack" 4 | 5 | require "sentry/rack/capture_exceptions" 6 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/transport/dummy_transport.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | class DummyTransport < Transport 5 | attr_accessor :events, :envelopes 6 | 7 | def initialize(*) 8 | super 9 | @events = [] 10 | @envelopes = [] 11 | end 12 | 13 | def send_event(event) 14 | @events << event 15 | end 16 | 17 | def send_envelope(envelope) 18 | @envelopes << envelope 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/custom_inspection.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module CustomInspection 5 | def inspect 6 | attr_strings = (instance_variables - self.class::SKIP_INSPECTION_ATTRIBUTES).each_with_object([]) do |attr, result| 7 | value = instance_variable_get(attr) 8 | result << "#{attr}=#{value.inspect}" if value 9 | end 10 | 11 | "#<#{self.class.name} #{attr_strings.join(", ")}>" 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/encoding_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Utils 5 | module EncodingHelper 6 | def self.encode_to_utf_8(value) 7 | if value.encoding != Encoding::UTF_8 && value.respond_to?(:force_encoding) 8 | value = value.dup.force_encoding(Encoding::UTF_8) 9 | end 10 | 11 | value = value.scrub unless value.valid_encoding? 12 | value 13 | end 14 | 15 | def self.valid_utf_8?(value) 16 | return true unless value.respond_to?(:force_encoding) 17 | 18 | value.dup.force_encoding(Encoding::UTF_8).valid_encoding? 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/env_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Utils 5 | module EnvHelper 6 | TRUTHY_ENV_VALUES = %w[t true yes y 1 on].freeze 7 | FALSY_ENV_VALUES = %w[f false no n 0 off].freeze 8 | 9 | def self.env_to_bool(value, strict: false) 10 | value = value.to_s 11 | normalized = value.downcase 12 | 13 | return false if FALSY_ENV_VALUES.include?(normalized) 14 | 15 | return true if TRUTHY_ENV_VALUES.include?(normalized) 16 | 17 | strict ? nil : !(value.nil? || value.empty?) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/exception_cause_chain.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Utils 5 | module ExceptionCauseChain 6 | def self.exception_to_array(exception) 7 | exceptions = [exception] 8 | 9 | while exception.cause 10 | exception = exception.cause 11 | break if exceptions.any? { |e| e.object_id == exception.object_id } 12 | 13 | exceptions << exception 14 | end 15 | 16 | exceptions 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/logging_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | # @private 5 | module LoggingHelper 6 | # @!visibility private 7 | attr_reader :sdk_logger 8 | 9 | # @!visibility private 10 | def log_error(message, exception, debug: false) 11 | message = "#{message}: #{exception.message}" 12 | message += "\n#{exception.backtrace.join("\n")}" if debug 13 | 14 | sdk_logger.error(LOGGER_PROGNAME) do 15 | message 16 | end 17 | end 18 | 19 | # @!visibility private 20 | def log_debug(message) 21 | sdk_logger.debug(LOGGER_PROGNAME) { message } 22 | end 23 | 24 | # @!visibility private 25 | def log_warn(message) 26 | sdk_logger.warn(LOGGER_PROGNAME) { message } 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/request_id.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Utils 5 | module RequestId 6 | REQUEST_ID_HEADERS = %w[action_dispatch.request_id HTTP_X_REQUEST_ID].freeze 7 | 8 | # Request ID based on ActionDispatch::RequestId 9 | def self.read_from(env) 10 | REQUEST_ID_HEADERS.each do |key| 11 | request_id = env[key] 12 | return request_id if request_id 13 | end 14 | nil 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/utils/uuid.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "securerandom" 4 | 5 | module Sentry 6 | module Utils 7 | DELIMITER = "-" 8 | 9 | def self.uuid 10 | SecureRandom.uuid.delete(DELIMITER) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /sentry-ruby/lib/sentry/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | VERSION = "5.24.0" 5 | end 6 | -------------------------------------------------------------------------------- /sentry-ruby/spec/fixtures/attachment.txt: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /sentry-ruby/spec/isolated/init.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "sentry-ruby" 4 | require "sentry/test_helper" 5 | 6 | Sentry.init do |config| 7 | config.dsn = Sentry::TestHelper::DUMMY_DSN 8 | end 9 | 10 | trap('HUP') do 11 | hub = Sentry.get_main_hub 12 | puts hub.class 13 | end 14 | 15 | Process.kill('HUP', Process.pid) 16 | -------------------------------------------------------------------------------- /sentry-ruby/spec/isolated/init_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # isolated tests need a SimpleCov name otherwise they will overwrite coverage 4 | SimpleCov.command_name "RSpecIsolatedInit" 5 | 6 | RSpec.describe Sentry do 7 | context "works within a trap context", when: { ruby_engine?: "ruby" } do 8 | it "doesn't raise error when accessing main hub in trap context" do 9 | out = `ruby spec/isolated/init.rb` 10 | 11 | expect(out).to include("Sentry::Hub") 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /sentry-ruby/spec/sentry/interface_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'sentry/interface' 4 | 5 | class TestInterface < Sentry::Interface 6 | attr_accessor :some_attr 7 | end 8 | 9 | RSpec.describe Sentry::Interface do 10 | it "serializes to a Hash" do 11 | interface = TestInterface.new 12 | interface.some_attr = "test" 13 | 14 | expect(interface.to_hash).to eq(some_attr: "test") 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /sentry-ruby/spec/sentry/metrics/configuration_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe Sentry::Metrics::Configuration do 4 | describe '#before_emit=' do 5 | it 'raises error when setting before_emit to anything other than callable or nil' do 6 | subject.before_emit = -> { } 7 | subject.before_emit = nil 8 | expect { subject.before_emit = true }.to raise_error(ArgumentError, 'metrics.before_emit must be callable (or nil to disable)') 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /sentry-ruby/spec/sentry/metrics/counter_metric_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe Sentry::Metrics::CounterMetric do 4 | subject { described_class.new(1) } 5 | before { subject.add(2) } 6 | 7 | describe '#add' do 8 | it 'adds float value' do 9 | subject.add(3.0) 10 | expect(subject.value).to eq(6.0) 11 | end 12 | end 13 | 14 | describe '#serialize' do 15 | it 'returns value in array' do 16 | expect(subject.serialize).to eq([3.0]) 17 | end 18 | end 19 | 20 | describe '#weight' do 21 | it 'returns fixed value of 1' do 22 | expect(subject.weight).to eq(1) 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /sentry-ruby/spec/sentry/metrics/distribution_metric_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe Sentry::Metrics::DistributionMetric do 4 | subject { described_class.new(1) } 5 | before { subject.add(2) } 6 | 7 | describe '#add' do 8 | it 'appends float value to array' do 9 | subject.add(3.0) 10 | expect(subject.value).to eq([1.0, 2.0, 3.0]) 11 | end 12 | end 13 | 14 | describe '#serialize' do 15 | it 'returns whole array' do 16 | expect(subject.serialize).to eq([1.0, 2.0]) 17 | end 18 | end 19 | 20 | describe '#weight' do 21 | it 'returns length of array' do 22 | expect(subject.weight).to eq(2) 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /sentry-ruby/spec/sentry/metrics/metric_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe Sentry::Metrics::Metric do 4 | describe '#add' do 5 | it 'raises not implemented error' do 6 | expect { subject.add(1) }.to raise_error(NotImplementedError) 7 | end 8 | end 9 | 10 | describe '#serialize' do 11 | it 'raises not implemented error' do 12 | expect { subject.serialize }.to raise_error(NotImplementedError) 13 | end 14 | end 15 | 16 | describe '#weight' do 17 | it 'raises not implemented error' do 18 | expect { subject.weight }.to raise_error(NotImplementedError) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /sentry-ruby/spec/sentry/transport/configuration_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe Sentry::Transport::Configuration do 4 | describe "#transport_class=" do 5 | it "doesn't accept non-class argument" do 6 | expect { subject.transport_class = "foo" }.to raise_error(Sentry::Error, "config.transport.transport_class must a class. got: String") 7 | end 8 | 9 | it "accepts class argument" do 10 | subject.transport_class = Sentry::DummyTransport 11 | 12 | expect(subject.transport_class).to eq(Sentry::DummyTransport) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /sentry-ruby/spec/support/Rakefile.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "rake" 4 | require "sentry-ruby" 5 | 6 | Sentry.init do |config| 7 | config.dsn = 'http://12345:67890@sentry.localdomain/sentry/42' 8 | config.background_worker_threads = 0 9 | config.sdk_logger.level = Logger::DEBUG 10 | end 11 | 12 | task :raise_exception do 13 | 1/0 14 | end 15 | 16 | task :raise_exception_without_rake_integration do 17 | Sentry.configuration.skip_rake_integration = true 18 | 1/0 19 | end 20 | 21 | task :pass_arguments, ['name'] do |_task, args| 22 | puts args[:name] 23 | end 24 | -------------------------------------------------------------------------------- /sentry-ruby/spec/support/linecache.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | qux 5 | lorem 6 | ipsum 7 | -------------------------------------------------------------------------------- /sentry-ruby/spec/support/profiler.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ProfilerTest 4 | module Bar 5 | module Foo 6 | def self.foo 7 | 1e6.to_i.times { 2**2 } 8 | end 9 | end 10 | 11 | def self.bar 12 | Foo.foo 13 | sleep 0.1 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /sentry-ruby/spec/support/stacktrace_test_fixture.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | def foo 4 | bar 5 | end 6 | 7 | def bar 8 | baz 9 | end 10 | -------------------------------------------------------------------------------- /sentry-sidekiq/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /tmp/ 9 | 10 | # rspec failure tracking 11 | .rspec_status 12 | -------------------------------------------------------------------------------- /sentry-sidekiq/.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | -------------------------------------------------------------------------------- /sentry-sidekiq/.rubocop.yml: -------------------------------------------------------------------------------- 1 | ../.rubocop.yml -------------------------------------------------------------------------------- /sentry-sidekiq/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | bundle install 3 | gem build sentry-sidekiq.gemspec 4 | -------------------------------------------------------------------------------- /sentry-sidekiq/Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "bundler/gem_tasks" 4 | require "rspec/core/rake_task" 5 | 6 | RSpec::Core::RakeTask.new(:spec).tap do |task| 7 | task.rspec_opts = "--order rand" 8 | end 9 | 10 | task default: :spec 11 | -------------------------------------------------------------------------------- /sentry-sidekiq/bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "sentry/ruby" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /sentry-sidekiq/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /sentry-sidekiq/example/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "sidekiq" 6 | gem "sentry-sidekiq", path: "../" 7 | gem "sentry-ruby", path: "../../sentry-ruby" 8 | 9 | gem "debug", github: "ruby/debug" 10 | -------------------------------------------------------------------------------- /sentry-sidekiq/example/README.md: -------------------------------------------------------------------------------- 1 | # sentry-sidekiq example 2 | 3 | ## Usage 4 | 5 | 1. run `bundle install` 6 | 2. change the `dsn` inside `error_worker.rb` 7 | 3. run `bundle exec sidekiq -r ./error_worker.rb` 8 | 4. you should see the event from your Sentry dashboard 9 | -------------------------------------------------------------------------------- /sentry-sidekiq/example/config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | --- 2 | :verbose: false 3 | :concurrency: 10 4 | :timeout: 25 5 | 6 | :queues: 7 | - default 8 | 9 | -------------------------------------------------------------------------------- /sentry-sidekiq/example/error_worker.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "sidekiq" 4 | require "sentry-sidekiq" 5 | 6 | Sentry.init do |config| 7 | config.breadcrumbs_logger = [:sentry_logger] 8 | # replace it with your sentry dsn 9 | config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472' 10 | end 11 | 12 | class ErrorWorker 13 | include Sidekiq::Worker 14 | 15 | sidekiq_options retry: 0 16 | 17 | def perform 18 | 1 / 0 19 | end 20 | end 21 | 22 | ErrorWorker.perform_async 23 | -------------------------------------------------------------------------------- /sentry-sidekiq/lib/sentry/sidekiq/cron/helpers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Sidekiq 5 | module Cron 6 | module Helpers 7 | # This is used by Cron::Job and Scheduler 8 | def self.monitor_config(cron) 9 | cron_parts = cron.strip.split(" ") 10 | 11 | if cron_parts.length > 5 12 | timezone = cron_parts.pop 13 | cron_without_timezone = cron_parts.join(" ") 14 | 15 | Sentry::Cron::MonitorConfig.from_crontab(cron_without_timezone, timezone: timezone) 16 | else 17 | Sentry::Cron::MonitorConfig.from_crontab(cron) 18 | end 19 | end 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /sentry-sidekiq/lib/sentry/sidekiq/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Sentry 4 | module Sidekiq 5 | VERSION = "5.24.0" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /sentry-sidekiq/spec/fixtures/sidekiq-cron-schedule.yml: -------------------------------------------------------------------------------- 1 | happy: 2 | cron: "* * * * *" 3 | class: "HappyWorkerForCron" 4 | 5 | happy_with_timezone: 6 | cron: "* * * * * America/Los_Angeles" 7 | class: "HappyWorkerForCronWithTimezone" 8 | 9 | manual: 10 | cron: "* * * * *" 11 | class: "SadWorkerWithCron" 12 | 13 | human_readable_cron: 14 | cron: "every 5 minutes" 15 | class: HappyWorkerWithHumanReadableCron 16 | 17 | invalid_cron: 18 | cron: "not a crontab" 19 | class: "ReportingWorker" 20 | -------------------------------------------------------------------------------- /sentry-sidekiq/spec/fixtures/sidekiq-scheduler-schedule.yml: -------------------------------------------------------------------------------- 1 | :schedule: 2 | happy: 3 | cron: "* * * * *" 4 | class: "HappyWorkerForScheduler" 5 | happy_timezone: 6 | cron: "* * * * * Europe/Vienna" 7 | class: "HappyWorkerForSchedulerWithTimezone" 8 | manual: 9 | cron: "* * * * *" 10 | class: "SadWorkerWithCron" 11 | regularly_happy: 12 | every: "10 minutes" 13 | class: "EveryHappyWorker" 14 | reports: 15 | in: "2 hours" 16 | class: "ReportingWorker" 17 | VeryLongOuterModule::VeryVeryVeryVeryLongInnerModule::Job: 18 | cron: "* * * * *" 19 | --------------------------------------------------------------------------------