Skip to content

Releases: getsentry/sentry-ruby

6.2.0

27 Nov 14:55

Choose a tag to compare

Features

  • Include otel as custom sampling context (2683)

Fixes

  • Prevent logging from crashing main thread (2795)
  • Improve error handling in ActiveRecord subscriber (2798)

6.1.2

25 Nov 10:54

Choose a tag to compare

Fixes

  • Handle positioned binds in logging (#2787)
  • Handle cached queries with binds correctly when logging (#2789)

6.1.1

20 Nov 10:30

Choose a tag to compare

Improvements

  • Optimize getting query source location in ActiveRecord tracing - this makes tracing up to roughly 40-60% faster depending on the use cases (#2769)

Bug fixes

  • Properly skip silenced ActiveRecord::Base.logger's log entries in the ActiveRecord log subscriber (#2775)
  • Handle malformed utf-8 log messages and attributes (#2777 and #2780)
  • Fix initialized check in Sentry::Rails::CaptureExceptions (#2783)

6.1.0

04 Nov 12:56

Choose a tag to compare

Features

  • Add support for ActiveRecord binds in the log events (#2761)

Bug Fixes

  • Guard log subscribers with initialized check (#2765)

6.0.0

22 Oct 10:19

Choose a tag to compare

Breaking Changes

  • Drop support for rubies below 2.7 #2743
    • Drop support for Rails below 5.2.0
    • Drop support for Sidekiq below 5.0
  • Remove deprecated config.async #1894
  • Remove deprecated Sentry::Metrics and config.metrics and all metrics related code (#2729)
  • Remove deprecated config.capture_exception_frame_locals, use include_local_variables instead (#2730)
  • Remove deprecated config.enable_tracing, use config.traces_sample_rate = 1.0 instead (#2731)
  • Remove deprecated config.logger=, use config.sdk_logger= instead (#2732)
  • Sentry.logger now always points to the StructuredLogger (#2752)
  • Remove deprecated Sentry::Rails::Tracing::ActionControllerSubscriber (#2733)
  • Remove deprecated Event#configuration (#2740)
  • Remove deprecated Sentry::Client#generate_sentry_trace and Sentry::Client#generate_baggage (#2741)
  • Remove Transaction deprecations (#2736)
    • Remove deprecated constant Sentry::Transaction::SENTRY_TRACE_REGEXP, use Sentry::PropagationContext::SENTRY_TRACE_REGEXP instead
    • Remove deprecated method Sentry::Transaction.from_sentry_trace, use Sentry.continue_trace instead
    • Remove deprecated method Sentry::Transaction.extract_sentry_trace, use Sentry::PropagationContext.extract_sentry_trace instead
    • Remove deprecated attribute Sentry::Transaction.configuration
    • Remove deprecated attribute Sentry::Transaction.hub
    • Remove deprecated argument hub to Sentry::Transaction.finish
    • Remove deprecated argument hub to Sentry::Transaction#initialize (#2739)
  • Remove :monotonic_active_support_logger from config.breadcrumbs_logger (#2717)
  • Migrate from to_hash to to_h (#2351)
  • Add before_send_check_in for applying to CheckInEvent (#2703)
  • Returning a hash from before_send and before_send_transaction is no longer supported and will drop the event.
  • config.enabled_environments now defaults to nil instead of [] for sending to all environments (#2716)
  • Requests which have response status codes in the inclusive ranges [(301..303), (305..399), (401..404)] will no longer create transactions by default. See config.trace_ignore_status_codes below to control what gets traced.
  • Stacktrace truncation for oversized events now takes 500 frames on each side instead of 250.

Features

  • Add config.trace_ignore_status_codes to control which response codes to ignore for tracing (#2725)

    You can pass in an Array of individual status codes or ranges of status codes.

    Sentry.init do |config|
        # ...
        # will ignore 404, 501, 502, 503
        config.trace_ignore_status_codes = [404, (501..503)]
    end
  • Add config.profiles_sample_interval to control sampling frequency (#2745)

    • Both stackprof and vernier now get sampled at a default frequency of 101 Hz.
  • Request body reading checks for :rewind to match Rack 3 behavior. (#2754)

Internal

  • Archive sentry-raven (#2708)
  • Don't send sample_rate client reports for profiles if profiling is disabled (#2728)

5.28.1

21 Oct 12:56

Choose a tag to compare

Bug Fixes

  • The sentry.origin log event attribute is now correctly prefixed with auto.log (#2749)

5.28.0

26 Sep 10:45

Choose a tag to compare

Features

  • Auto-enable Rails structured logging when enable_logs is true (#2721)

Miscellaneous

  • Deprecate all Metrics related APIs #2726

    Sentry no longer has the Metrics Beta offering so
    all the following APIs linked to Metrics have been deprecated and will be removed in the next major.

    Sentry.init do |config|
      # ...
      config.metrics.enabled = true
      config.metrics.enable_code_locations = true
      config.metrics.before_emit = lambda {}
    end
    
    Sentry::Metrics.increment('button_click')
    Sentry::Metrics.distribution('page_load', 15.0, unit: 'millisecond')
    Sentry::Metrics.gauge('page_load', 15.0, unit: 'millisecond')
    Sentry::Metrics.set('user_view', 'jane')
    Sentry::Metrics.timing('how_long') { sleep(1) }

Internal

  • Fix leftover config.logger call in graphql patch (#2722
  • Add Configuration.before and Configuration.after to run hooks before and after given event (#2724)

5.27.1

22 Sep 14:06

Choose a tag to compare

Features

  • Support for :origin attribute in log events (#2712)

Bug Fixes

  • Skip including sentry.message.template in the log event attributes if there are no interpolation parameters provided (#2700)
  • Respect log_level when logging via :std_lib_logger patch (#2709)
  • Add sentry.origin attribute to log events (#2712)

5.27.0

08 Sep 13:46

Choose a tag to compare

Feature

  • Propagated sampling rates as specified in Traces docs (#2671)

  • Support for Rails ActiveSupport log subscribers (#2690)

  • Support for defining custom Rails log subscribers that work with Sentry Structured Logging (#2689)

    Rails applications can now define custom log subscribers that integrate with Sentry's structured logging system. The feature includes built-in subscribers for ActionController, ActiveRecord, ActiveJob, and ActionMailer events, with automatic parameter filtering that respects Rails' config.filter_parameters configuration.

    To enable structured logging with Rails log subscribers:

    Sentry.init do |config|
      # ... your setup ...
    
      # Make sure structured logging is enabled
      config.enable_logs = true
    
      # Enable default Rails log subscribers (ActionController and ActiveRecord)
      config.rails.structured_logging.enabled = true
    end

    To configure all subscribers:

    Sentry.init do |config|
      # ... your setup ...
    
      # Make sure structured logging is enabled
      config.enable_logs = true
    
      # Enable Rails log subscribers
      config.rails.structured_logging.enabled = true
    
      # Add ActionMailer and ActiveJob subscribers
      config.rails.structured_logging.subscribers.update(
        action_mailer: Sentry::Rails::LogSubscribers::ActionMailerSubscriber,
        active_job: Sentry::Rails::LogSubscribers::ActiveJobSubscriber
      )
    end

    You can also define custom log subscribers by extending the base class:

    class MyCustomSubscriber < Sentry::Rails::LogSubscriber
      attach_to :my_component
    
      def my_event(event)
        log_structured_event(
          message: "Custom event occurred",
          level: :info,
          attributes: { duration_ms: event.duration }
        )
      end
    end
    
    Sentry.init do |config|
      # ... your setup ...
    
      # Make sure structured logging is enabled
      config.enable_logs = true
    
      # Enable Rails log subscribers
      config.rails.structured_logging.enabled = true
    
      # Add custom subscriber
      config.rails.structured_logging.subscribers[:my_component] = MyCustomSubscriber
    end
  • Introduce structured_logging config namespace (#2692)

Bug Fixes

  • Silence _perform method redefinition warning (#2682)
  • Update sentry trace regexp (#2678)
  • Remove redundant attr_reader (#2673)

Internal

  • Factor out do_request in HTTP transport (#2662)
  • Add Sentry::DebugTransport that captures events and stores them as JSON for debugging purposes (#2664)
  • Add Sentry::DebugStructuredLogger that caputres log events and stores them as JSON to a file for debugging purposes (#2693)
  • Rails test runner (#2687)
  • Update common gem deps for development (#2688)
  • Make devcontainer work with ancient Ruby/Rails (#2679)
  • Improved devcontainer setup with e2e test mini infra (#2672)
  • Address various flaky specs
    • Fix test failures under JRuby (#2665)
    • Fix flaky faraday spec (#2666)
    • Fix flaky net/http spec (#2667)
    • Fix flaky tracing specs (#2670)

5.26.0

30 Jun 12:51

Choose a tag to compare

Feature

  • Support for :logger patch which enables sending logs to Sentry when enabled_logs is set to true (#2657)

    Here's a sample config:

    Sentry.init do |config|
      # ... your setup ...
      config.enable_logs = true
      config.enabled_patches = [:logger]
    end

Bug Fixes

  • Skip creating LogEventBuffer if logging is not enabled (#2652)