Skip to content

Releases: getsentry/sentry-ruby

5.18.0

25 Jun 12:57
Compare
Choose a tag to compare

Features

  • Add generator for initializer generation (#2286)

    Rails users will be able to use bin/rails generate sentry to generate their config/initializers/sentry.rb file.

  • Notify users when their custom options are discarded (#2303)

  • Add a new :graphql patch to automatically enable instrumenting GraphQL spans (#2308)

    Usage:

    Sentry.init do |config|
      # ...
      config.enabled_patches += [:graphql]
    end
  • Add Sentry.get_trace_propagation_meta helper for injecting meta tags into views (#2314)

  • Add query source support to sentry-rails (#2313)

    The feature is only activated in apps that use Ruby 3.2+ and Rails 7.1+. By default only queries that take longer than 100ms will have source recorded, which can be adjusted by updating the value of config.rails.db_query_source_threshold_ms.

  • Log envelope delivery message with debug instead of info (#2320)

Bug Fixes

  • Don't throw error on arbitrary arguments being passed to capture_event options #2301
  • Decrease the default number of background worker threads by half (#2305)
  • Don't mutate enabled_environments when using Sentry::TestHelper (#2317)
  • Don't use array for transaction names and sources on scope (#2324)
    • Fixes #2257
    • BREAKING This removes the internal scope.transaction_names method, please use scope.transaction_name instead

Internal

  • Add origin to spans and transactions to track integration sources for instrumentation (#2319)

5.17.3

11 Apr 16:25
Compare
Choose a tag to compare

Internal

  • Update key, unit and tags sanitization logic for metrics #2292
  • Consolidate client report and rate limit handling with data categories #2294
  • Record :network_error client reports for send_envelope #2295

Bug Fixes

  • Make sure isolated envelopes respect config.enabled_environments #2291

5.17.2

04 Apr 07:50
Compare
Choose a tag to compare

Internal

  • Add Mechanism interface and default to unhandled for integration exceptions #2280

Bug Fixes

  • Don't instantiate connection in ActiveRecordSubscriber (#2278)

5.17.1

15 Mar 14:00
Compare
Choose a tag to compare

Bug Fixes

  • Fix NoMethodError / Make session_tracking check consistent (#2269)

5.17.0

13 Mar 17:01
Compare
Choose a tag to compare

Features

  • Add support for distributed tracing in sentry-delayed_job #2233
  • Fix warning about default gems on Ruby 3.3.0 (#2225)
  • Add hint: support to Sentry::Rails::ErrorSubscriber #2235
  • Add Metrics support
    • Add main APIs and Aggregator thread #2247

    • Add Sentry::Metrics.timing API for measuring block duration #2254

    • Add metric summaries on spans #2255

    • Add config.metrics.before_emit callback #2258

    • Add code locations for metrics #2263

      The SDK now supports recording and aggregating metrics. A new thread will be started
      for aggregation and will flush the pending data to Sentry every 5 seconds.

      To enable this behavior, use:

      Sentry.init do |config|
        # ...
        config.metrics.enabled = true
      end

      And then in your application code, collect metrics as follows:

      # increment a simple counter
      Sentry::Metrics.increment('button_click')
      # set a value, unit and tags
      Sentry::Metrics.increment('time', 5, unit: 'second', tags: { browser:' firefox' })
      
      # distribution - get statistical aggregates from an array of observations
      Sentry::Metrics.distribution('page_load', 15.0, unit: 'millisecond')
      
      # gauge - record statistical aggregates directly on the SDK, more space efficient
      Sentry::Metrics.gauge('page_load', 15.0, unit: 'millisecond')
      
      # set - get unique counts of elements
      Sentry::Metrics.set('user_view', 'jane')
      
      # timing - measure duration of code block, defaults to seconds
      # will also automatically create a `metric.timing` span
      Sentry::Metrics.timing('how_long') { sleep(1) }
      # timing - measure duration of code block in other duraton units
      Sentry::Metrics.timing('how_long_ms', unit: 'millisecond') { sleep(0.5) }

      You can filter some keys or update tags on the fly with the before_emit callback, which will be triggered before a metric is aggregated.

      Sentry.init do |config|
        # ...
        # the 'foo' metric will be filtered and the tags will be updated to add :bar and remove :baz
        config.metrics.before_emit = lambda do |key, tags|
          return nil if key == 'foo'
          tags[:bar] = 42
          tags.delete(:baz)
          true
        end
      end

      By default, the SDK will send code locations for unique metrics (defined by type, key and unit) once a day and with every startup/shutdown of your application.
      You can turn this off with the following:

      Sentry.init do |config|
        # ...
        config.metrics.enable_code_locations = false
      end

Bug Fixes

  • Fix undefined method 'constantize' issue in sentry-resque (#2248)
  • Only instantiate SessionFlusher when the SDK is enabled under the current env #2245
  • Update backtrace parsing regexp to support Ruby 3.4 (#2252)
  • Make sure sending_allowed? is respected irrespective of spotlight configuration (#2231)

5.16.1

09 Jan 14:20
Compare
Choose a tag to compare

Bug Fixes

  • Pin sqlite3 gem for building because of failed release #2222

5.16.0

08 Jan 14:12
Compare
Choose a tag to compare

Features

  • Add backpressure handling for transactions #2185

    The SDK can now dynamically downsample transactions to reduce backpressure in high
    throughput systems. It starts a new BackpressureMonitor thread to perform some health checks
    which decide to downsample (halved each time) in 10 second intervals till the system
    is healthy again.

    To enable this behavior, use:

    Sentry.init do |config|
      # ...
      config.traces_sample_rate = 1.0
      config.enable_backpressure_handling = true
    end

    If your system serves heavy load, please let us know how this feature works for you!

  • Implement proper flushing logic on close for Client Reports and Sessions #2206

  • Support cron with timezone for sidekiq-scheduler patch #2209

  • Add Cron::Configuration object that holds defaults for all MonitorConfig objects #2211

    Sentry.init do |config|
      # ...
      config.cron.default_checkin_margin = 1
      config.cron.default_max_runtime = 30
      config.cron.default_timezone = 'America/New_York'
    end
  • Clean up logging #2216

  • Pick up config.cron.default_timezone from Rails config #2213

  • Don't add most scope data (tags/extra/breadcrumbs) to CheckInEvent #2217

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