-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump sentry-ruby from 5.11.0 to 5.12.0 #537
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem compare sentry-ruby 5.11.0 5.12.0 Compared versions: ["5.11.0", "5.12.0"]
DIFFERENT date:
5.11.0: 2023-09-06 00:00:00 UTC
5.12.0: 2023-10-10 00:00:00 UTC
DIFFERENT version:
5.11.0: 5.11.0
5.12.0: 5.12.0
DIFFERENT files:
5.11.0->5.12.0:
* Added:
lib/sentry/check_in_event.rb +60/-0
lib/sentry/cron/monitor_check_ins.rb +61/-0
lib/sentry/cron/monitor_config.rb +53/-0
lib/sentry/cron/monitor_schedule.rb +42/-0
* Changed:
Gemfile +7/-1
README.md +8/-8
lib/sentry-ruby.rb +20/-0
lib/sentry/client.rb +31/-0
lib/sentry/envelope.rb +1/-1
lib/sentry/hub.rb +25/-1
lib/sentry/integrable.rb +6/-0
lib/sentry/interfaces/single_exception.rb +2/-2
lib/sentry/profiler.rb +17/-6
lib/sentry/span.rb +1/-1
lib/sentry/test_helper.rb +18/-12
lib/sentry/transport.rb +4/-3
lib/sentry/utils/argument_checking_helper.rb +6/-0
lib/sentry/version.rb +1/-1
DIFFERENT extra_rdoc_files:
5.11.0->5.12.0:
* Changed:
README.md +8/-8
DIFFERENT Gemfile dependencies
5.11.0->5.12.0:
* Added:
ruby-lsp-rspec [">= 0"] (runtime) |
gem compare --diff sentry-ruby 5.11.0 5.12.0 Compared versions: ["5.11.0", "5.12.0"]
DIFFERENT files:
5.11.0->5.12.0:
* Added:
lib/sentry/check_in_event.rb
--- /tmp/20231011-1838-r09aqu 2023-10-11 02:12:21.149330864 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/check_in_event.rb 2023-10-11 02:12:21.141330479 +0000
@@ -0,0 +1,60 @@
+# frozen_string_literal
+
+require 'securerandom'
+require 'sentry/cron/monitor_config'
+
+module Sentry
+ class CheckInEvent < Event
+ TYPE = 'check_in'
+
+ # uuid to identify this check-in.
+ # @return [String]
+ attr_accessor :check_in_id
+
+ # Identifier of the monitor for this check-in.
+ # @return [String]
+ attr_accessor :monitor_slug
+
+ # Duration of this check since it has started in seconds.
+ # @return [Integer, nil]
+ attr_accessor :duration
+
+ # Monitor configuration to support upserts.
+ # @return [Cron::MonitorConfig, nil]
+ attr_accessor :monitor_config
+
+ # Status of this check-in.
+ # @return [Symbol]
+ attr_accessor :status
+
+ VALID_STATUSES = %i(ok in_progress error)
+
+ def initialize(
+ slug:,
+ status:,
+ duration: nil,
+ monitor_config: nil,
+ check_in_id: nil,
+ **options
+ )
+ super(**options)
+
+ self.monitor_slug = slug
+ self.status = status
+ self.duration = duration
+ self.monitor_config = monitor_config
+ self.check_in_id = check_in_id || SecureRandom.uuid.delete('-')
+ end
+
+ # @return [Hash]
+ def to_hash
+ data = super
+ data[:check_in_id] = check_in_id
+ data[:monitor_slug] = monitor_slug
+ data[:status] = status
+ data[:duration] = duration if duration
+ data[:monitor_config] = monitor_config.to_hash if monitor_config
+ data
+ end
+ end
+end
lib/sentry/cron/monitor_check_ins.rb
--- /tmp/20231011-1838-3r8c5p 2023-10-11 02:12:21.153331056 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/cron/monitor_check_ins.rb 2023-10-11 02:12:21.141330479 +0000
@@ -0,0 +1,61 @@
+module Sentry
+ module Cron
+ module MonitorCheckIns
+ module Patch
+ def perform(*args)
+ slug = self.class.sentry_monitor_slug || self.class.name
+ monitor_config = self.class.sentry_monitor_config
+
+ check_in_id = Sentry.capture_check_in(slug,
+ :in_progress,
+ monitor_config: monitor_config)
+
+ start = Sentry.utc_now.to_i
+ ret = super
+ duration = Sentry.utc_now.to_i - start
+
+ Sentry.capture_check_in(slug,
+ :ok,
+ check_in_id: check_in_id,
+ duration: duration,
+ monitor_config: monitor_config)
+
+ ret
+ rescue Exception
+ duration = Sentry.utc_now.to_i - start
+
+ Sentry.capture_check_in(slug,
+ :error,
+ check_in_id: check_in_id,
+ duration: duration,
+ monitor_config: monitor_config)
+
+ raise
+ end
+ end
+
+ module ClassMethods
+ def sentry_monitor_check_ins(slug: nil, monitor_config: nil)
+ @sentry_monitor_slug = slug
+ @sentry_monitor_config = monitor_config
+
+ prepend Patch
+ end
+
+ def sentry_monitor_slug
+ @sentry_monitor_slug
+ end
+
+ def sentry_monitor_config
+ @sentry_monitor_config
+ end
+ end
+
+ extend ClassMethods
+
+ def self.included(base)
+ base.extend(ClassMethods)
+ end
+ end
+ end
+end
lib/sentry/cron/monitor_config.rb
--- /tmp/20231011-1838-2urmpa 2023-10-11 02:12:21.153331056 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/cron/monitor_config.rb 2023-10-11 02:12:21.141330479 +0000
@@ -0,0 +1,53 @@
+# frozen_string_literal
+
+require 'sentry/cron/monitor_schedule'
+
+module Sentry
+ module Cron
+ class MonitorConfig
+ # The monitor schedule configuration
+ # @return [MonitorSchedule::Crontab, MonitorSchedule::Interval]
+ attr_accessor :schedule
+
+ # How long (in minutes) after the expected checkin time will we wait
+ # until we consider the checkin to have been missed.
+ # @return [Integer, nil]
+ attr_accessor :checkin_margin
+
+ # How long (in minutes) is the checkin allowed to run for in in_progress
+ # before it is considered failed.
+ # @return [Integer, nil]
+ attr_accessor :max_runtime
+
+ # tz database style timezone string
+ # @return [String, nil]
+ attr_accessor :timezone
+
+ def initialize(schedule, checkin_margin: nil, max_runtime: nil, timezone: nil)
+ @schedule = schedule
+ @checkin_margin = checkin_margin
+ @max_runtime = max_runtime
+ @timezone = timezone
+ end
+
+ def self.from_crontab(crontab, **options)
+ new(MonitorSchedule::Crontab.new(crontab), **options)
+ end
+
+ def self.from_interval(num, unit, **options)
+ return nil unless MonitorSchedule::Interval::VALID_UNITS.include?(unit)
+
+ new(MonitorSchedule::Interval.new(num, unit), **options)
+ end
+
+ def to_hash
+ {
+ schedule: schedule.to_hash,
+ checkin_margin: checkin_margin,
+ max_runtime: max_runtime,
+ timezone: timezone
+ }.compact
+ end
+ end
+ end
+end
lib/sentry/cron/monitor_schedule.rb
--- /tmp/20231011-1838-ar7xot 2023-10-11 02:12:21.153331056 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/cron/monitor_schedule.rb 2023-10-11 02:12:21.141330479 +0000
@@ -0,0 +1,42 @@
+# frozen_string_literal
+
+module Sentry
+ module Cron
+ module MonitorSchedule
+ class Crontab
+ # A crontab formatted string such as "0 * * * *".
+ # @return [String]
+ attr_accessor :value
+
+ def initialize(value)
+ @value = value
+ end
+
+ def to_hash
+ { type: :crontab, value: value }
+ end
+ end
+
+ class Interval
+ # The number representing duration of the interval.
+ # @return [Integer]
+ attr_accessor :value
+
+ # The unit representing duration of the interval.
+ # @return [Symbol]
+ attr_accessor :unit
+
+ VALID_UNITS = %i(year month week day hour minute)
+
+ def initialize(value, unit)
+ @value = value
+ @unit = unit
+ end
+
+ def to_hash
+ { type: :interval, value: value, unit: unit }
+ end
+ end
+ end
+ end
+end
* Changed:
Gemfile
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/Gemfile 2023-10-11 02:12:21.129329901 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/Gemfile 2023-10-11 02:12:21.137330286 +0000
@@ -24 +24,3 @@
-if RUBY_VERSION.to_f >= 2.6
+ruby_version = Gem::Version.new(RUBY_VERSION)
+
+if ruby_version >= Gem::Version.new("2.6.0")
@@ -26,0 +29,4 @@
+
+ if ruby_version >= Gem::Version.new("3.0.0")
+ gem "ruby-lsp-rspec"
+ end
README.md
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/README.md 2023-10-11 02:12:21.129329901 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/README.md 2023-10-11 02:12:21.137330286 +0000
@@ -16,8 +16,8 @@
-| current version | build | coverage | downloads |
-| --- | ----- | -------- | --------- |
-| [![Gem Version](https://img.shields.io/gem/v/sentry-ruby?label=sentry-ruby)](https://rubygems.org/gems/sentry-ruby) | [![Build Status](https://github.com/getsentry/sentry-ruby/workflows/sentry-ruby%20Test/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_ruby_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-ruby.svg)](https://rubygems.org/gems/sentry-ruby/) |
-| [![Gem Version](https://img.shields.io/gem/v/sentry-rails?label=sentry-rails)](https://rubygems.org/gems/sentry-rails) | [![Build Status](https://github.com/getsentry/sentry-ruby/workflows/sentry-rails%20Test/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_rails_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-rails.svg)](https://rubygems.org/gems/sentry-rails/) |
-| [![Gem Version](https://img.shields.io/gem/v/sentry-sidekiq?label=sentry-sidekiq)](https://rubygems.org/gems/sentry-sidekiq) | [![Build Status](https://github.com/getsentry/sentry-ruby/workflows/sentry-sidekiq%20Test/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_sidekiq_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-sidekiq.svg)](https://rubygems.org/gems/sentry-sidekiq/) |
-| [![Gem Version](https://img.shields.io/gem/v/sentry-delayed_job?label=sentry-delayed_job)](https://rubygems.org/gems/sentry-delayed_job) | [![Build Status](https://github.com/getsentry/sentry-ruby/workflows/sentry-delayed_job%20Test/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_delayed_job_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-delayed_job.svg)](https://rubygems.org/gems/sentry-delayed_job/) |
-| [![Gem Version](https://img.shields.io/gem/v/sentry-resque?label=sentry-resque)](https://rubygems.org/gems/sentry-resque) | [![Build Status](https://github.com/getsentry/sentry-ruby/workflows/sentry-resque%20Test/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_resque_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-resque.svg)](https://rubygems.org/gems/sentry-resque/) |
-| [![Gem Version](https://img.shields.io/gem/v/sentry-opentelemetry?label=sentry-opentelemetry)](https://rubygems.org/gems/sentry-opentelemetry) | [![Build Status](https://github.com/getsentry/sentry-ruby/workflows/sentry-opentelemetry%20Test/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_opentelemetry_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-opentelemetry.svg)](https://rubygems.org/gems/sentry-opentelemetry/) |
+| current version | build | coverage | downloads |
+| --- | ----- | -------- | --------- |
+| [![Gem Version](https://img.shields.io/gem/v/sentry-ruby?label=sentry-ruby)](https://rubygems.org/gems/sentry-ruby) | [![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_ruby_test.yml/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_ruby_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-ruby.svg)](https://rubygems.org/gems/sentry-ruby/) |
+| [![Gem Version](https://img.shields.io/gem/v/sentry-rails?label=sentry-rails)](https://rubygems.org/gems/sentry-rails) | [![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_rails_test.yml/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_rails_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-rails.svg)](https://rubygems.org/gems/sentry-rails/) |
+| [![Gem Version](https://img.shields.io/gem/v/sentry-sidekiq?label=sentry-sidekiq)](https://rubygems.org/gems/sentry-sidekiq) | [![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_sidekiq_test.yml/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_sidekiq_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-sidekiq.svg)](https://rubygems.org/gems/sentry-sidekiq/) |
+| [![Gem Version](https://img.shields.io/gem/v/sentry-delayed_job?label=sentry-delayed_job)](https://rubygems.org/gems/sentry-delayed_job) | [![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_delayed_job_test.yml/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_delayed_job_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-delayed_job.svg)](https://rubygems.org/gems/sentry-delayed_job/) |
+| [![Gem Version](https://img.shields.io/gem/v/sentry-resque?label=sentry-resque)](https://rubygems.org/gems/sentry-resque) | [![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_resque_test.yml/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_resque_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-resque.svg)](https://rubygems.org/gems/sentry-resque/) |
+| [![Gem Version](https://img.shields.io/gem/v/sentry-opentelemetry?label=sentry-opentelemetry)](https://rubygems.org/gems/sentry-opentelemetry) | [![Build Status](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_opentelemetry_test.yml/badge.svg)](https://github.com/getsentry/sentry-ruby/actions/workflows/sentry_opentelemetry_test.yml) | [![Coverage Status](https://img.shields.io/codecov/c/github/getsentry/sentry-ruby/master?logo=codecov)](https://codecov.io/gh/getsentry/sentry-ruby/branch/master) | [![Downloads](https://img.shields.io/gem/dt/sentry-opentelemetry.svg)](https://rubygems.org/gems/sentry-opentelemetry/) |
lib/sentry-ruby.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry-ruby.rb 2023-10-11 02:12:21.129329901 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry-ruby.rb 2023-10-11 02:12:21.141330479 +0000
@@ -17,0 +18 @@
+require "sentry/check_in_event"
@@ -22,0 +24 @@
+require "sentry/cron/monitor_check_ins"
@@ -430,0 +433,18 @@
+ end
+
+ # Captures a check-in and sends it to Sentry via the currently active hub.
+ #
+ # @param slug [String] identifier of this monitor
+ # @param status [Symbol] status of this check-in, one of {CheckInEvent::VALID_STATUSES}
+ #
+ # @param [Hash] options extra check-in options
+ # @option options [String] check_in_id for updating the status of an existing monitor
+ # @option options [Integer] duration seconds elapsed since this monitor started
+ # @option options [Cron::MonitorConfig] monitor_config configuration for this monitor
+ #
+ # @yieldparam scope [Scope]
+ #
+ # @return [String, nil] The {CheckInEvent#check_in_id} to use for later updates on the same slug
+ def capture_check_in(slug, status, **options, &block)
+ return unless initialized?
+ get_current_hub.capture_check_in(slug, status, **options, &block)
lib/sentry/client.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/client.rb 2023-10-11 02:12:21.133330094 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/client.rb 2023-10-11 02:12:21.141330479 +0000
@@ -106,0 +107,31 @@
+ # Initializes a CheckInEvent object with the given options.
+ #
+ # @param slug [String] identifier of this monitor
+ # @param status [Symbol] status of this check-in, one of {CheckInEvent::VALID_STATUSES}
+ # @param hint [Hash] the hint data that'll be passed to `before_send` callback and the scope's event processors.
+ # @param duration [Integer, nil] seconds elapsed since this monitor started
+ # @param monitor_config [Cron::MonitorConfig, nil] configuration for this monitor
+ # @param check_in_id [String, nil] for updating the status of an existing monitor
+ #
+ # @return [Event]
+ def event_from_check_in(
+ slug,
+ status,
+ hint = {},
+ duration: nil,
+ monitor_config: nil,
+ check_in_id: nil
+ )
+ return unless configuration.sending_allowed?
+
+ CheckInEvent.new(
+ configuration: configuration,
+ integration_meta: Sentry.integrations[hint[:integration]],
+ slug: slug,
+ status: status,
+ duration: duration,
+ monitor_config: monitor_config,
+ check_in_id: check_in_id
+ )
+ end
+
lib/sentry/envelope.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/envelope.rb 2023-10-11 02:12:21.133330094 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/envelope.rb 2023-10-11 02:12:21.141330479 +0000
@@ -8 +8 @@
- MAX_SERIALIZED_PAYLOAD_SIZE = 1024 * 200
+ MAX_SERIALIZED_PAYLOAD_SIZE = 1024 * 1000
lib/sentry/hub.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/hub.rb 2023-10-11 02:12:21.133330094 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/hub.rb 2023-10-11 02:12:21.141330479 +0000
@@ -158,0 +159,24 @@
+ def capture_check_in(slug, status, **options, &block)
+ check_argument_type!(slug, ::String)
+ check_argument_includes!(status, Sentry::CheckInEvent::VALID_STATUSES)
+
+ return unless current_client
+
+ options[:hint] ||= {}
+ options[:hint][:slug] = slug
+
+ event = current_client.event_from_check_in(
+ slug,
+ status,
+ options[:hint],
+ duration: options.delete(:duration),
+ monitor_config: options.delete(:monitor_config),
+ check_in_id: options.delete(:check_in_id)
+ )
+
+ return unless event
+
+ capture_event(event, **options, &block)
+ event.check_in_id
+ end
+
@@ -181 +205 @@
- @last_event_id = event&.event_id unless event.is_a?(Sentry::TransactionEvent)
+ @last_event_id = event&.event_id if event.is_a?(Sentry::ErrorEvent)
lib/sentry/integrable.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/integrable.rb 2023-10-11 02:12:21.133330094 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/integrable.rb 2023-10-11 02:12:21.141330479 +0000
@@ -24,0 +25,6 @@
+
+ def capture_check_in(slug, status, **options, &block)
+ options[:hint] ||= {}
+ options[:hint][:integration] = integration_name
+ Sentry.capture_check_in(slug, status, **options, &block)
+ end
lib/sentry/interfaces/single_exception.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/interfaces/single_exception.rb 2023-10-11 02:12:21.133330094 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/interfaces/single_exception.rb 2023-10-11 02:12:21.141330479 +0000
@@ -26 +26 @@
- @value = exception_message.byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES)
+ @value = Utils::EncodingHelper.encode_to_utf_8(exception_message.byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES))
@@ -54 +54 @@
- v
+ Utils::EncodingHelper.encode_to_utf_8(v)
lib/sentry/profiler.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/profiler.rb 2023-10-11 02:12:21.133330094 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/profiler.rb 2023-10-11 02:12:21.145330671 +0000
@@ -11,0 +12 @@
+ MIN_SAMPLES_REQUIRED = 2
@@ -76 +77,5 @@
- return {} unless @sampled
+ unless @sampled
+ record_lost_event(:sample_rate)
+ return {}
+ end
+
@@ -80,4 +85,5 @@
- return {} unless results
- return {} if results.empty?
- return {} if results[:samples] == 0
- return {} unless results[:raw]
+
+ if !results || results.empty? || results[:samples] == 0 || !results[:raw]
+ record_lost_event(:insufficient_data)
+ return {}
+ end
@@ -160 +166 @@
- if samples.size <= 2
+ if samples.size <= MIN_SAMPLES_REQUIRED
@@ -161,0 +168 @@
+ record_lost_event(:insufficient_data)
@@ -219,0 +227,4 @@
+ end
+
+ def record_lost_event(reason)
+ Sentry.get_current_client&.transport&.record_lost_event(reason, 'profile')
lib/sentry/span.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/span.rb 2023-10-11 02:12:21.137330286 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/span.rb 2023-10-11 02:12:21.145330671 +0000
@@ -14 +14 @@
- HTTP_METHOD = "http.method"
+ HTTP_METHOD = "http.request.method"
lib/sentry/test_helper.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/test_helper.rb 2023-10-11 02:12:21.137330286 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/test_helper.rb 2023-10-11 02:12:21.145330671 +0000
@@ -17 +17 @@
- copied_config = Sentry.configuration.dup
+ dummy_config = Sentry.configuration.dup
@@ -19 +19 @@
- copied_config.dsn = DUMMY_DSN
+ dummy_config.dsn = DUMMY_DSN
@@ -21 +21 @@
- copied_config.transport.transport_class = Sentry::DummyTransport
+ dummy_config.transport.transport_class = Sentry::DummyTransport
@@ -23 +23 @@
- copied_config.enabled_environments << copied_config.environment unless copied_config.enabled_environments.include?(copied_config.environment)
+ dummy_config.enabled_environments << dummy_config.environment unless dummy_config.enabled_environments.include?(dummy_config.environment)
@@ -25 +25 @@
- copied_config.background_worker_threads = 0
+ dummy_config.background_worker_threads = 0
@@ -30 +30 @@
- block&.call(copied_config)
+ block&.call(dummy_config)
@@ -32 +32,6 @@
- test_client = Sentry::Client.new(copied_config)
+ # the base layer's client should already use the dummy config so nothing will be sent by accident
+ base_client = Sentry::Client.new(dummy_config)
+ Sentry.get_current_hub.bind_client(base_client)
+ # create a new layer so mutations made to the testing scope or configuration could be simply popped later
+ Sentry.get_current_hub.push_scope
+ test_client = Sentry::Client.new(dummy_config.dup)
@@ -34 +38,0 @@
- Sentry.get_current_scope.clear
@@ -43,3 +47,6 @@
- sentry_transport.events = []
- sentry_transport.envelopes = []
- Sentry.get_current_scope.clear
+ # pop testing layer created by `setup_sentry_test`
+ # but keep the base layer to avoid nil-pointer errors
+ # TODO: find a way to notify users if they somehow popped the test layer before calling this method
+ if Sentry.get_current_hub.instance_variable_get(:@stack).size > 1
+ Sentry.get_current_hub.pop_scope
+ end
@@ -78 +84,0 @@
-
lib/sentry/transport.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/transport.rb 2023-10-11 02:12:21.137330286 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/transport.rb 2023-10-11 02:12:21.145330671 +0000
@@ -21 +21,2 @@
- :event_processor
+ :event_processor,
+ :insufficient_data
@@ -146 +147 @@
- if event.is_a?(TransactionEvent) && event.dynamic_sampling_context
+ if event.is_a?(Event) && event.dynamic_sampling_context
@@ -188 +189 @@
- category = type == 'transaction' ? 'transaction' : 'error'
+ category = type == 'event' ? 'error' : type
lib/sentry/utils/argument_checking_helper.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/utils/argument_checking_helper.rb 2023-10-11 02:12:21.137330286 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/utils/argument_checking_helper.rb 2023-10-11 02:12:21.145330671 +0000
@@ -11,0 +12,6 @@
+
+ def check_argument_includes!(argument, values)
+ unless values.include?(argument)
+ raise ArgumentError, "expect the argument to be one of #{values.map(&:inspect).join(' or ')}, got #{argument.inspect}"
+ end
+ end
lib/sentry/version.rb
--- /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.11.0/lib/sentry/version.rb 2023-10-11 02:12:21.137330286 +0000
+++ /tmp/d20231011-1838-vhrdqu/sentry-ruby-5.12.0/lib/sentry/version.rb 2023-10-11 02:12:21.145330671 +0000
@@ -4 +4 @@
- VERSION = "5.11.0"
+ VERSION = "5.12.0" |
Bumps [sentry-ruby](https://github.com/getsentry/sentry-ruby) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/getsentry/sentry-ruby/releases) - [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-ruby@5.11.0...5.12.0) --- updated-dependencies: - dependency-name: sentry-ruby dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
dependabot
bot
force-pushed
the
dependabot/bundler/sentry-ruby-5.12.0
branch
from
October 25, 2023 06:00
8b9850a
to
94f47bf
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps sentry-ruby from 5.11.0 to 5.12.0.
Changelog
Sourced from sentry-ruby's changelog.
... (truncated)
Commits
e09786c
release: 5.12.001c6a3b
changelog for 5.12.0 (#2133)71ec4f4
Add option to notify Sentry only after the last retry on resque (#2087)65ef04c
AddSentry::Cron::MonitorCheckIns
module for automatic monitoring of jobs (...3d0ed07
Update setup for Rails 7.1 (#2125)286135c
Add new Sentry.capture_check_in API for Cron monitoring (#2117)096e6c3
Fix CI badges (#2129)ba29bb8
Try codecov components and use official action for uploads (#2128)58ff7f0
Add SimpleCov.command_name for isolated_specs (#2127)58253af
update craft config for release registry (#2121)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)