Changelog

Improving AppSignal, one deploy at a time.

Sep 13, 2024

Fix ThreadError when Puma shuts down in clustered mode

Ruby4.0.8

Fixed

  • Fix a ThreadError from being raised on process exit when Appsignal.stop is called from a Signal.trap block, like when Puma shuts down in clustered mode.

View the Ruby gem v4.0.8 changelog for more information.

Sep 12, 2024

Smaller package and formatted Date and Time objects

Ruby4.0.7

Changed

  • Format the Date and Time objects in a human-friendly way. Previously, dates and times stored in sample data, like session data, would be shown as #<Date> and #<Time>. Now they will show as #<Date: 2024-09-11> and #<Time: 2024-09-12T13:14:15+02:00> (UTC offset may be different for your time objects depending on the server setting).

Removed

  • Do not include support files in the published versions. This reduces the gem package size.

View the Ruby gem v4.0.7 changelog for more information.

Sep 03, 2024

Support Que 2 keyword arguments

Ruby4.0.6

Added

  • Add support for Que 2 keyword arguments. Que job arguments will now be reported as the arguments key for positional arguments and keyword_arguments for Ruby keyword arguments.

View the Ruby gem v4.0.6 changelog for more information.

Sep 02, 2024

Report more Puma errors

Ruby4.0.5

Added

  • Report Puma low-level errors using the lowlevel_error reporter. This will report errors previously not caught by our instrumentation middleware.

Changed

  • Log a warning when loader defaults are added after AppSignal has already been configured.

    ruby
    # Bad Appsignal.configure # or Appsignal.start Appsignal.load(:sinatra) # Good Appsignal.load(:sinatra) Appsignal.configure # or Appsignal.start
  • Rename the path and method transaction metadata to request_path and request_method to make it more clear what context this metadata is from. The path and method metadata will continue to be reported until the next major/minor version.

  • Internal change to how OpenTelemetry metrics are sent.

Removed

  • Drop support for Puma version 2 and lower.

Fixed

  • Fix the error log message about our at_exit hook reporting no error on process exit when the process exits without an error.

View the Ruby gem v4.0.5 changelog for more information.

Aug 29, 2024

Ignore SignalException and Rack instrumentation fixes

Ruby4.0.4

Changed

  • Send check-ins concurrently. When calling Appsignal::CheckIn.cron, instead of blocking the current thread while the check-in events are sent, schedule them to be sent in a separate thread.

    When shutting down your application manually, call Appsignal.stop to block until all scheduled check-ins have been sent.

Fixed

  • Make our Rack BodyWrapper behave like a Rack BodyProxy. If a method doesn't exist on our BodyWrapper class, but it does exist on the body, behave like the Rack BodyProxy and call the method on the wrapped body.
  • Do not report SignalException errors from our at_exit error reporter.

View the Ruby gem v4.0.4 changelog for more information.

Aug 26, 2024

Ignore more internal Sidekiq errors

Ruby4.0.3

Changed

  • Do not report Sidekiq Sidekiq::JobRetry::Handled and Sidekiq::JobRetry::Skip errors. These errors would be reported by our Rails error subscriber. These are an internal Sidekiq errors we do not need to report.

Removed

  • Remove the app_path writer in the Appsignal.configure helper. This was deprecated in version 3.x. It is removed now in the next major version.

    Use the root_path keyword argument in the Appsignal.configure helper (Appsignal.configure(:root_path => "...")) to change the AppSignal root path if necessary.

View the Ruby gem v4.0.3 changelog for more information.

Aug 23, 2024

Don't report broken pipe errors from webservers

Ruby3.13.1

Changed

  • Ignore Errno::EPIPE errors when instrumenting response bodies. We've noticed this error gets reported when the connection is broken between server and client. This happens in normal scenarios so we'll ignore this error in this scenario to avoid error reports from errors that cannot be resolved.

View the Ruby gem v3.13.1 changelog for more information.

Aug 23, 2024

AppSignal for Ruby Version 4.0

Ruby4.0.0

We've released version 4.0 of the AppSignal gem! Read all about it in the Ruby gem 4.0 blog post.

When upgrading, follow our guide for upgrading from Ruby gem 3 to 4.

Added

  • Add an at_exit callback error reporter. By default, AppSignal will now report any unhandled errors that crash the process as long as Appsignal started beforehand.

    ruby
    require "appsignal" Appsignal.start raise "oh no!" # Will report the error StandardError "oh no!"

    To disable this behavior, set the enable_at_exit_reporter config option to false.

  • Report errors from Rails runners. When a Rails runner reports an unhandled error, it will now report the error in the "runner" namespace.

  • Support adding multiple errors to a transaction.

    Using the Appsignal.report_error helper, you can now report more than one error within the same transaction context, up to a maximum of ten errors per transaction. Each error will be reported as a separate sample in the AppSignal UI.

    Before this change, using Appsignal.report_error or Appsignal.set_error helpers, adding a new error within the same transaction would overwrite the previous one.

  • Add a helper for parameters sample data to be unset. This is a private method until we stabilize it.

Changed

  • Change the default Rake task namespace to "rake". Previously, Rake tasks were reported in the "background" namespace.

  • Do not start AppSignal when the config file raises an error. Previously, the file source would be ignored.

  • Freeze the config after AppSignal has started. Prevent the config from being modified after AppSignal has started to avoid the expectation that modifying the config after starting AppSignal has any effect.

  • Do not start Appsignal multiple times if Appsignal.start is called more than once. The configuration can no longer be modified after AppSignal has started.

  • The transaction sample data is now merged by default. Previously, the sample data (except for tags) would be overwritten when a sample data helper was called.

    ruby
    # Old behavior Appsignal.set_params("param1" => "value") Appsignal.set_params("param2" => "value") # The parameters are: # { "param2" => "value" } # New behavior Appsignal.add_params("param1" => "value") Appsignal.add_params("param2" => "value") # The parameters are: # { "param1" => "value", "param2" => "value" }

    New helpers have been added:

    • Appsignal.add_tags
    • Appsignal.add_params
    • Appsignal.add_session_data
    • Appsignal.add_headers
    • Appsignal.add_custom_data

    The old named helpers that start with set_ will still work. They will also use the new merging behavior.

  • Set the Rails config defaults for Appsignal.configure when used in a Rails initializer. Now when using Appsignal.configure in a Rails initializer, the Rails env and root path are set on the AppSignal config as default values and do not need to be manually set.

  • Global transaction metadata helpers now work inside the Appsignal.report_error and Appsignal.send_error callbacks. The transaction yield parameter will continue to work, but we recommend using the global Appsignal.set_* and Appsignal.add_* helpers.

    ruby
    # Before Appsignal.report_error(error) do |transaction| transaction.set_namespace("my namespace") transaction.set_action("my action") transaction.add_tags(:tag_a => "value", :tag_b => "value") # etc. end Appsignal.send_error(error) do |transaction| transaction.set_namespace("my namespace") transaction.set_action("my action") transaction.add_tags(:tag_a => "value", :tag_b => "value") # etc. end # After Appsignal.report_error(error) do Appsignal.set_namespace("my namespace") Appsignal.set_action("my action") Appsignal.add_tags(:tag_a => "value", :tag_b => "value") # etc. end Appsignal.send_error(error) do Appsignal.set_namespace("my namespace") Appsignal.set_action("my action") Appsignal.add_tags(:tag_a => "value", :tag_b => "value") # etc. end
  • Include the Rails app config in diagnose report. If AppSignal is configured in a Rails initializer, this config is now included in the diagnose report.

  • Include the config options from the loaders config defaults and the Appsignal.configure helper in diagnose report. The sources for config option values will include the loaders and Appsignal.configure helper in the output and the JSON report sent to our severs, when opted-in.

  • Calculate error rate by transactions with an error, not the number of errors on a transaction. This limits the error rate to a maximum of 100%.

Removed

  • Remove all deprecated components. Please follow our Ruby gem 4 upgrade guide when upgrading to this version to avoid any errors from calling removed components, methods and helpers.
  • Remove the Appsignal.listen_for_error helper. Use manual exception handling using rescue => error with the Appsignal.report_error helper instead.
  • Remove (private) Appsignal::Transaction::FRONTEND constant. This was previously used for the built-in front-end integration, but this has been absent since version 3 of the Ruby gem.
  • Remove the Appsignal.config= writer. Use the Appsignal.configure helper to configure AppSignal.
  • Remove the Transaction.new method Transaction ID argument. The Transaction ID will always be automatically generated.

Fixed

  • Fix an issue where, when setting several errors for the same transaction, error causes from a different error would be shown for an error that has no causes.

View the Ruby gem v4.0.0 changelog for more information.

Aug 23, 2024

Ignore internal exceptions from Ruby and Sidekiq

Ruby4.0.1

Fixed

  • Do not report Sidekiq::JobRetry::Skip errors. These errors would be reported by our Rails error subscriber. This is an internal Sidekiq error we do not need to report.
  • Do not report SystemExit errors from our at_exit error reporter.

View the Ruby gem v4.0.1 changelog for more information.

Aug 23, 2024

Fix for Rails session data

Ruby4.0.2

Fixed

  • Do not log a warning for nil data being added as sample data, but silently ignore it because we don't support it.
  • Fix Rails session data not being reported.

View the Ruby gem v4.0.2 changelog for more information.

Aug 14, 2024

Rename heartbeats to cron check-ins and other improvements

Ruby3.13.0

Changed

  • Remove the HTTP gem's exception handling. Errors from the HTTP gem will no longer always be reported. The error will be reported only when an HTTP request is made in an instrumented context. This gives applications the opportunity to add their own custom exception handling.

    ruby
    begin HTTP.get("https://appsignal.com/error") rescue => error # Either handle the error or report it to AppSignal end
  • Rename heartbeats to cron check-ins. Calls to Appsignal.heartbeat and Appsignal::Heartbeat should be replaced with calls to Appsignal::CheckIn.cron and Appsignal::CheckIn::Cron, for example:

    ruby
    # Before Appsignal.heartbeat("do_something") do do_something end # After Appsignal::CheckIn.cron("do_something") do do_something end

Deprecated

  • Calls to Appsignal.heartbeat and Appsignal::Heartbeat will emit a deprecation warning.

View the Ruby gem v3.13.0 changelog for more information.

Aug 05, 2024

Improve installer and instructions

Ruby3.12.6

Changed

  • Configure AppSignal with the install CLI when no known frameworks is found. Automate the configure step so that this doesn't have to be done manually along with the manual setup for the app.

Deprecated

  • Deprecate the Appsignal.listen_for_error helper. Use a manual error rescue with Appsignal.report_error. This method allows for more customization of the reported error.

    ruby
    # Before Appsignal.listen_for_error do raise "some error" end # After begin raise "some error" rescue => error Appsignal.report_error(error) end

    Read our Exception handling guide for more information.

  • Deprecate the Appsignal.configure's app_path writer. Use the Appsignal.configure's root_path keyword argument to configure the path.

Fixed

  • Fix an error on the Padrino require in the installer CLI. The latest Padrino version will crash the installer on load. Ignore the error when it fails to load.
  • Fix the Appsignal.configure path config not being customizable. It's now possible to pass a root_path keyword argument to Appsignal.configure to customize the path from which AppSignal reads the config file, config/appsignal.yml.

View the Ruby gem v3.12.6 changelog for more information.

Aug 01, 2024

Fix ViewComponent instrumentation loading

Ruby3.12.4

Fixed

  • Fix an issue where, depending on the relative order of the appsignal and view_component dependencies in the Gemfile, the ViewComponent instrumentation would not load.

View the Ruby gem v3.12.4 changelog for more information.

Aug 01, 2024

Improvements to SQL query sanitization

Ruby3.12.5

Changed

  • Improve sanitization of INSERT INTO ... VALUES with multiple groups by removing additional repeated groups.

    This makes the query easier to read, and mitigates an issue where processing many events with slightly distinct queries would cause some event details to de discarded.

Fixed

  • Fix issue sanitizing SQL queries containing TRUE and FALSE values in an INSERT INTO ... VALUES clause.

View the Ruby gem v3.12.5 changelog for more information.

Jul 30, 2024

Fix config's default env

Ruby3.12.3

Fixed

  • Fix the application environment being reported as "[]" when no valid environment could be found.
  • Fix Appsignal.configure call without env argument not reusing the previously configured configuration.

View the Ruby gem v3.12.3 changelog for more information.

Jul 25, 2024

Fix monitor_and_stop helper block passing

Ruby3.12.1

Fixed

  • Fix Appsignal.monitor_and_stop block passing. It would error with a LocalJumpError. Thanks to @cwaider.

View the Ruby gem v3.12.1 changelog for more information.

Jul 25, 2024

Fix config defaults set from loader mechanism

Ruby3.12.2

Fixed

  • Fix the default env and root path for the integrations using loader mechanism. If APPSIGNAL_APP_ENV is set when using Appsignal.load(...), the AppSignal env set in APPSIGNAL_APP_ENV is now leading again.

View the Ruby gem v3.12.2 changelog for more information.

Jul 22, 2024

New configuration methods and integrations loader

Ruby3.12.0

Added

  • Add a Rails configuration option to start AppSignal after Rails is initialized. By default, AppSignal will start before the Rails initializers are run. This way it is not possible to configure AppSignal in a Rails initializer using Ruby. To configure AppSignal in a Rails initializer, configure Rails to start AppSignal after it is initialized.

    ruby
    # config/application.rb # ... module MyApp class Application < Rails::Application # Add this line config.appsignal.start_at = :after_initialize # Other config end end

    Then, in the initializer:

    ruby
    # config/initializers/appsignal.rb Appsignal.configure do |config| config.ignore_actions = ["My action"] end

    Be aware that when start_at is set to after_initialize, AppSignal will not track any errors that occur when the initializers are run and the app fails to start.

    See our Rails documentation for more information.

  • Add a new method of configuring AppSignal: Appsignal.configure. This new method allows apps to configure AppSignal in Ruby.

    ruby
    # The environment will be auto detected Appsignal.configure do |config| config.activejob_report_errors = "discard" config.sidekiq_report_errors = :discard config.ignore_actions = ["My ignored action", "My other ignored action"] config.request_headers << "MY_HTTP_HEADER" config.send_params = true config.enable_host_metrics = false end # Explicitly define which environment to start Appsignal.configure(:production) do |config| # Some config end

    This new method can be used to update config in Ruby. We still recommend to use the config/appsignal.yml file to configure AppSignal whenever possible. Apps that use the Appsignal.config = Appsignal::Config.new(...) way of configuring AppSignal, should be updated to use the new Appsignal.configure method. The Appsignal::Config.new method would overwrite the given "initial config" with the config file's config and config read from environment variables. The Appsignal.configure method is leading. The config file, environment variables and Appsignal.configure methods can all be mixed.

    See our configuration guide for more information.

Changed

  • Update the Sinatra, Padrino, Grape and Hanami integration setup for applications. Before this change a "appsignal/integrations/sinatra" file would need to be required to load the AppSignal integration for Sinatra. Similar requires exist for other libraries. This has changed to a new integration load mechanism.

    This new load mechanism makes starting AppSignal more predictable when loading multiple integrations, like those for Sinatra, Padrino, Grape and Hanami.

    ruby
    # Sinatra example # Before require "appsignal/integrations/sinatra" # After require "appsignal" Appsignal.load(:sinatra) Appsignal.start

    The require "appsignal/integrations/sinatra" will still work, but is deprecated in this release.

    See the documentation for the specific libraries for the latest on how to integrate AppSignal.

    When using a combination of the libraries listed above, read our integration guide on how to load and configure AppSignal for multiple integrations at once.

  • Disable the AppSignal Rack EventHandler when AppSignal is not active. It would still trigger our instrumentation when AppSignal is not active. This reduces the instrumentation overhead when AppSignal is not active.

Deprecated

  • Deprecate the Appsignal.config = Appsignal::Config.new(...) method of configuring AppSignal. See the changelog entry about Appsignal.configure { ... } for the new way to configure AppSignal in Ruby.
  • Deprecate the Hanami integration require: require "appsignal/integrations/hanami". Use the new Appsignal.load(:hanami) method instead. Read our Hanami docs for more information.
  • Deprecate the Padrino integration require: require "appsignal/integrations/padrino". Use the new Appsignal.load(:padrino) method instead. Read our Padrino docs for more information.
  • Deprecate the Sinatra integration require: require "appsignal/integrations/sinatra". Use the new Appsignal.load(:sinatra) method instead. Read our Sinatra docs for more information.
  • Deprecate the Grape integration require: require "appsignal/integrations/grape". Use the new Appsignal.load(:grape) method instead. Read our Grape docs for more information.

Fixed

  • Fix instrumentation events for response bodies appearing twice. When multiple instrumentation middleware were mounted in an application, it would create duplicate process_response_body.rack events.

View the Ruby gem v3.12.0 changelog for more information.

Jul 15, 2024

New and improved instrumentation helpers

Ruby3.11.0

Added

  • Add Appsignal.monitor and Appsignal.monitor_and_stop instrumentation helpers. These helpers are a replacement for the Appsignal.monitor_transaction and Appsignal.monitor_single_transaction helpers.

    Use these new helpers to create an AppSignal transaction and track any exceptions that occur within the instrumented block. This new helper supports custom namespaces and has a simpler way to set an action name. Use this helper in combination with our other Appsignal.set_* helpers to add more metadata to the transaction.

    ruby
    # New helper Appsignal.monitor( :namespace => "my_namespace", :action => "MyClass#my_method" ) do # Track an instrumentation event Appsignal.instrument("my_event.my_group") do # Some code end end # Old helper Appsignal.monitor_transaction( "process_action.my_group", :class_name => "MyClass", :action_name => "my_method" ) do # Some code end

    The Appsignal.monitor_and_stop helper can be used in the same scenarios as the Appsignal.monitor_single_transaction helper is used. One-off Ruby scripts that are not part of a long running process.

    Read our instrumentation documentation for more information about using theAppsignal.monitor helper.

  • Add Appsignal.set_session_data helper. Set custom session data on the current transaction with the Appsignal.set_session_data helper. Note that this will overwrite any request session data that would be set automatically on the transaction. When this method is called multiple times, it will overwrite the previously set value.

    ruby
    Appsignal.set_session_data("data1" => "value1", "data2" => "value2")
  • Add Appsignal.set_headers helper. Set custom request headers on the current transaction with the Appsignal.set_headers helper. Note that this will overwrite any request headers that would be set automatically on the transaction. When this method is called multiple times, it will overwrite the previously set value.

    ruby
    Appsignal.set_headers("PATH_INFO" => "/some-path", "HTTP_USER_AGENT" => "Firefox")
  • Report request headers for webmachine apps.

Changed

  • Allow tags to have boolean (true/false) values.

    ruby
    Appsignal.set_tags("my_tag_is_amazing" => true) Appsignal.set_tags("my_tag_is_false" => false)
  • Optimize Sidekiq job arguments being recorded. Job arguments are only fetched and set when we sample the job transaction, which should decrease our overhead for all jobs we don't sample.

Deprecated

  • Deprecate Transaction sample helpers: Transaction#set_sample_data and Transaction#sample_data. Please use one of the other sample data helpers instead. See our sample data guide.

  • Deprecate the Appsignal::Transaction#set_http_or_background_queue_start method. Use the Appsignal::Transaction#set_queue_start helper instead.

  • Deprecate the Appsignal.without_instrumentation helper. Use the Appsignal.ignore_instrumentation_events helper instead.

  • Deprecate the Appsignal::Transaction::GenericRequest class. Use the Appsignal.set_* helpers to set metadata on the Transaction instead. Read our sample data guide for more information.

  • Deprecate the 'ID', 'request', and 'options' arguments for the Transaction.create and Transaction.new methods. To add metadata to the transaction, use the Appsignal.set_* helpers. Read our sample data guide for more information on how to set metadata on transactions.

    ruby
    # Before Appsignal::Transaction.create( SecureRandom.uuid, "my_namespace", Appsignal::Transaction::GenericRequest.new(env) # env is a request env Hash ) # After Appsignal::Transaction.create("my_namespace")
  • Deprecate the Appsignal.monitor_transaction and Appsignal.monitor_single_transaction helpers. See the entry about the replacement helpers Appsignal.monitor and Appsignal.monitor_and_stop.

View the Ruby gem v3.11.0 changelog for more information.

Jul 08, 2024

Improved web request instrumentation

Ruby3.10.0

Added

  • Add our new recommended Rack instrumentation middleware. If an app is using the Appsignal::Rack::GenericInstrumentation middleware, please update it to use Appsignal::Rack::InstrumentationMiddleware instead.

    This new middleware will not report all requests under the "unknown" action if no action name is set. To set an action name, call the Appsignal.set_action helper from the app.

    ruby
    # config.ru # Setup AppSignal use Appsignal::Rack::InstrumentationMiddleware # Run app
  • Add Rake task performance instrumentation. Configure the enable_rake_performance_instrumentation option to true to enable Rake task instrumentation for both error and performance monitoring. To ignore specific Rake tasks, configure ignore_actions to include the name of the Rake task.

  • Add instrumentation to Rack responses, including streaming responses. New process_response_body.rack and close_response_body.rack events will be shown in the event timeline. These events show how long it takes to complete responses, depending on the response implementation, and when the response is closed.

    This Sinatra route with a streaming response will be better instrumented, for example:

    ruby
    get "/stream" do stream do |out| sleep 1 out << "1" sleep 1 out << "2" sleep 1 out << "3" end end
  • Add the Appsignal.report_error helper to report errors. If you unsure whether to use the Appsignal.set_error or Appsignal.send_error helpers in what context, use Appsignal.report_error to always report the error.

  • Support nested webmachine apps. If webmachine apps are nested in other AppSignal instrumentation it will now report the webmachine instrumentation as part of the parent transaction, reporting more runtime of the request.

  • Report the response status for Padrino requests as the response_status tag on samples, e.g. 200, 301, 500. This tag is visible on the sample detail page. Report the response status for Padrino requests as the response_status metric.

  • Add support for nested Padrino apps. When a Padrino app is nested in another Padrino app, or another framework like Sinatra or Rails, it will now report the entire request.

  • Add Appsignal.set_params helper. Set custom parameters on the current transaction with the Appsignal.set_params helper. Note that this will overwrite any request parameters that would be set automatically on the transaction. When this method is called multiple times, it will overwrite the previously set value.

    ruby
    Appsignal.set_params("param1" => "value1", "param2" => "value2")
  • Add Appsignal.set_custom_data helper to set custom data on the transaction. Previously, this could only be set with Appsignal::Transaction.current.set_custom_data("custom_data", ...). This helper makes setting the custom data more convenient.

  • Add Appsignal.set_tags helper as an alias for Appsignal.tag_request. This is a context independent named alias available on the Transaction class as well.

  • Add a block argument to the Appsignal.set_params and Appsignal::Transaction#set_params helpers. When set_params is called with a block argument, the block is executed when the parameters are stored on the Transaction. This block is only called when the Transaction is sampled. Use this block argument to avoid having to parse parameters for every transaction, to speed things up when the transaction is not sampled.

    ruby
    Appsignal.set_params do # Some slow code to parse parameters JSON.parse('{"param1": "value1"}') end

Deprecated

  • Deprecate the appsignal.action and appsignal.route request env methods to set the transaction action name. Use the Appsignal.set_action helper instead.

    ruby
    # Before env["appsignal.action"] = "POST /my-action" env["appsignal.route"] = "POST /my-action" # After Appsignal.set_action("POST /my-action")
  • Deprecate the Appsignal::Rack::StreamingListener middleware. Use the Appsignal::Rack::InstrumentationMiddleware middleware instead.

  • Deprecate the Appsignal::Rack::GenericInstrumentation middleware. Use the Appsignal::Rack::InstrumentationMiddleware middleware instead. See also the changelog entry about the InstrumentationMiddleware.

Fixed

  • Fix issue with AppSignal getting stuck in a boot loop when loading the Padrino integration with: require "appsignal/integrations/padrino" This could happen in nested applications, like a Padrino app in a Rails app. AppSignal will now use the first config AppSignal starts with.
  • Fix the deprecation warning of Bundler.rubygems.all_specs usage.

View the Ruby gem v3.10.0 changelog for more information.

Start your free trial

Don’t let the bad bugs bite. Try AppSignal for free.

AppSignal offers a 30-day free trial, no credit card is required. All features are available in all plans. Start monitoring your application in just a few clicks!