Skip to content

Releases: getsentry/sentry-ruby

5.15.2

18 Dec 17:33
Compare
Choose a tag to compare

Bug Fixes

  • Fix sample_rate applying to check-in events #2203

5.15.1

18 Dec 12:21
Compare
Choose a tag to compare

Features

  • Expose configuration.background_worker_max_queue to control thread pool queue size #2195

Bug Fixes

  • Fix Sentry::Cron::MonitorCheckIns monkeypatch keyword arguments #2199

5.15.0

05 Dec 15:00
Compare
Choose a tag to compare

Features

  • You can now use Spotlight with your apps that use sentry-ruby! #2175
  • Improve default slug generation for sidekiq-scheduler #2184

Bug Fixes

  • Network errors raised in Sentry::HTTPTransport will no longer be reported to Sentry #2178

5.14.0

27 Nov 14:26
Compare
Choose a tag to compare

Features

  • Improve default slug generation for Crons #2168
  • Change release name generator to use full SHA commit hash and align with sentry-cli and other Sentry SDKs #2174
  • Automatic Crons support for scheduling gems
    • Add support for sidekiq-cron #2170

      You can opt in to the sidekiq-cron patch and we will automatically monitor check-ins for all jobs listed in your config/schedule.yml file.

      config.enabled_patches += [:sidekiq_cron]
    • Add support for sidekiq-scheduler #2172

      You can opt in to the sidekiq-scheduler patch and we will automatically monitor check-ins for all repeating jobs (i.e. cron, every, and interval) specified in the config.

      config.enabled_patches += [:sidekiq_scheduler]

Bug Fixes

  • Fixed a deprecation in sidekiq-ruby error handler #2160
  • Avoid invoking ActiveSupport::BroadcastLogger if not defined #2169
  • Respect custom Delayed::Job.max_attempts if it's defined #2176
  • Fixed a bug where Net::HTTP instrumentation won't work for some IPv6 addresses #2180
  • Allow non-string error message to be reported to sentry (#2137)

5.13.0

09 Nov 14:18
Compare
Choose a tag to compare

Features

  • Make additional job context available to traces_sampler for determining sample rate (sentry-delayed_job) #2148

  • Add new config.rails.active_support_logger_subscription_items to allow customization breadcrumb data of active support logger #2139

      config.rails.active_support_logger_subscription_items["sql.active_record"] << :type_casted_binds
      config.rails.active_support_logger_subscription_items.delete("sql.active_record")
      config.rails.active_support_logger_subscription_items["foo"] = :bar
  • Enable opting out of patches #2151

Bug Fixes

  • Fix puma integration for versions before v5 #2141
  • Fix breadcrumbs with warn level not being ingested #2150
  • Don't send negative line numbers in profiles #2158

5.12.0

10 Oct 14:10
Compare
Choose a tag to compare

Features

  • Record client reports for profiles #2107
  • Adopt Rails 7.1's new BroadcastLogger #2120
  • Support sending events after all retries were performed (sentry-resque) #2087
  • Add Cron Monitoring support
    • Add Sentry.capture_check_in API for Cron Monitoring #2117

      You can now track progress of long running scheduled jobs.

      check_in_id = Sentry.capture_check_in('job_name', :in_progress)
      # do job stuff
      Sentry.capture_check_in('job_name', :ok, check_in_id: check_in_id)
    • Add Sentry::Cron::MonitorCheckIns module for automatic monitoring of jobs #2130

      Standard job frameworks such as ActiveJob and Sidekiq can now use this module to automatically capture check ins.

      class ExampleJob < ApplicationJob
        include Sentry::Cron::MonitorCheckIns
      
        sentry_monitor_check_ins
      
        def perform(*args)
          # do stuff
        end
      end
      class SidekiqJob
        include Sidekiq::Job
        include Sentry::Cron::MonitorCheckIns
      
        sentry_monitor_check_ins
      
        def perform(*args)
          # do stuff
        end
      end

      You can pass in optional attributes to sentry_monitor_check_ins as follows.

      # slug defaults to the job class name
      sentry_monitor_check_ins slug: 'custom_slug'
      
      # define the monitor config with an interval
      sentry_monitor_check_ins monitor_config: Sentry::Cron::MonitorConfig.from_interval(1, :minute)
      
      # define the monitor config with a crontab
      sentry_monitor_check_ins monitor_config: Sentry::Cron::MonitorConfig.from_crontab('5 * * * *')

Bug Fixes

  • Rename http.method to http.request.method in Span::DataConventions #2106
  • Increase Envelope::Item::MAX_SERIALIZED_PAYLOAD_SIZE to 1MB #2108
  • Fix db_config begin nil in ActiveRecordSubscriber #2111
  • Always send envelope trace header from dynamic sampling context #2113
  • Improve TestHelper's setup/teardown helpers (#2116)
  • Fix Sidekiq tracing headers not being overwritten in case of schedules and retries #2118
  • Fix exception event sending failed due to source sequence is illegal/malformed utf-8 #2083

5.11.0

06 Sep 11:02
Compare
Choose a tag to compare

Features

  • Make :value in SingleExceptionInterface writable, so that it can be modified in before_send under event.exception.values[n].value #2072

  • Add sampled field to dynamic_sampling_context #2092

  • Consolidate HTTP span data conventions with OpenTelemetry with Sentry::Span::DataConventions #2093

  • Consolidate database span data conventions with OpenTelemetry for ActiveRecord and Redis #2100

  • Add new config.trace_propagation_targets option to set targets for which headers are propagated in outgoing HTTP requests #2079

    # takes an array of strings or regexps
    config.trace_propagation_targets = [/.*/]  # default is to all targets
    config.trace_propagation_targets = [/example.com/, 'foobar.org/api/v2']
  • Tracing without Performance

    • Implement PropagationContext on Scope and add Sentry.get_trace_propagation_headers API #2084
    • Implement Sentry.continue_trace API #2089

    The SDK now supports connecting arbitrary events (Errors / Transactions / Replays) across distributed services and not just Transactions.
    To continue an incoming trace starting with this version of the SDK, use Sentry.continue_trace as follows.

    # rack application
    def call(env)
      transaction = Sentry.continue_trace(env, name: 'transaction', op: 'op')
      Sentry.start_transaction(transaction: transaction)
    end

    To inject headers into outgoing requests, use Sentry.get_trace_propagation_headers to get a hash of headers to add to your request.

Bug Fixes

  • Duplicate Rails.logger before assigning it to the SDK (#2086)

5.10.0

05 Jul 15:10
Compare
Choose a tag to compare

Features

  • Move http.query to span data in net/http integration #2039
  • Validate release is a String during configuration #2040
  • Allow JRuby Java exceptions to be captured #2043
  • Improved error handling around traces_sample_rate/profiles_sample_rate #2036

Bug Fixes

  • Support Rails 7.1's show exception check #2049
  • Fix uninitialzed race condition in Redis integration #2057
  • Ignore low-level Puma exceptions by default #2055
  • Use allowlist to filter ActiveSupport breadcrumbs' data #2048
  • ErrorHandler should cleanup the scope (#2059)

5.9.0

19 Apr 13:16
Compare
Choose a tag to compare

Features

  • Add new boolean option config.enable_tracing to simplify enabling performance tracing #2005

    • config.enable_tracing = true will set traces_sample_rate to 1.0 if not set already
    • config.enable_tracing = false will turn off tracing even if traces_sample_rate/traces_sampler is set
    • config.enable_tracing = nil (default) will keep the current behaviour
  • Allow ignoring excluded_exceptions when manually capturing exceptions #2007

    Users can now ignore the SDK's excluded_exceptions by passing ignore_exclusions hint when using Sentry.capture_exception.

    # assume ignored_exception.class is included in config.excluded_exception
    Sentry.capture_exception(ignored_exception) # won't be sent to Sentry
    Sentry.capture_exception(ignored_exception, hint: { ignore_exclusions: true }) # will be sent to Sentry
  • Support capturing low-level errors propagated to Puma #2026

  • Add spec to Backtrace::APP_DIRS_PATTERN #2029

  • Forward all baggage header items that are prefixed with sentry- #2025

  • Add stackprof based profiler #2024

    The SDK now supports sending profiles taken by the stackprof gem and viewing them in the Profiling section.

    To use it, first add stackprof to your Gemfile and make sure it is loaded before sentry-ruby.

    # Gemfile
    
    gem 'stackprof'
    gem 'sentry-ruby'

    Then, make sure both traces_sample_rate and profiles_sample_rate are set and non-zero in your sentry initializer.

    # config/initializers/sentry.rb
    
    Sentry.init do |config|
      config.dsn = "<dsn>"
      config.traces_sample_rate = 1.0
      config.profiles_sample_rate = 1.0
    end

    Some implementation caveats:

    • Profiles are sampled relative to traces, so if both rates are 0.5, we will capture 0.25 of all requests.
    • Profiles are only captured for code running within a transaction.
    • Profiles for multi-threaded servers like puma might not capture frames correctly when async I/O is happening. This is a stackprof limitation.

    Warning
    Profiling is currently in beta. Beta features are still in-progress and may have bugs. We recognize the irony.
    If you have any questions or feedback, please email us at profiling@sentry.io, reach out via Discord (#profiling), or open an issue.

Bug Fixes

  • Validate that contexts set in set_contexts are also Hash instances #2022

5.8.0

06 Feb 17:39
Compare
Choose a tag to compare

Features

  • Allow tags to be passed via the context hash when reporting errors using ActiveSupport::ErrorReporter and Sentry::Rails::ErrorSubscriber in sentry-rails #1932

  • Pass a cached: true tag for SQL query spans that utilized the ActiveRecord QueryCache when using ActiveRecordSubscriber in sentry-rails #1968

  • Add Sentry.add_global_event_processor API #1976

    Users can now configure global event processors without configuring scope as well.

    Sentry.add_global_event_processor do |event, hint|
      event.tags = { foo: 42 }
      event
    end
  • Add global event processor in OpenTelemetry SpanProcessor to link errors with transactions #1983

  • Fix some inconsistencies in setting name/op/status in OpenTelemetry SpanProcessor #1987

  • Add config.before_send_transaction hook #1989

    Users can now configure a before_send_transaction callback that runs similar to before_send but for transaction events.

    config.before_send_transaction = lambda do |event, hint|
      # skip unimportant transactions or strip sensitive data
      if event.transaction == "/healthcheck/route"
        nil
      else
        event
      end
    end
  • Support Sentry::Transaction#set_measurement #1838

    Usage:

    transaction = Sentry.get_current_scope.get_transaction
    transaction.set_measurement("metrics.foo", 0.5, "millisecond")

Bug Fixes

  • Support redis-rb 5.0+ #1963
  • Skip private _config context in Sidekiq 7+ #1967
  • Return value from perform_action in ActionCable::Channel instances when initialized #1966
  • Span#with_child_span should finish the span even with exception raised #1982
  • Fix sentry-rails' controller span nesting #1973
  • Do not report exceptions when a Rails runner exits with exit 0 #1988
  • Ignore redis key if not UTF8 #1997

Miscellaneous

  • Deprecate capture_exception_frame_locals in favor of include_local_variables #1993