Changelog

Improving AppSignal, one deploy at a time.

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.

View all Ruby updates

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!