Releases: getsentry/sentry-ruby
5.16.0
Features
-
Add backpressure handling for transactions #2185
The SDK can now dynamically downsample transactions to reduce backpressure in high
throughput systems. It starts a newBackpressureMonitorthread 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
closefor Client Reports and Sessions #2206 -
Support cron with timezone for
sidekiq-schedulerpatch #2209- Fixes #2187
-
Add
Cron::Configurationobject that holds defaults for allMonitorConfigobjects #2211Sentry.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
5.15.1
5.15.0
5.14.0
Features
- Improve default slug generation for Crons #2168
- Change release name generator to use full SHA commit hash and align with
sentry-cliand other Sentry SDKs #2174 - Automatic Crons support for scheduling gems
-
Add support for
sidekiq-cron#2170You can opt in to the
sidekiq-cronpatch and we will automatically monitor check-ins for all jobs listed in yourconfig/schedule.ymlfile.config.enabled_patches += [:sidekiq_cron]
-
Add support for
sidekiq-scheduler#2172You can opt in to the
sidekiq-schedulerpatch and we will automatically monitor check-ins for all repeating jobs (i.e.cron,every, andinterval) specified in the config.config.enabled_patches += [:sidekiq_scheduler]
-
Bug Fixes
- Fixed a deprecation in
sidekiq-rubyerror handler #2160 - Avoid invoking ActiveSupport::BroadcastLogger if not defined #2169
- Respect custom
Delayed::Job.max_attemptsif it's defined #2176 - Fixed a bug where
Net::HTTPinstrumentation won't work for some IPv6 addresses #2180 - Allow non-string error message to be reported to sentry (#2137)
5.13.0
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_itemsto allow customization breadcrumb data of active support logger #2139config.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
5.12.0
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_inAPI for Cron Monitoring #2117You 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::MonitorCheckInsmodule for automatic monitoring of jobs #2130Standard job frameworks such as
ActiveJobandSidekiqcan 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_insas 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.methodtohttp.request.methodinSpan::DataConventions#2106 - Increase
Envelope::Item::MAX_SERIALIZED_PAYLOAD_SIZEto 1MB #2108 - Fix
db_configbeginnilinActiveRecordSubscriber#2111- Fixes #2109
- Always send envelope trace header from dynamic sampling context #2113
- Improve
TestHelper's setup/teardown helpers (#2116)- Fixes #2103
- 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
- Fixes #2082
5.11.0
Features
-
Make
:valueinSingleExceptionInterfacewritable, so that it can be modified inbefore_sendunderevent.exception.values[n].value#2072 -
Add
sampledfield todynamic_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_targetsoption 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
PropagationContextonScopeand addSentry.get_trace_propagation_headersAPI #2084 - Implement
Sentry.continue_traceAPI #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, useSentry.continue_traceas 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_headersto get a hash of headers to add to your request. - Implement
Bug Fixes
- Duplicate
Rails.loggerbefore assigning it to the SDK (#2086)
5.10.0
5.9.0
Features
-
Add new boolean option
config.enable_tracingto simplify enabling performance tracing #2005config.enable_tracing = truewill settraces_sample_rateto1.0if not set alreadyconfig.enable_tracing = falsewill turn off tracing even iftraces_sample_rate/traces_sampleris setconfig.enable_tracing = nil(default) will keep the current behaviour
-
Allow ignoring
excluded_exceptionswhen manually capturing exceptions #2007Users can now ignore the SDK's
excluded_exceptionsby passingignore_exclusionshint when usingSentry.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
spectoBacktrace::APP_DIRS_PATTERN#2029 -
Forward all
baggageheader items that are prefixed withsentry-#2025 -
Add
stackprofbased profiler #2024The SDK now supports sending profiles taken by the
stackprofgem and viewing them in the Profiling section.To use it, first add
stackprofto yourGemfileand make sure it is loaded beforesentry-ruby.# Gemfile gem 'stackprof' gem 'sentry-ruby'
Then, make sure both
traces_sample_rateandprofiles_sample_rateare 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
pumamight not capture frames correctly when async I/O is happening. This is astackproflimitation.
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 [email protected], reach out via Discord (#profiling), or open an issue.