Releases: getsentry/sentry-ruby
6.0.0
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::Metricsandconfig.metricsand all metrics related code (#2729) - Remove deprecated
config.capture_exception_frame_locals, useinclude_local_variablesinstead (#2730) - Remove deprecated
config.enable_tracing, useconfig.traces_sample_rate = 1.0instead (#2731) - Remove deprecated
config.logger=, useconfig.sdk_logger=instead (#2732) Sentry.loggernow always points to theStructuredLogger(#2752)- Remove deprecated
Sentry::Rails::Tracing::ActionControllerSubscriber(#2733) - Remove deprecated
Event#configuration(#2740) - Remove deprecated
Sentry::Client#generate_sentry_traceandSentry::Client#generate_baggage(#2741) - Remove
Transactiondeprecations (#2736)- Remove deprecated constant
Sentry::Transaction::SENTRY_TRACE_REGEXP, useSentry::PropagationContext::SENTRY_TRACE_REGEXPinstead - Remove deprecated method
Sentry::Transaction.from_sentry_trace, useSentry.continue_traceinstead - Remove deprecated method
Sentry::Transaction.extract_sentry_trace, useSentry::PropagationContext.extract_sentry_traceinstead - Remove deprecated attribute
Sentry::Transaction.configuration - Remove deprecated attribute
Sentry::Transaction.hub - Remove deprecated argument
hubtoSentry::Transaction.finish - Remove deprecated argument
hubtoSentry::Transaction#initialize(#2739)
- Remove deprecated constant
- Remove
:monotonic_active_support_loggerfromconfig.breadcrumbs_logger(#2717) - Migrate from to_hash to to_h (#2351)
- Add
before_send_check_infor applying toCheckInEvent(#2703) - Returning a hash from
before_sendandbefore_send_transactionis no longer supported and will drop the event. config.enabled_environmentsnow defaults tonilinstead 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. Seeconfig.trace_ignore_status_codesbelow 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_codesto 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_intervalto control sampling frequency (#2745)- Both
stackprofandverniernow get sampled at a default frequency of 101 Hz.
- Both
-
Request body reading checks for
:rewindto match Rack 3 behavior. (#2754)
Internal
- Archive
sentry-raven(#2708) - Don't send
sample_rateclient reports for profiles if profiling is disabled (#2728)
5.28.1
5.28.0
Features
- Auto-enable Rails structured logging when
enable_logsis 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
5.27.1
5.27.0
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_parametersconfiguration.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_loggingconfig namespace (#2692)
Bug Fixes
- Silence
_performmethod redefinition warning (#2682) - Update sentry trace regexp (#2678)
- Remove redundant
attr_reader(#2673)
Internal
- Factor out do_request in HTTP transport (#2662)
- Add
Sentry::DebugTransportthat captures events and stores them as JSON for debugging purposes (#2664) - Add
Sentry::DebugStructuredLoggerthat 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
5.26.0
Feature
-
Support for
:loggerpatch which enables sending logs to Sentry whenenabled_logsis 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
LogEventBufferif logging is not enabled (#2652)
5.25.0
5.24.0
Features
-
Add new sidekiq config
report_only_dead_jobs(#2581) -
Add
max_nestingof 10 to breadcrumbs data serialization (#2583) -
Add sidekiq config
propagate_tracesto control trace header injection (#2588)If you use schedulers you can get one large trace with all your jobs which is undesirable.
We recommend using the following to propagate traces only from the Rails server and not elsewhere.config.sidekiq.propagate_traces = false unless Rails.const_defined?('Server')
-
Only expose
active_storagekeys on span data ifsend_default_piiis on (#2589) -
Add new
Sentry.loggerfor Structured Logging feature (#2620).To enable structured logging you need to turn on the
enable_logsconfiguration option:Sentry.init do |config| # ... your setup ... config.enable_logs = true end
Once you configured structured logging, you get access to a new
Sentry.loggerobject that can be
used as a regular logger with additional structured data support:Sentry.logger.info("User logged in", user_id: 123) Sentry.logger.error("Failed to process payment", transaction_id: "tx_123", error_code: "PAYMENT_FAILED" )
You can also use message templates with positional or hash parameters:
Sentry.logger.info("User %{name} logged in", name: "Jane Doe") Sentry.logger.info("User %s logged in", ["Jane Doe"])
Any other arbitrary attributes will be sent as part of the log event payload:
# Here `user_id` and `action` will be sent as extra attributes that Sentry Logs UI displays Sentry.logger.info("User %{user} logged in", user: "Jane", user_id: 123, action: "create")
⚠️ Whenenable_logsistrue, previousSentry.loggershould no longer be used for internal SDK
logging - it was replaced bySentry.configuration.sdk_loggerand should be used only by the SDK
itself and its extensions. -
New configuration option called
active_job_report_on_retry_errorwhich enables reporting errors on each retry error (#2617)
Bug Fixes
- Gracefully fail on malformed utf-8 breadcrumb message (#2582)
- Fixes #2376
- Fix breadcrumb serialization error message to be an object (#2584)
- Fixes #2478
- Fix compatibility issues with sidekiq-cron 2.2.0 (#2591)
- Update sentry-sidekiq to work correctly with Sidekiq 8.0 and its new timestamp format (#2570)
- Ensure we capture exceptions after each job retry (#2597)
Internal
- Remove
user_segmentfrom DSC (#2586) - Replace
loggerwithsdk_logger(#2621) Sentry.loggeris now deprecated whenenable_logsis turned off. It's original behavior was ported toSentry.configuration.sdk_logger. Please notice that this logger is internal and should only be used for SDK-specific logging needs. (#2621)
5.23.0
Features
- Add correct breadcrumb levels for 4xx/5xx response codes (#2549)
Bug Fixes
- Fix argument serialization for ranges that consist of ActiveSupport::TimeWithZone (#2548)
- Prevent starting Vernier in nested transactions (#2528)
- Fix TypeError when Resque.inline == true (#2564)
Internal
- Use
File.openinLineCache(#2566) - Update java backtrace regexp (#2567)
- Stop byteslicing empty strings in breadcrumbs (#2574)
Miscellaneous
- Deprecate
enable_tracingin favor oftraces_sample_rate = 1.0#2535
5.22.4
Bug Fixes
- Fix handling of cron with tz in Cron::Job (#2530)
- Revert "[rails] support string errors in error reporter (#2464)" (#2533)
- Removed unnecessary warning about missing
stackprofwhen Vernier is configured as the profiler (#2537) - Fix regression with CheckInEvent in before_send (#2541)
- Fixes #2540