Releases: getsentry/sentry-ruby
5.8.0
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: truetag for SQL query spans that utilized the ActiveRecord QueryCache when using ActiveRecordSubscriber insentry-rails#1968 -
Add
Sentry.add_global_event_processorAPI #1976Users 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
SpanProcessorto link errors with transactions #1983 -
Fix some inconsistencies in setting name/op/status in OpenTelemetry
SpanProcessor#1987 -
Add
config.before_send_transactionhook #1989Users can now configure a
before_send_transactioncallback that runs similar tobefore_sendbut 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#1838Usage:
transaction = Sentry.get_current_scope.get_transaction transaction.set_measurement("metrics.foo", 0.5, "millisecond")
Bug Fixes
- Support redis-rb 5.0+ #1963
- Fixes #1932
- Skip private _config context in Sidekiq 7+ #1967
- Fixes #1956
- Return value from
perform_actionin ActionCable::Channel instances when initialized #1966 Span#with_child_spanshould finish the span even with exception raised #1982- Fix sentry-rails' controller span nesting #1973
- Fixes #1899
- Do not report exceptions when a Rails runner exits with
exit 0#1988 - Ignore redis key if not UTF8 #1997
- Fixes #1992
Miscellaneous
- Deprecate
capture_exception_frame_localsin favor ofinclude_local_variables#1993
5.7.0
Features
- Expose
span_idinSpanconstructor #1945 - Expose
end_timestampinSpan#finishandTransaction#finish#1946 - Add
Transaction#set_contextapi #1947 - Add OpenTelemetry support with new
sentry-opentelemetrygem-
Add
config.instrumenterto switch between:sentryand:otelinstrumentation #1944The new
sentry-opentelemetrygem adds support to automatically integrate OpenTelemetry performance tracing with Sentry. Give it a try and let us know if you have any feedback or problems with using it.
-
5.6.0
Features
-
Allow users to configure their asset-skipping pattern #1915
Users can now configure their own pattern to skip asset requests' transactions
Sentry.init do |config| config.rails.assets_regexp = /my_regexp/ end
-
Use
Sentry.with_child_spanin redis and net/http instead ofspan.start_child#1920- This might change the nesting of some spans and make it more accurate
- Followup fix to set the sentry-trace header in the correct place #1922
-
Use
Exception#detailed_messagewhen generating exception message if applicable #1924 -
Make
sentry-sidekiqcompatible with Sidekiq 7 #1930
Bug Fixes
-
Sentry::BackgroundWorkerwill releaseActiveRecordconnection pool only when theActiveRecordconnection is established -
Remove bad encoding arguments in redis span descriptions #1914
- Fixes #1911
-
Add missing
initialized?checks tosentry-rails#1919- Fixes #1885
-
Update Tracing Span's op names #1923
Currently, Ruby integrations' Span op names aren't aligned with the core specification's convention, so we decided to update them altogether in this PR.
If you rely on Span op names for fine-grained event filtering, this may affect the data your app sends to Sentry.
Also make sure to update yourtraces_samplerif you rely on theopfor filtering some requests.
Refactoring
- Make transaction a required argument of Span #1921
5.5.0
Features
-
Support rack 3 #1884
- We no longer need the
HTTP_VERSIONcheck for ignoring the header
- We no longer need the
-
Add Dynamic Sampling support
The SDK now supports Sentry's Dynamic Sampling product.Note that this is not supported for users still using the
config.asyncoption.- Parse incoming W3C Baggage Headers and propagate them to continue traces #1869
- in all outgoing requests in our net/http patch
- in Sentry transactions as Dynamic Sampling Context
- Create new Baggage entries as Head SDK (originator of trace) #1898
- Add Transaction source annotations to classify low quality (high cardinality) transaction names #1902
- Parse incoming W3C Baggage Headers and propagate them to continue traces #1869
Bug Fixes
5.4.2
5.4.1
5.4.0
Features
-
Expose
:valuesinExceptionInterface, so that it can be accessed inbefore_sendunderevent.exception.values#1843 -
Add top level
Sentry.closeAPI #1844- Cleans up SDK state and sets it to uninitialized
- No-ops all SDK APIs and also disables the transport layer, so nothing will be sent to Sentry after closing the SDK
-
Handle exception with large stacktrace without dropping entire item #1807
-
Capture Rails runner's exceptions before exiting #1820
-
Add
Sentry.with_exception_capturedhelper #1814Usage:
Sentry.with_exception_captured do 1/1 #=> 1 will be returned end Sentry.with_exception_captured do 1/0 #=> ZeroDivisionError will be reported and re-raised end
-
Prepare for Rails 7.1's error reporter API change #1834
-
Set
sentry.error_event_idin request env if the middleware captures errors #1849If the SDK's Rack middleware captures an error, the reported event's id will be stored in the request env. For example:
env["sentry.error_event_id"] #=> "507bd4c1a07e4355bb70bcd7afe8ab17"
Users can display this information on the error page via a middleware as proposed in #1846
Bug Fixes
- Respect
report_rescued_exceptionsconfig #1847- Fixes #1840
- Rescue event's to JSON conversion error #1853
- Rescue
ThreadErrorinSessionFlusherand stop creating threads if flusher is killed #1851- Fixes #1848
Refactoring
- Move envelope item processing/trimming logic to the Item class #1824
- Replace sentry-ruby-core with sentry-ruby as integration dependency #1825
Test Helpers
The SDK now provides a set of test helpers to help users setup and teardown Sentry related tests.
To get started:
require "sentry/test_helper"
# in minitest
class MyTest < Minitest::Test
include Sentry::TestHelper
# ...
end
# in RSpec
RSpec.configure do |config|
config.include Sentry::TestHelper
# ...
endIt's still an early attempt so please give us feedback in #1680.
5.3.1
5.3.0
Features
- Add
Sentry.with_child_spanfor easier span recording #1783
operation_result = Sentry.with_child_span(op: "my op") do |child_span|
my_operation
end
# the "my op" span will be attached to the result of Sentry.get_current_scope.get_span
# which could be either the top-level transaction, or a span set by the user or other integrationsBug Fixes
- Set
last_event_idonly for error events #1767- Fixes #1766
- Add
config.rails.register_error_subscriberto control error reporter integration #1771 - Check if ActiveRecord connection exists before calling AR connection pool #1769
- Fixes #1745
- Fix
sentry-rails's tracing spans not nesting issue - #1784- Fixes #1723
- Update
config.transport.proxyto allow String and URI values as previously supported bysentry-rubyversions <= 4.8 using Faraday- Fixes #1782
- Register SentryContextClientMiddleware on sidekiq workers #1774
- Add request env to sampling context when using
sentry-rails#1792- Fixes #1791
- Fix net-http tracing's span nesting issue #1796
Refactoring
- Correct inaccurate event model relationships #1777
Miscellaneous
- Log message when shutting down/killing SDK managed components #1779