sentry-rails-5.16.1/0000755000004100000410000000000014560175414014277 5ustar www-datawww-datasentry-rails-5.16.1/bin/0000755000004100000410000000000014560175414015047 5ustar www-datawww-datasentry-rails-5.16.1/bin/setup0000755000004100000410000000020314560175414016130 0ustar www-datawww-data#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' set -vx bundle install # Do any other automated setup that you need to do here sentry-rails-5.16.1/bin/console0000755000004100000410000000053214560175414016437 0ustar www-datawww-data#!/usr/bin/env ruby require "bundler/setup" require "sentry/ruby" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. # (If you use this, don't forget to add pry to your Gemfile!) # require "pry" # Pry.start require "irb" IRB.start(__FILE__) sentry-rails-5.16.1/.gitignore0000644000004100000410000000022014560175414016261 0ustar www-datawww-data/.bundle/ /.yardoc /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ /spec/dummy/test_rails_app/db* /tmp/ # rspec failure tracking .rspec_status sentry-rails-5.16.1/lib/0000755000004100000410000000000014560175414015045 5ustar www-datawww-datasentry-rails-5.16.1/lib/sentry/0000755000004100000410000000000014560175414016371 5ustar www-datawww-datasentry-rails-5.16.1/lib/sentry/rails.rb0000644000004100000410000000051114560175414020025 0ustar www-datawww-datarequire "rails" require "sentry-ruby" require "sentry/integrable" require "sentry/rails/tracing" require "sentry/rails/configuration" require "sentry/rails/engine" require "sentry/rails/railtie" module Sentry module Rails extend Integrable register_integration name: "rails", version: Sentry::Rails::VERSION end end sentry-rails-5.16.1/lib/sentry/rails/0000755000004100000410000000000014560175414017503 5ustar www-datawww-datasentry-rails-5.16.1/lib/sentry/rails/configuration.rb0000644000004100000410000001640114560175414022701 0ustar www-datawww-datarequire "sentry/rails/tracing/action_controller_subscriber" require "sentry/rails/tracing/action_view_subscriber" require "sentry/rails/tracing/active_record_subscriber" require "sentry/rails/tracing/active_storage_subscriber" module Sentry class Configuration attr_reader :rails add_post_initialization_callback do @rails = Sentry::Rails::Configuration.new @excluded_exceptions = @excluded_exceptions.concat(Sentry::Rails::IGNORE_DEFAULT) if ::Rails.logger if defined?(::ActiveSupport::BroadcastLogger) && ::Rails.logger.is_a?(::ActiveSupport::BroadcastLogger) dupped_broadcasts = ::Rails.logger.broadcasts.map(&:dup) @logger = ::ActiveSupport::BroadcastLogger.new(*dupped_broadcasts) else @logger = ::Rails.logger.dup end else @logger.warn(Sentry::LOGGER_PROGNAME) do <<~MSG sentry-rails can't detect Rails.logger. it may be caused by misplacement of the SDK initialization code please make sure you place the Sentry.init block under the `config/initializers` folder, e.g. `config/initializers/sentry.rb` MSG end end end end module Rails IGNORE_DEFAULT = [ 'AbstractController::ActionNotFound', 'ActionController::BadRequest', 'ActionController::InvalidAuthenticityToken', 'ActionController::InvalidCrossOriginRequest', 'ActionController::MethodNotAllowed', 'ActionController::NotImplemented', 'ActionController::ParameterMissing', 'ActionController::RoutingError', 'ActionController::UnknownAction', 'ActionController::UnknownFormat', 'ActionDispatch::Http::MimeNegotiation::InvalidType', 'ActionController::UnknownHttpMethod', 'ActionDispatch::Http::Parameters::ParseError', 'ActiveRecord::RecordNotFound' ].freeze ACTIVE_SUPPORT_LOGGER_SUBSCRIPTION_ITEMS_DEFAULT = { # action_controller "write_fragment.action_controller" => %i[key], "read_fragment.action_controller" => %i[key], "exist_fragment?.action_controller" => %i[key], "expire_fragment.action_controller" => %i[key], "start_processing.action_controller" => %i[controller action params format method path], "process_action.action_controller" => %i[controller action params format method path status view_runtime db_runtime], "send_file.action_controller" => %i[path], "redirect_to.action_controller" => %i[status location], "halted_callback.action_controller" => %i[filter], # action_dispatch "process_middleware.action_dispatch" => %i[middleware], # action_view "render_template.action_view" => %i[identifier layout], "render_partial.action_view" => %i[identifier], "render_collection.action_view" => %i[identifier count cache_hits], "render_layout.action_view" => %i[identifier], # active_record "sql.active_record" => %i[sql name statement_name cached], "instantiation.active_record" => %i[record_count class_name], # action_mailer # not including to, from, or subject..etc. because of PII concern "deliver.action_mailer" => %i[mailer date perform_deliveries], "process.action_mailer" => %i[mailer action params], # active_support "cache_read.active_support" => %i[key store hit], "cache_generate.active_support" => %i[key store], "cache_fetch_hit.active_support" => %i[key store], "cache_write.active_support" => %i[key store], "cache_delete.active_support" => %i[key store], "cache_exist?.active_support" => %i[key store], # active_job "enqueue_at.active_job" => %i[], "enqueue.active_job" => %i[], "enqueue_retry.active_job" => %i[], "perform_start.active_job" => %i[], "perform.active_job" => %i[], "retry_stopped.active_job" => %i[], "discard.active_job" => %i[], # action_cable "perform_action.action_cable" => %i[channel_class action], "transmit.action_cable" => %i[channel_class], "transmit_subscription_confirmation.action_cable" => %i[channel_class], "transmit_subscription_rejection.action_cable" => %i[channel_class], "broadcast.action_cable" => %i[broadcasting], # active_storage "service_upload.active_storage" => %i[service key checksum], "service_streaming_download.active_storage" => %i[service key], "service_download_chunk.active_storage" => %i[service key], "service_download.active_storage" => %i[service key], "service_delete.active_storage" => %i[service key], "service_delete_prefixed.active_storage" => %i[service prefix], "service_exist.active_storage" => %i[service key exist], "service_url.active_storage" => %i[service key url], "service_update_metadata.active_storage" => %i[service key], "preview.active_storage" => %i[key], "analyze.active_storage" => %i[analyzer], }.freeze class Configuration # Rails 7.0 introduced a new error reporter feature, which the SDK once opted-in by default. # But after receiving multiple issue reports, the integration seemed to cause serious troubles to some users. # So the integration is now controlled by this configuration, which is disabled (false) by default. # More information can be found from: https://github.com/rails/rails/pull/43625#issuecomment-1072514175 attr_accessor :register_error_subscriber # Rails catches exceptions in the ActionDispatch::ShowExceptions or # ActionDispatch::DebugExceptions middlewares, depending on the environment. # When `rails_report_rescued_exceptions` is true (it is by default), Sentry # will report exceptions even when they are rescued by these middlewares. attr_accessor :report_rescued_exceptions # Some adapters, like sidekiq, already have their own sentry integration. # In those cases, we should skip ActiveJob's reporting to avoid duplicated reports. attr_accessor :skippable_job_adapters attr_accessor :tracing_subscribers # sentry-rails by default skips asset request' transactions by checking if the path matches # # ```rb # %r(\A/{0,2}#{::Rails.application.config.assets.prefix}) # ``` # # If you want to use a different pattern, you can configure the `assets_regexp` option like: # # ```rb # Sentry.init do |config| # config.rails.assets_regexp = /my_regexp/ # end # ``` attr_accessor :assets_regexp # Hash of subscription items that will be shown in breadcrumbs active support logger. # @return [Hash>] attr_accessor :active_support_logger_subscription_items def initialize @register_error_subscriber = false @report_rescued_exceptions = true @skippable_job_adapters = [] @assets_regexp = if defined?(::Sprockets::Rails) %r(\A/{0,2}#{::Rails.application.config.assets.prefix}) end @tracing_subscribers = Set.new([ Sentry::Rails::Tracing::ActionViewSubscriber, Sentry::Rails::Tracing::ActiveRecordSubscriber, Sentry::Rails::Tracing::ActiveStorageSubscriber ]) @active_support_logger_subscription_items = Sentry::Rails::ACTIVE_SUPPORT_LOGGER_SUBSCRIPTION_ITEMS_DEFAULT.dup end end end end sentry-rails-5.16.1/lib/sentry/rails/controller_transaction.rb0000644000004100000410000000207614560175414024625 0ustar www-datawww-datamodule Sentry module Rails module ControllerTransaction def self.included(base) base.prepend_around_action(:sentry_around_action) end private def sentry_around_action if Sentry.initialized? transaction_name = "#{self.class}##{action_name}" Sentry.get_current_scope.set_transaction_name(transaction_name, source: :view) Sentry.with_child_span(op: "view.process_action.action_controller", description: transaction_name) do |child_span| if child_span begin result = yield ensure child_span.set_http_status(response.status) child_span.set_data(:format, request.format) child_span.set_data(:method, request.method) child_span.set_data(:path, request.path) child_span.set_data(:params, request.params) end result else yield end end else yield end end end end end sentry-rails-5.16.1/lib/sentry/rails/tracing/0000755000004100000410000000000014560175414021132 5ustar www-datawww-datasentry-rails-5.16.1/lib/sentry/rails/tracing/active_storage_subscriber.rb0000644000004100000410000000225214560175414026702 0ustar www-datawww-datarequire "sentry/rails/tracing/abstract_subscriber" module Sentry module Rails module Tracing class ActiveStorageSubscriber < AbstractSubscriber EVENT_NAMES = %w( service_upload.active_storage service_download.active_storage service_streaming_download.active_storage service_download_chunk.active_storage service_delete.active_storage service_delete_prefixed.active_storage service_exist.active_storage service_url.active_storage service_mirror.active_storage service_update_metadata.active_storage preview.active_storage analyze.active_storage ).freeze def self.subscribe! subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload| record_on_current_span(op: "file.#{event_name}".freeze, start_timestamp: payload[START_TIMESTAMP_NAME], description: payload[:service], duration: duration) do |span| payload.each do |key, value| span.set_data(key, value) unless key == START_TIMESTAMP_NAME end end end end end end end end sentry-rails-5.16.1/lib/sentry/rails/tracing/action_controller_subscriber.rb0000644000004100000410000000251614560175414027426 0ustar www-datawww-datarequire "sentry/rails/tracing/abstract_subscriber" require "sentry/rails/instrument_payload_cleanup_helper" module Sentry module Rails module Tracing class ActionControllerSubscriber < AbstractSubscriber extend InstrumentPayloadCleanupHelper EVENT_NAMES = ["process_action.action_controller"].freeze OP_NAME = "view.process_action.action_controller".freeze def self.subscribe! Sentry.logger.warn <<~MSG DEPRECATION WARNING: sentry-rails has changed its approach on controller span recording and #{self.name} is now depreacted. Please stop using or referencing #{self.name} as it will be removed in the next major release. MSG subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload| controller = payload[:controller] action = payload[:action] record_on_current_span( op: OP_NAME, start_timestamp: payload[START_TIMESTAMP_NAME], description: "#{controller}##{action}", duration: duration ) do |span| payload = payload.dup cleanup_data(payload) span.set_data(:payload, payload) span.set_http_status(payload[:status]) end end end end end end end sentry-rails-5.16.1/lib/sentry/rails/tracing/abstract_subscriber.rb0000644000004100000410000000330114560175414025502 0ustar www-datawww-datamodule Sentry module Rails module Tracing class AbstractSubscriber class << self def subscribe! raise NotImplementedError end def unsubscribe! self::EVENT_NAMES.each do |name| ActiveSupport::Notifications.unsubscribe(name) end end if ::Rails.version.to_i == 5 def subscribe_to_event(event_names) event_names.each do |event_name| ActiveSupport::Notifications.subscribe(event_name) do |*args| next unless Tracing.get_current_transaction event = ActiveSupport::Notifications::Event.new(*args) yield(event_name, event.duration, event.payload) end end end else def subscribe_to_event(event_names) event_names.each do |event_name| ActiveSupport::Notifications.subscribe(event_name) do |event| next unless Tracing.get_current_transaction yield(event_name, event.duration, event.payload) end end end end def record_on_current_span(duration:, **options) return unless options[:start_timestamp] Sentry.with_child_span(**options) do |child_span| # duration in ActiveSupport is computed in millisecond # so we need to covert it as second before calculating the timestamp child_span.set_timestamp(child_span.start_timestamp + duration / 1000) yield(child_span) if block_given? end end end end end end end sentry-rails-5.16.1/lib/sentry/rails/tracing/active_record_subscriber.rb0000644000004100000410000000424314560175414026516 0ustar www-datawww-datarequire "sentry/rails/tracing/abstract_subscriber" module Sentry module Rails module Tracing class ActiveRecordSubscriber < AbstractSubscriber EVENT_NAMES = ["sql.active_record"].freeze SPAN_PREFIX = "db.".freeze EXCLUDED_EVENTS = ["SCHEMA", "TRANSACTION"].freeze def self.subscribe! subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload| next if EXCLUDED_EVENTS.include? payload[:name] record_on_current_span(op: SPAN_PREFIX + event_name, start_timestamp: payload[START_TIMESTAMP_NAME], description: payload[:sql], duration: duration) do |span| span.set_tag(:cached, true) if payload.fetch(:cached, false) # cached key is only set for hits in the QueryCache, from Rails 5.1 connection = payload[:connection] if payload[:connection_id] span.set_data(:connection_id, payload[:connection_id]) # we fallback to the base connection on rails < 6.0.0 since the payload doesn't have it base_connection = ActiveRecord::Base.connection connection ||= base_connection if payload[:connection_id] == base_connection.object_id end next unless connection db_config = if connection.pool.respond_to?(:db_config) connection.pool.db_config.configuration_hash elsif connection.pool.respond_to?(:spec) connection.pool.spec.config end next unless db_config span.set_data(Span::DataConventions::DB_SYSTEM, db_config[:adapter]) if db_config[:adapter] span.set_data(Span::DataConventions::DB_NAME, db_config[:database]) if db_config[:database] span.set_data(Span::DataConventions::SERVER_ADDRESS, db_config[:host]) if db_config[:host] span.set_data(Span::DataConventions::SERVER_PORT, db_config[:port]) if db_config[:port] span.set_data(Span::DataConventions::SERVER_SOCKET_ADDRESS, db_config[:socket]) if db_config[:socket] end end end end end end end sentry-rails-5.16.1/lib/sentry/rails/tracing/action_view_subscriber.rb0000644000004100000410000000111014560175414026202 0ustar www-datawww-datarequire "sentry/rails/tracing/abstract_subscriber" module Sentry module Rails module Tracing class ActionViewSubscriber < AbstractSubscriber EVENT_NAMES = ["render_template.action_view"].freeze SPAN_PREFIX = "template.".freeze def self.subscribe! subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload| record_on_current_span(op: SPAN_PREFIX + event_name, start_timestamp: payload[START_TIMESTAMP_NAME], description: payload[:identifier], duration: duration) end end end end end end sentry-rails-5.16.1/lib/sentry/rails/action_cable.rb0000644000004100000410000000643514560175414022443 0ustar www-datawww-datamodule Sentry module Rails module ActionCableExtensions class ErrorHandler OP_NAME = "websocket.server".freeze class << self def capture(connection, transaction_name:, extra_context: nil, &block) return block.call unless Sentry.initialized? # ActionCable's ConnectionStub (for testing) doesn't implement the exact same interfaces as Connection::Base. # One thing that's missing is `env`. So calling `connection.env` direclty will fail in test environments when `stub_connection` is used. # See https://github.com/getsentry/sentry-ruby/pull/1684 for more information. env = connection.respond_to?(:env) ? connection.env : {} Sentry.with_scope do |scope| scope.set_rack_env(env) scope.set_context("action_cable", extra_context) if extra_context scope.set_transaction_name(transaction_name, source: :view) transaction = start_transaction(env, scope) scope.set_span(transaction) if transaction begin result = block.call finish_transaction(transaction, 200) result rescue Exception => e # rubocop:disable Lint/RescueException Sentry::Rails.capture_exception(e) finish_transaction(transaction, 500) raise end end end def start_transaction(env, scope) options = { name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME } transaction = Sentry.continue_trace(env, **options) Sentry.start_transaction(transaction: transaction, **options) end def finish_transaction(transaction, status_code) return unless transaction transaction.set_http_status(status_code) transaction.finish end end end module Connection private def handle_open ErrorHandler.capture(self, transaction_name: "#{self.class.name}#connect") do super end end def handle_close ErrorHandler.capture(self, transaction_name: "#{self.class.name}#disconnect") do super end end end module Channel module Subscriptions def self.included(base) base.class_eval do set_callback :subscribe, :around, ->(_, block) { sentry_capture(:subscribed, &block) }, prepend: true set_callback :unsubscribe, :around, ->(_, block) { sentry_capture(:unsubscribed, &block) }, prepend: true end end private def sentry_capture(hook, &block) extra_context = { params: params } ErrorHandler.capture(connection, transaction_name: "#{self.class.name}##{hook}", extra_context: extra_context, &block) end end module Actions private def dispatch_action(action, data) extra_context = { params: params, data: data } ErrorHandler.capture(connection, transaction_name: "#{self.class.name}##{action}", extra_context: extra_context) do super end end end end end end end sentry-rails-5.16.1/lib/sentry/rails/engine.rb0000644000004100000410000000012614560175414021274 0ustar www-datawww-datamodule Sentry class Engine < ::Rails::Engine isolate_namespace Sentry end end sentry-rails-5.16.1/lib/sentry/rails/error_subscriber.rb0000644000004100000410000000174114560175414023407 0ustar www-datawww-datamodule Sentry module Rails # This is not a user-facing class. You should use it with Rails 7.0's error reporter feature and its interfaces. # See https://github.com/rails/rails/blob/main/activesupport/lib/active_support/error_reporter.rb to learn more about reporting APIs. # If you want Sentry to subscribe to the error reporter, please set `config.rails.register_error_subscriber` to `true`. class ErrorSubscriber SKIP_SOURCES = Regexp.union([/.*_cache_store.active_support/]) def report(error, handled:, severity:, context:, source: nil) tags = { handled: handled } if source return if SKIP_SOURCES.match?(source) tags[:source] = source end if context[:tags].is_a?(Hash) context = context.dup tags.merge!(context.delete(:tags)) end Sentry::Rails.capture_exception(error, level: severity, contexts: { "rails.error" => context }, tags: tags) end end end end sentry-rails-5.16.1/lib/sentry/rails/tracing.rb0000644000004100000410000000445614560175414021470 0ustar www-datawww-datamodule Sentry module Rails module Tracing START_TIMESTAMP_NAME = :sentry_start_timestamp def self.register_subscribers(subscribers) @subscribers = subscribers end def self.subscribers @subscribers end def self.subscribed_tracing_events @subscribed_tracing_events ||= [] end def self.subscribe_tracing_events # need to avoid duplicated subscription return if @subscribed subscribers.each do |subscriber| subscriber.subscribe! @subscribed_tracing_events ||= [] @subscribed_tracing_events += subscriber::EVENT_NAMES end @subscribed = true end def self.unsubscribe_tracing_events return unless @subscribed subscribers.each(&:unsubscribe!) subscribed_tracing_events.clear @subscribed = false end # this is necessary because instrumentation events don't record absolute start/finish time # so we need to retrieve the correct time this way def self.patch_active_support_notifications unless ::ActiveSupport::Notifications::Instrumenter.ancestors.include?(SentryNotificationExtension) ::ActiveSupport::Notifications::Instrumenter.send(:prepend, SentryNotificationExtension) end SentryNotificationExtension.module_eval do def instrument(name, payload = {}, &block) # only inject timestamp to the events the SDK subscribes to if Tracing.subscribed_tracing_events.include?(name) payload[START_TIMESTAMP_NAME] = Time.now.utc.to_f if name[0] != "!" && payload.is_a?(Hash) end super(name, payload, &block) end end end def self.remove_active_support_notifications_patch if ::ActiveSupport::Notifications::Instrumenter.ancestors.include?(SentryNotificationExtension) SentryNotificationExtension.module_eval do def instrument(name, payload = {}, &block) super end end end end def self.get_current_transaction Sentry.get_current_scope.get_transaction if Sentry.initialized? end # it's just a container for the extended method module SentryNotificationExtension end end end end sentry-rails-5.16.1/lib/sentry/rails/backtrace_cleaner.rb0000644000004100000410000000150614560175414023442 0ustar www-datawww-datarequire "active_support/backtrace_cleaner" require "active_support/core_ext/string/access" module Sentry module Rails class BacktraceCleaner < ActiveSupport::BacktraceCleaner APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w*\))/.freeze RENDER_TEMPLATE_PATTERN = /:in `.*_\w+_{2,3}\d+_\d+'/.freeze def initialize super # we don't want any default silencers because they're too aggressive remove_silencers! @root = "#{Sentry.configuration.project_root}/" add_filter do |line| line.start_with?(@root) ? line.from(@root.size) : line end add_filter do |line| if line =~ RENDER_TEMPLATE_PATTERN line.sub(RENDER_TEMPLATE_PATTERN, "") else line end end end end end end sentry-rails-5.16.1/lib/sentry/rails/active_job.rb0000644000004100000410000000520214560175414022134 0ustar www-datawww-datamodule Sentry module Rails module ActiveJobExtensions def perform_now if !Sentry.initialized? || already_supported_by_sentry_integration? super else SentryReporter.record(self) do super end end end def already_supported_by_sentry_integration? Sentry.configuration.rails.skippable_job_adapters.include?(self.class.queue_adapter.class.to_s) end class SentryReporter OP_NAME = "queue.active_job".freeze class << self def record(job, &block) Sentry.with_scope do |scope| begin scope.set_transaction_name(job.class.name, source: :task) transaction = if job.is_a?(::Sentry::SendEventJob) nil else Sentry.start_transaction(name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME) end scope.set_span(transaction) if transaction yield.tap do finish_sentry_transaction(transaction, 200) end rescue Exception => e # rubocop:disable Lint/RescueException finish_sentry_transaction(transaction, 500) Sentry::Rails.capture_exception( e, extra: sentry_context(job), tags: { job_id: job.job_id, provider_job_id: job.provider_job_id } ) raise end end end def finish_sentry_transaction(transaction, status) return unless transaction transaction.set_http_status(status) transaction.finish end def sentry_context(job) { active_job: job.class.name, arguments: sentry_serialize_arguments(job.arguments), scheduled_at: job.scheduled_at, job_id: job.job_id, provider_job_id: job.provider_job_id, locale: job.locale } end def sentry_serialize_arguments(argument) case argument when Hash argument.transform_values { |v| sentry_serialize_arguments(v) } when Array, Enumerable argument.map { |v| sentry_serialize_arguments(v) } when ->(v) { v.respond_to?(:to_global_id) } argument.to_global_id.to_s rescue argument else argument end end end end end end end sentry-rails-5.16.1/lib/sentry/rails/background_worker.rb0000644000004100000410000000062114560175414023537 0ustar www-datawww-datamodule Sentry class BackgroundWorker def _perform(&block) block.call ensure # some applications have partial or even no AR connection if ActiveRecord::Base.connected? # make sure the background worker returns AR connection if it accidentally acquire one during serialization ActiveRecord::Base.connection_pool.release_connection end end end end sentry-rails-5.16.1/lib/sentry/rails/rescued_exception_interceptor.rb0000644000004100000410000000076714560175414026170 0ustar www-datawww-datamodule Sentry module Rails class RescuedExceptionInterceptor def initialize(app) @app = app end def call(env) return @app.call(env) unless Sentry.initialized? begin @app.call(env) rescue => e env["sentry.rescued_exception"] = e if report_rescued_exceptions? raise e end end def report_rescued_exceptions? Sentry.configuration.rails.report_rescued_exceptions end end end end sentry-rails-5.16.1/lib/sentry/rails/breadcrumb/0000755000004100000410000000000014560175414021611 5ustar www-datawww-datasentry-rails-5.16.1/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb0000644000004100000410000000236514560175414030637 0ustar www-datawww-datarequire "sentry/rails/instrument_payload_cleanup_helper" module Sentry module Rails module Breadcrumb module MonotonicActiveSupportLogger class << self include InstrumentPayloadCleanupHelper def add(name, started, _finished, _unique_id, data) # skip Rails' internal events return if name.start_with?("!") if data.is_a?(Hash) # we should only mutate the copy of the data data = data.dup cleanup_data(data) end crumb = Sentry::Breadcrumb.new( data: data, category: name, timestamp: started.to_i ) Sentry.add_breadcrumb(crumb) end def inject @subscriber = ::ActiveSupport::Notifications.monotonic_subscribe(/.*/) do |name, started, finished, unique_id, data| # we only record events that has a float as started timestamp if started.is_a?(Float) add(name, started, finished, unique_id, data) end end end def detach ::ActiveSupport::Notifications.unsubscribe(@subscriber) end end end end end end sentry-rails-5.16.1/lib/sentry/rails/breadcrumb/active_support_logger.rb0000644000004100000410000000214014560175414026541 0ustar www-datawww-datamodule Sentry module Rails module Breadcrumb module ActiveSupportLogger class << self def add(name, started, _finished, _unique_id, data) # skip Rails' internal events return if name.start_with?("!") if data.is_a?(Hash) data = data.slice(*@allowed_keys[name]) end crumb = Sentry::Breadcrumb.new( data: data, category: name, timestamp: started.to_i ) Sentry.add_breadcrumb(crumb) end def inject(allowed_keys) @allowed_keys = allowed_keys @subscriber = ::ActiveSupport::Notifications.subscribe(/.*/) do |name, started, finished, unique_id, data| # we only record events that has a started timestamp if started.is_a?(Time) add(name, started, finished, unique_id, data) end end end def detach ::ActiveSupport::Notifications.unsubscribe(@subscriber) end end end end end end sentry-rails-5.16.1/lib/sentry/rails/version.rb0000644000004100000410000000007614560175414021520 0ustar www-datawww-datamodule Sentry module Rails VERSION = "5.16.1" end end sentry-rails-5.16.1/lib/sentry/rails/capture_exceptions.rb0000644000004100000410000000326014560175414023735 0ustar www-datawww-datamodule Sentry module Rails class CaptureExceptions < Sentry::Rack::CaptureExceptions RAILS_7_1 = Gem::Version.new(::Rails.version) >= Gem::Version.new("7.1.0.alpha") def initialize(_) super if Sentry.initialized? @assets_regexp = Sentry.configuration.rails.assets_regexp end end private def collect_exception(env) return nil if env["sentry.already_captured"] super || env["action_dispatch.exception"] || env["sentry.rescued_exception"] end def transaction_op "http.server".freeze end def capture_exception(exception, env) # the exception will be swallowed by ShowExceptions middleware return if show_exceptions?(exception, env) && !Sentry.configuration.rails.report_rescued_exceptions Sentry::Rails.capture_exception(exception).tap do |event| env[ERROR_EVENT_ID_KEY] = event.event_id if event end end def start_transaction(env, scope) options = { name: scope.transaction_name, source: scope.transaction_source, op: transaction_op } if @assets_regexp && scope.transaction_name.match?(@assets_regexp) options.merge!(sampled: false) end transaction = Sentry.continue_trace(env, **options) Sentry.start_transaction(transaction: transaction, custom_sampling_context: { env: env }, **options) end def show_exceptions?(exception, env) request = ActionDispatch::Request.new(env) if RAILS_7_1 ActionDispatch::ExceptionWrapper.new(nil, exception).show?(request) else request.show_exceptions? end end end end end sentry-rails-5.16.1/lib/sentry/rails/railtie.rb0000644000004100000410000001305614560175414021466 0ustar www-datawww-datarequire "sentry/rails/capture_exceptions" require "sentry/rails/rescued_exception_interceptor" require "sentry/rails/backtrace_cleaner" module Sentry class Railtie < ::Rails::Railtie # middlewares can't be injected after initialize initializer "sentry.use_rack_middleware" do |app| # placed after all the file-sending middlewares so we can avoid unnecessary transactions app.config.middleware.insert_after ActionDispatch::ShowExceptions, Sentry::Rails::CaptureExceptions # need to place as close to DebugExceptions as possible to intercept most of the exceptions, including those raised by middlewares app.config.middleware.insert_after ActionDispatch::DebugExceptions, Sentry::Rails::RescuedExceptionInterceptor end # because the extension works by registering the around_perform callcack, it should always be ran # before the application is eager-loaded (before user's jobs register their own callbacks) # See https://github.com/getsentry/sentry-ruby/issues/1249#issuecomment-853871871 for the detail explanation initializer "sentry.extend_active_job", before: :eager_load! do |app| ActiveSupport.on_load(:active_job) do require "sentry/rails/active_job" prepend Sentry::Rails::ActiveJobExtensions end end initializer "sentry.extend_action_cable", before: :eager_load! do |app| ActiveSupport.on_load(:action_cable_connection) do require "sentry/rails/action_cable" prepend Sentry::Rails::ActionCableExtensions::Connection end ActiveSupport.on_load(:action_cable_channel) do require "sentry/rails/action_cable" include Sentry::Rails::ActionCableExtensions::Channel::Subscriptions prepend Sentry::Rails::ActionCableExtensions::Channel::Actions end end config.after_initialize do |app| next unless Sentry.initialized? configure_project_root configure_trusted_proxies configure_cron_timezone extend_controller_methods if defined?(ActionController) patch_background_worker if defined?(ActiveRecord) override_streaming_reporter if defined?(ActionView) setup_backtrace_cleanup_callback inject_breadcrumbs_logger activate_tracing register_error_subscriber(app) if ::Rails.version.to_f >= 7.0 && Sentry.configuration.rails.register_error_subscriber end runner do next unless Sentry.initialized? Sentry.configuration.background_worker_threads = 0 at_exit do # TODO: Add a condition for Rails 7.1 to avoid confliction with https://github.com/rails/rails/pull/44999 if $ERROR_INFO && !($ERROR_INFO.is_a?(SystemExit) && $ERROR_INFO.success?) Sentry::Rails.capture_exception($ERROR_INFO, tags: { source: "runner" }) end end end def configure_project_root Sentry.configuration.project_root = ::Rails.root.to_s end def configure_trusted_proxies Sentry.configuration.trusted_proxies += Array(::Rails.application.config.action_dispatch.trusted_proxies) end def configure_cron_timezone tz_info = ::ActiveSupport::TimeZone.find_tzinfo(::Rails.application.config.time_zone) Sentry.configuration.cron.default_timezone = tz_info.name end def extend_controller_methods require "sentry/rails/controller_methods" require "sentry/rails/controller_transaction" require "sentry/rails/overrides/streaming_reporter" ActiveSupport.on_load :action_controller do include Sentry::Rails::ControllerMethods include Sentry::Rails::ControllerTransaction ActionController::Live.send(:prepend, Sentry::Rails::Overrides::StreamingReporter) end end def patch_background_worker require "sentry/rails/background_worker" end def inject_breadcrumbs_logger if Sentry.configuration.breadcrumbs_logger.include?(:active_support_logger) require 'sentry/rails/breadcrumb/active_support_logger' Sentry::Rails::Breadcrumb::ActiveSupportLogger.inject(Sentry.configuration.rails.active_support_logger_subscription_items) end if Sentry.configuration.breadcrumbs_logger.include?(:monotonic_active_support_logger) return warn "Usage of `monotonic_active_support_logger` require a version of Rails >= 6.1, please upgrade your Rails version or use another logger" if ::Rails.version.to_f < 6.1 require 'sentry/rails/breadcrumb/monotonic_active_support_logger' Sentry::Rails::Breadcrumb::MonotonicActiveSupportLogger.inject end end def setup_backtrace_cleanup_callback backtrace_cleaner = Sentry::Rails::BacktraceCleaner.new Sentry.configuration.backtrace_cleanup_callback ||= lambda do |backtrace| backtrace_cleaner.clean(backtrace) end end def override_streaming_reporter require "sentry/rails/overrides/streaming_reporter" ActiveSupport.on_load :action_view do ActionView::StreamingTemplateRenderer::Body.send(:prepend, Sentry::Rails::Overrides::StreamingReporter) end end def activate_tracing if Sentry.configuration.tracing_enabled? && Sentry.configuration.instrumenter == :sentry subscribers = Sentry.configuration.rails.tracing_subscribers Sentry::Rails::Tracing.register_subscribers(subscribers) Sentry::Rails::Tracing.subscribe_tracing_events Sentry::Rails::Tracing.patch_active_support_notifications end end def register_error_subscriber(app) require "sentry/rails/error_subscriber" app.executor.error_reporter.subscribe(Sentry::Rails::ErrorSubscriber.new) end end end sentry-rails-5.16.1/lib/sentry/rails/instrument_payload_cleanup_helper.rb0000644000004100000410000000053414560175414027021 0ustar www-datawww-datamodule Sentry module Rails module InstrumentPayloadCleanupHelper IGNORED_DATA_TYPES = [:request, :response, :headers, :exception, :exception_object, Tracing::START_TIMESTAMP_NAME] def cleanup_data(data) IGNORED_DATA_TYPES.each do |key| data.delete(key) if data.key?(key) end end end end end sentry-rails-5.16.1/lib/sentry/rails/overrides/0000755000004100000410000000000014560175414021505 5ustar www-datawww-datasentry-rails-5.16.1/lib/sentry/rails/overrides/streaming_reporter.rb0000644000004100000410000000102014560175414025736 0ustar www-datawww-datamodule Sentry module Rails module Overrides module StreamingReporter def log_error(exception) Sentry::Rails.capture_exception(exception) super end end module OldStreamingReporter def self.included(base) base.send(:alias_method_chain, :log_error, :raven) end def log_error_with_raven(exception) Sentry::Rails.capture_exception(exception) log_error_without_raven(exception) end end end end end sentry-rails-5.16.1/lib/sentry/rails/controller_methods.rb0000644000004100000410000000107114560175414023735 0ustar www-datawww-datamodule Sentry module Rails module ControllerMethods def capture_message(message, options = {}) with_request_scope do Sentry::Rails.capture_message(message, **options) end end def capture_exception(exception, options = {}) with_request_scope do Sentry::Rails.capture_exception(exception, **options) end end private def with_request_scope Sentry.with_scope do |scope| scope.set_rack_env(request.env) yield end end end end end sentry-rails-5.16.1/lib/sentry-rails.rb0000644000004100000410000000006614560175414020030 0ustar www-datawww-datarequire "sentry/rails/version" require "sentry/rails" sentry-rails-5.16.1/LICENSE.txt0000644000004100000410000000206114560175414016121 0ustar www-datawww-dataThe MIT License (MIT) Copyright (c) 2020 Sentry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. sentry-rails-5.16.1/.rspec0000644000004100000410000000006514560175414015415 0ustar www-datawww-data--format documentation --color --require spec_helper sentry-rails-5.16.1/Rakefile0000644000004100000410000000045214560175414015745 0ustar www-datawww-datarequire "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec).tap do |task| task.rspec_opts = "--order rand" end task :isolated_specs do Dir["spec/isolated/*"].each do |file| sh "bundle exec ruby #{file}" end end task :default => [:spec, :isolated_specs] sentry-rails-5.16.1/Gemfile0000644000004100000410000000254314560175414015576 0ustar www-datawww-datasource "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } # Specify your gem's dependencies in sentry-ruby.gemspec gemspec gem "sentry-ruby", path: "../sentry-ruby" platform :jruby do gem 'activerecord-jdbcmysql-adapter' gem "jdbc-sqlite3" end rails_version = ENV["RAILS_VERSION"] rails_version = "7.1.0" if rails_version.nil? rails_version = Gem::Version.new(rails_version) if rails_version < Gem::Version.new("6.0.0") gem "sqlite3", "~> 1.3.0", platform: :ruby else # 1.7.0 dropped support for ruby < 3.0, remove later after upgrading craft setup gem "sqlite3", "1.6.9", platform: :ruby end if rails_version >= Gem::Version.new("7.2.0.alpha") gem "rails", github: "rails/rails" elsif rails_version >= Gem::Version.new("7.1.0") gem "rails", "~> #{rails_version}" else gem "rails", "~> #{rails_version}" gem "psych", "~> 3.0.0" end gem "mini_magick" gem "sprockets-rails" gem "sidekiq" gem "rspec-rails", "~> 4.0" ruby_version = Gem::Version.new(RUBY_VERSION) if ruby_version < Gem::Version.new("2.5.0") # https://github.com/flavorjones/loofah/pull/267 # loofah changed the required ruby version in a patch so we need to explicitly pin it gem "loofah", "2.20.0" end gem "benchmark-ips" gem "benchmark_driver" gem "benchmark-ipsa" gem "benchmark-memory" eval_gemfile File.expand_path("../Gemfile", __dir__) sentry-rails-5.16.1/sentry-rails.gemspec0000644000004100000410000000203014560175414020273 0ustar www-datawww-datarequire_relative "lib/sentry/rails/version" Gem::Specification.new do |spec| spec.name = "sentry-rails" spec.version = Sentry::Rails::VERSION spec.authors = ["Sentry Team"] spec.description = spec.summary = "A gem that provides Rails integration for the Sentry error logger" spec.email = "accounts@sentry.io" spec.license = 'MIT' spec.homepage = "https://github.com/getsentry/sentry-ruby" spec.platform = Gem::Platform::RUBY spec.required_ruby_version = '>= 2.4' spec.extra_rdoc_files = ["README.md", "LICENSE.txt"] spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples)'`.split("\n") spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md" spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.add_dependency "railties", ">= 5.0" spec.add_dependency "sentry-ruby", "~> 5.16.1" end sentry-rails-5.16.1/app/0000755000004100000410000000000014560175414015057 5ustar www-datawww-datasentry-rails-5.16.1/app/jobs/0000755000004100000410000000000014560175414016014 5ustar www-datawww-datasentry-rails-5.16.1/app/jobs/sentry/0000755000004100000410000000000014560175414017340 5ustar www-datawww-datasentry-rails-5.16.1/app/jobs/sentry/send_event_job.rb0000644000004100000410000000174414560175414022657 0ustar www-datawww-dataif defined?(ActiveJob) module Sentry parent_job = if defined?(::ApplicationJob) && ::ApplicationJob.ancestors.include?(::ActiveJob::Base) ::ApplicationJob else ::ActiveJob::Base end class SendEventJob < parent_job # the event argument is usually large and creates noise self.log_arguments = false if respond_to?(:log_arguments=) # this will prevent infinite loop when there's an issue deserializing SentryJob if respond_to?(:discard_on) discard_on ActiveJob::DeserializationError else # mimic what discard_on does for Rails 5.0 rescue_from ActiveJob::DeserializationError do |exception| logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{exception.cause.inspect}." end end def perform(event, hint = {}) Sentry.send_event(event, hint) end end end else module Sentry class SendEventJob; end end end sentry-rails-5.16.1/README.md0000644000004100000410000000575514560175414015572 0ustar www-datawww-data


# sentry-rails, the Rails integration for Sentry's Ruby client --- [![Gem Version](https://img.shields.io/gem/v/sentry-rails.svg)](https://rubygems.org/gems/sentry-rails) ![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_rails_test.yml/badge.svg) [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) [![Gem](https://img.shields.io/gem/dt/sentry-rails.svg)](https://rubygems.org/gems/sentry-rails/) [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=sentry-rails&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=sentry-rails&package-manager=bundler&version-scheme=semver) [Documentation](https://docs.sentry.io/platforms/ruby/guides/rails/) | [Bug Tracker](https://github.com/getsentry/sentry-ruby/issues) | [Forum](https://forum.sentry.io/) | IRC: irc.freenode.net, #sentry The official Ruby-language client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API. ## Requirements This integration requires Rails version >= 5.0 and Ruby version >= 2.4 ## Getting Started ### Install ```ruby gem "sentry-rails" ``` ### Integration Specific Configuration This gem has a few Rails-specific configuration options ```ruby Sentry.init do |config| # report exceptions rescued by ActionDispatch::ShowExceptions or ActionDispatch::DebugExceptions middlewares # the default value is true config.rails.report_rescued_exceptions = true # this gem also provides a new breadcrumb logger that accepts instrumentations from ActiveSupport # it's not activated by default, but you can enable it with config.breadcrumbs_logger = [:active_support_logger] end ``` ### Performance Monitoring You can activate performance monitoring by enabling traces sampling: ```ruby Sentry.init do |config| # set a uniform sample rate between 0.0 and 1.0 config.traces_sample_rate = 0.2 # or control sampling dynamically config.traces_sampler = lambda do |sampling_context| # sampling_context[:transaction_context] contains the information about the transaction # sampling_context[:parent_sampled] contains the transaction's parent's sample decision true # return value can be a boolean or a float between 0.0 and 1.0 end end ``` Currently, it tracks the following Rails instrumentation events: - ActiveRecord - `sql.active_record` - ActionController - `process_action.action_controller` - ActionView - `render_template.action_view` - `render_partial.action_view` - `render_collection.action_view` To lean more about performance monitoring, please visit the [official documentation](https://docs.sentry.io/platforms/ruby/guides/rails/performance/). sentry-rails-5.16.1/CHANGELOG.md0000644000004100000410000001726314560175414016121 0ustar www-datawww-data# Changelog Individual gem's changelog has been deprecated. Please check the [project changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md). ## 4.4.0 ### Features - Make tracing subscribers configurable [#1344](https://github.com/getsentry/sentry-ruby/pull/1344) ```ruby # current default: # - Sentry::Rails::Tracing::ActionControllerSubscriber # - Sentry::Rails::Tracing::ActionViewSubscriber # - Sentry::Rails::Tracing::ActiveRecordSubscriber # you can add a new subscriber config.rails.tracing_subscribers << MySubscriber # or replace the set completely config.rails.tracing_subscribers = [MySubscriber] ``` ### Bug Fixes - Report exceptions from the interceptor middleware for exceptions app [#1379](https://github.com/getsentry/sentry-ruby/pull/1379) - Fixes [#1371](https://github.com/getsentry/sentry-ruby/issues/1371) - Re-position CaptureExceptions middleware to reduce tracing noise [#1405](https://github.com/getsentry/sentry-ruby/pull/1405) ## 4.3.4 - Don't assign Rails.logger if it's not present [#1387](https://github.com/getsentry/sentry-ruby/pull/1387) - Fixes [#1386](https://github.com/getsentry/sentry-ruby/issues/1386) ## 4.3.3 - Correctly set the SDK's logger in sentry-rails [#1363](https://github.com/getsentry/sentry-ruby/pull/1363) - Fixes [#1361](https://github.com/getsentry/sentry-ruby/issues/1361) ## 4.3.3-beta.0 - Minimize sentry-rails' dependency requirement [#1352](https://github.com/getsentry/sentry-ruby/pull/1352) ## 4.3.2 - Avoid recording SendEventJob's transaction [#1351](https://github.com/getsentry/sentry-ruby/pull/1351) - Fixes [#1348](https://github.com/getsentry/sentry-ruby/issues/1348) ## 4.3.1 - Only apply background worker patch if ActiveRecord is loaded [#1350](https://github.com/getsentry/sentry-ruby/pull/1350) - Fixes [#1342](https://github.com/getsentry/sentry-ruby/issues/1342) and [#1346](https://github.com/getsentry/sentry-ruby/issues/1346) ## 4.3.0 ### Features - Support performance monitoring on ActiveJob execution [#1304](https://github.com/getsentry/sentry-ruby/pull/1304) ### Bug Fixes - Prevent background workers from holding ActiveRecord connections [#1320](https://github.com/getsentry/sentry-ruby/pull/1320) ## 4.2.2 - Always define Sentry::SendEventJob to avoid eager load issues [#1286](https://github.com/getsentry/sentry-ruby/pull/1286) - Fixes [#1283](https://github.com/getsentry/sentry-ruby/issues/1283) ## 4.2.1 - Add additional checks to SendEventJob's definition [#1275](https://github.com/getsentry/sentry-ruby/pull/1275) - Fixes [#1270](https://github.com/getsentry/sentry-ruby/issues/1270) - Fixes [#1277](https://github.com/getsentry/sentry-ruby/issues/1277) ## 4.2.0 ### Features - Make sentry-rails a Rails engine and provide default job class for async [#1181](https://github.com/getsentry/sentry-ruby/pull/1181) `sentry-rails` now provides a default ActiveJob class for sending events asynchronously. You can use it directly without define your own one: ```ruby config.async = lambda { |event, hint| Sentry::SendEventJob.perform_later(event, hint) } ``` - Add configuration option for trusted proxies [#1126](https://github.com/getsentry/sentry-ruby/pull/1126) `sentry-rails` now injects `Rails.application.config.action_dispatch.trusted_proxies` into `Sentry.configuration.trusted_proxies` automatically. - Allow users to configure ActiveJob adapters to ignore [#1256](https://github.com/getsentry/sentry-ruby/pull/1256) ```ruby # sentry-rails will skip active_job reporting for jobs that use ActiveJob::QueueAdapters::SidekiqAdapter # you should use this option when: # - you don't want to see events from a certain adapter # - you already have a better reporting setup for the adapter (like having `sentry-sidekiq` installed) config.rails.skippable_job_adapters = ["ActiveJob::QueueAdapters::SidekiqAdapter"] ``` - Tag `job_id` and `provider_job_id` on ActiveJob events [#1259](https://github.com/getsentry/sentry-ruby/pull/1259) example of tagged event - Use another method for post initialization callback [#1261](https://github.com/getsentry/sentry-ruby/pull/1261) ### Bug Fixes - Inspect exception cause by default & don't exclude ActiveJob::DeserializationError [#1180](https://github.com/getsentry/sentry-ruby/pull/1180) - Fixes [#1071](https://github.com/getsentry/sentry-ruby/issues/1071) ## 4.1.7 - Use env to carry original transaction name [#1255](https://github.com/getsentry/sentry-ruby/pull/1255) - Fix duration of tracing event in Rails 5 [#1254](https://github.com/getsentry/sentry-ruby/pull/1254) (by @abcang) - Filter out static file transaction [#1247](https://github.com/getsentry/sentry-ruby/pull/1247) ## 4.1.6 - Prevent exceptions app from overriding event's transaction name [#1230](https://github.com/getsentry/sentry-ruby/pull/1230) - Fix project root detection [#1242](https://github.com/getsentry/sentry-ruby/pull/1242) - Use sentry-ruby-core as the main SDK dependency [#1244](https://github.com/getsentry/sentry-ruby/pull/1244) ## 4.1.5 - Add `ActionDispatch::Http::MimeNegotiation::InvalidType` to the list of default ignored Rails exceptions [#1215](https://github.com/getsentry/sentry-ruby/pull/1215) (by @agrobbin) - Continue ActiveJob execution if Sentry is not initialized [#1217](https://github.com/getsentry/sentry-ruby/pull/1217) - Fixes [#1211](https://github.com/getsentry/sentry-ruby/issues/1211) and [#1216](https://github.com/getsentry/sentry-ruby/issues/1216) - Only extend ActiveJob when it's defined [#1218](https://github.com/getsentry/sentry-ruby/pull/1218) - Fixes [#1210](https://github.com/getsentry/sentry-ruby/issues/1210) - Filter out redundant event/payload from breadcrumbs logger [#1222](https://github.com/getsentry/sentry-ruby/pull/1222) - Copy request env before Rails' ShowExceptions middleware [#1223](https://github.com/getsentry/sentry-ruby/pull/1223) - Don't subscribe render_partial and render_collection events [#1224](https://github.com/getsentry/sentry-ruby/pull/1224) ## 4.1.4 - Don't include headers & request info in tracing span or breadcrumb [#1199](https://github.com/getsentry/sentry-ruby/pull/1199) - Don't run RescuedExceptionInterceptor unless Sentry is initialized [#1204](https://github.com/getsentry/sentry-ruby/pull/1204) ## 4.1.3 - Remove DelayedJobAdapter from ignored list [#1179](https://github.com/getsentry/sentry-ruby/pull/1179) ## 4.1.2 - Use middleware instead of method override to handle rescued exceptions [#1168](https://github.com/getsentry/sentry-ruby/pull/1168) - Fixes [#738](https://github.com/getsentry/sentry-ruby/issues/738) - Adopt Integrable module [#1177](https://github.com/getsentry/sentry-ruby/pull/1177) ## 4.1.1 - Use stricter dependency declaration [#1159](https://github.com/getsentry/sentry-ruby/pull/1159) ## 4.1.0 - Merge & rename 2 Rack middlewares [#1147](https://github.com/getsentry/sentry-ruby/pull/1147) - Fixes [#1153](https://github.com/getsentry/sentry-ruby/pull/1153) - Removed `Sentry::Rack::Tracing` middleware and renamed `Sentry::Rack::CaptureException` to `Sentry::Rack::CaptureExceptions` - Tidy up rails integration [#1150](https://github.com/getsentry/sentry-ruby/pull/1150) - Check SDK initialization before running integrations [#1151](https://github.com/getsentry/sentry-ruby/pull/1151) - Fixes [#1145](https://github.com/getsentry/sentry-ruby/pull/1145) ## 4.0.0 - Only documents update for the official release and no API/feature changes. ## 0.3.0 - Major API changes: [1123](https://github.com/getsentry/sentry-ruby/pull/1123) ## 0.2.0 - Multiple fixes and refactorings - Tracing support ## 0.1.2 Fix require reference ## 0.1.1 Release test ## 0.1.0 First version sentry-rails-5.16.1/Makefile0000644000004100000410000000006714560175414015742 0ustar www-datawww-databuild: bundle install gem build sentry-rails.gemspec