Changelog

Improving AppSignal, one deploy at a time.

Apr 04, 2025

Improvements for AppSignal shutdown behavior

Ruby4.5.8

Added

  • Add the enable_at_exit_hook option to configure if Appsignal.stop is called when the Ruby application exits. Calling Appsignal.stop will stop the application for a moment to flush all the data to our agent before shutting down.

    This option has three possible values:

    • always: Always call Appsignal.stop when the program exits. On (Docker) containers it's automatically set to this value.
    • never: Never call Appsignal.stop when the program exits. The default value when the program doesn't run on a (Docker) container.
    • on_error: Call Appsignal.stop when the program exits with an error.

Deprecated

  • Deprecate the Appsignal.monitor_and_stop helper.

    We instead recommend using the Appsignal.monitor helper and configuring the enable_at_exit_hook config option to always.

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

Mar 20, 2025

Support more logger methods and small changes

Ruby4.5.6

Added

  • Add the Logger << method. This improves our compatibility with Ruby's Logger class implementation, making it usable in more scenarios.

Changed

  • Explicitly return nil from public methods with no usable return value. We want to avoid the situation where Appsignal.start happens to return true and it is thought to mean that the gem started successfully.

    Methods updated:

    • Appsignal.start
    • Appsignal.stop
    • Appsignal.configure
    • Appsignal.forked
    • Appsignal.load
  • Differentiate between process_request.rack events. Add the callback that triggered the event in the event title for debugging purposes.

  • Improve the log message for the uneven timestack error. This will help the AppSignal team debug issues where events get closed when all events are already closed.

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

Mar 20, 2025

Add method to raise error if AppSignal is not started

Ruby4.5.7

Added

  • Add the Appsignal.config_error and Appsignal.config_error? methods. This method contains any error that may have occurred while loading the config/appsignal.rb file. If it is nil no error occurred or Appsignal.start hasn't been called yet. The Appsignal.config_error? method is an alias for syntax sugar.

  • Add the check_if_started! method. This method will raise an error if the AppSignal Ruby gem failed to start.

    Call this method in your CI or on app boot if you wish to verify that AppSignal has started when your application does, and want the application to fail to start if AppSignal hasn't started.

    For example, in this Rails initializer:

    Ruby
    # config/initializers/appsignal.rb Appsignal.check_if_started!

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

Mar 11, 2025

Delay agent reboots

Ruby4.5.4

Changed

  • Delay and eventually halt agent reboots by the extension.

    The AppSignal extension is responsible for booting the AppSignal agent. If communication with the agent is lost, the extension is responsible for rebooting it.

    In certain scenarios, such as when several processes with different AppSignal configurations are misconfigured to share the same working directory, the processes' extensions can enter a loop of rebooting and killing each others' agents. These short-lived agents may then attempt to repeatedly send pending payloads to AppSignal in quick succession.

    This change causes the extension to delay each reboot of its agent by one additional second, and to no longer attempt to reboot the agent after the tenth reboot, slowing down and eventually breaking this loop.

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

Mar 06, 2025

Improve Sidekiq 8 support

Ruby4.5.3

Changed

  • Specify stricter Rack version requirement. The Ruby gem relies on the Rack::Events constant which was introduced in Rack 2. Update our version requirement to require Rack 2 or newer.

Fixed

  • Fix the queue time reporting for Sidekiq 8 jobs. It would report high negative values for the queue time with Sidekiq 8.

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

Feb 24, 2025

Load appsignal.rb config for Capistrano tasks

Ruby4.5.2

Fixed

  • Validate application environment sources so nil values and empty strings are not valid app environments. Symbols are now always cast to a String before set as the application environment.

    Ruby
    # These will no longer be accepted as valid app environments Appsignal.configure("") Appsignal.configure(" ")
  • Fix Capistrano version 2 and 3 support when using an appsignal.rb config file. It will now pick up the config from appsignal.rb file.

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

Feb 21, 2025

Report custom markers directly from the Ruby gem

Ruby4.5.0

Added

  • Add a helper to create custom markers from the Ruby gem.

    Create a custom marker (a little icon shown in the graph timeline on AppSignal.com) to mark events on the timeline.

    Create a marker with all the available options:

    Ruby
    Appsignal::CustomMarker.report( # The icon shown on the timeline :icon => "🎉", # The message shown on hover :message => "Migration completed", # Any time object or a string with a ISO8601 valid time is accepted :created_at => Time.now )

    Create a marker with just a message:

    Ruby
    Appsignal::CustomMarker.report( :message => "Migration completed", )

    The default icon is the 🚀 icon. The default time is the time the request is received by our servers.

Removed

  • Remove the OpenTelemetry beta feature in favor of the new AppSignal collector. If you are using the AppSignal agent to send OpenTelemetry data in our public beta through the /enriched endpoint on the agent's HTTP server, please migrate to the collector to continue using the beta. The collector has a much better implementation of this feature for the beta.

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

Feb 06, 2025

Deduplicate error from error causes

Ruby4.4.0

Changed

  • Do not report error causes if the wrapper error has already been reported. This deduplicates errors and prevents the error wrapper and error cause to be reported separately, as long as the error wrapper is reported first.

    Ruby
    error_wrapper = nil error_cause = nil begin begin raise StandardError, "error cause" rescue => e error_cause = e raise Exception, "error wrapper" end rescue Exception => e error_wrapper = e end Appsignal.report_error(error_wrapper) # Reports error Appsignal.report_error(error_cause) # Doesn't report error

Fixed

  • Fix an issue where the HTTP.rb gem integration would raise an error when a string containing non-ASCII characters is passed to the gem as the URL.

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

Jan 20, 2025

Support Ownership gem and other improvements

Ruby4.3.3

Added

  • Add support for the Ownership gem, which is used to mark different segments of the application as owned by specific teams.

    The AppSignal sample will be tagged with the given owner:

    Ruby
    class OrdersController < ApplicationController owner :logistics # Transactions for requests handled by this controller will be tagged # in AppSignal with the "owner" tag set to "logistics" end

    If several owners are set within the same transaction, the last owner will take precedence. If an error is reported in the transaction, the owner tag will be set to the owner that was set when the error was raised.

    Set the ownership_set_namespace configuration option to true to also set the AppSignal sample's namespace to the owner. Note that doing so will cause existing performance and error incidents to be re-created with the new namespace.

    Set the instrument_ownership configuration option to false to disable the integration with the Ownership gem.

Changed

  • Do not report SystemExit errors from our Rake integration.
  • Do not report SignalException errors from our Rake integration.

Fixed

  • Fix deprecation warnings when building the AppSignal gem's native extension on Ruby 3.4, by porting the extension to use the TypedData API.

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

Dec 31, 2024

Fix double newlines in broadcasted loggers

Ruby4.3.2

Fixed

  • Fix an issue where loggers, when broadcasted to by Appsignal::Logger#broadcast_to, would format again messages that have already been formatted by the broadcaster, causing the resulting message emitted by the logger to contain double newlines.

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

Dec 20, 2024

Fix tagged logging support and add logger broadcasting

Ruby4.3.0

Added

  • Add logger broadcasting. This change implements an alternative within Appsignal::Logger to ActiveSupport::BroadcastLogger, following the same interface. This enables a proper workaround to the issues with ActiveSupport::BroadcastLogger ((#49745, #51883)) when used alongside tagged logging.

    For example, to use tagged logging both in logs emitted by the default Rails.logger and in logs sent to AppSignal, replace the Rails.logger with an AppSignal logger that broadcasts to the default Rails.logger:

    Ruby
    appsignal_logger = Appsignal::Logger.new("app") appsignal_logger.broadcast_to(Rails.logger) Rails.logger = ActiveSupport::TaggedLogging.new(appsignal_logger)

Removed

  • Remove tagged logging support from Appsignal::Logger.

    Tagged logging is still supported by wrapping an instance of Appsignal::Logger with ActiveSupport::TaggedLogging:

    Ruby
    appsignal_logger = Appsignal::Logger.new("rails") tagged_logger = ActiveSupport::TaggedLogging.new(appsignal_logger) Rails.logger = tagged_logger

    Removing this functionality allows for a workaround to issues within Rails (#49745, #51883), where using the broadcast logger to log to more than one tagged logger results in incorrect behaviour of the tagged logging methods, resulting in breakage throughout Rails' internals:

    Ruby
    # We use the built-in request ID middleware as an example that triggers # the issue: Rails.config.log_tags = [:request_id] appsignal_logger = Appsignal::Logger.new("rails") tagged_logger = ActiveSupport::TaggedLogging.new(appsignal_logger) # This does not work correctly, because the default `Rails.logger` is a # broadcast logger that is already broadcasting to a tagged logger. # When asked to broadcast to a second tagged logger, the return value of # `Rails.logger.tagged { ... }` will be incorrect, in turn causing the # `RequestID` middleware, which uses it internally, to return broken # Rack responses. Rails.logger.broadcast_to(tagged_logger)

    By reverting the changes to our logger so that it is no longer a tagged logger, we enable a workaround to this issue:

    Ruby
    Rails.config.log_tags = [:request_id] appsignal_logger = Appsignal::Logger.new("rails") # This works correctly, because `appsignal_logger` is not a tagged logger. # Note that `appsignal_logger` will not have the `request_id` tags. Rails.logger.broadcast_to(appsignal_logger)

Fixed

  • Fix #silence implementation for Appsignal::Logger.

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

Dec 16, 2024

Support Rails tagged logging and other improvements

Ruby4.2.2

Added

  • Support Rails/ActiveSupport tagged logging. When tags are set in apps using Rails.logger.tagged { ... } or with the Rails.application.config.log_tags = [...] config option, these tags are now included in the collected log messages.

    Ruby
    Rails.logger.tagged(["Tag 1", "Tag 2"]) { Rails.logger.info("My message") }

    Reports this log message:

    [Tag 1] [Tag 2] My message

Fixed

  • Fix a thread safety issue where sending check-in events simultaneously from different threads would cause several check-in schedulers to be initialised internally. This could cause some of the scheduled check-in events to never be sent to AppSignal when Appsignal.stop is called.

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

Nov 13, 2024

Add configuration via Ruby file and other improvements

Ruby4.2.0

Added

  • Add config/appsignal.rb config file support. When a config/appsignal.rb file is present in the app, the Ruby gem will automatically load it when Appsignal.start is called.

    The config/appsignal.rb config file is a replacement for the config/appsignal.yml config file. When both files are present, only the config/appsignal.rb config file is loaded when the configuration file is automatically loaded by AppSignal when the configuration file is automatically loaded by AppSignal.

    Example config/appsignal.rb config file:

    Ruby
    # config/appsignal.rb Appsignal.configure do |config| config.name = "My app name" end

    To configure different option values for environments in the config/appsignal.rb config file, use if-statements:

    Ruby
    # config/appsignal.rb Appsignal.configure do |config| config.name = "My app name" if config.env == "production" config.ignore_actions << "My production action" end if config.env == "staging" config.ignore_actions << "My staging action" end end
  • Add the config/appsignal.rb Ruby config file method to installer, appsignal install.

  • Add Appsignal.set_empty_params! helper method. This helper method can be used to unset parameters on a transaction and to prevent the Appsignal instrumentation from adding parameters to a transaction.

    Example usage:

    Ruby
    class PaymentsController < ApplicationController def create Appsignal.set_empty_params! # Do things with sensitive parameters end end

    When Appsignal.add_params is called afterward, the "empty parameters" state is cleared and any AppSignal instrumentation (if called afterward) will also add parameters again.

    Ruby
    # Example: Unset parameters when set Appsignal.add_params("abc" => "def") # Parameters: { "abc" => "def" } Appsignal.set_empty_params! # Parameters: {} # Example: When AppSignal instrumentation sets parameters: Appsignal.set_empty_params! # Parameters: {} # Pseudo example code: Appsignal::Instrumentation::SomeLibrary.new.add_params("xyz" => "...") # Parameters: {} # Example: Set parameters after them being unset previously Appsignal.set_empty_params! # Parameters: {} Appsignal.add_params("abc" => "def") # Parameters: { "abc" => "def" }
  • Add Appsignal.configure context env? helper method. Check if the loaded environment matches the given environment using the .env?(:env_name) helper.

    Example:

    Ruby
    Appsignal.configure do |config| # Symbols work as the argument if config.env?(:production) config.ignore_actions << "My production action" end # Strings also work as the argument if config.env?("staging") config.ignore_actions << "My staging action" end end
  • Allow for default attributes to be given when initialising a Logger instance:

    Ruby
    order_logger = Appsignal::Logger.new("app", attributes: { order_id: 123 })

    All log lines reported by this logger will contain the given attribute. Attributes given when reporting the log line will be merged with the default attributes for the logger, with those in the log line taking priority.

Changed

  • Read the Hanami Action name without metaprogramming in Hanami 2.2 and newer. This makes our instrumentation more stable whenever something changes in future Hanami releases.

  • Ignore these Hanami errors by default:

    • Hanami::Router::NotAllowedError (for example: sending a GET request to POST endpoint)
    • Hanami::Router::NotFoundError

    They are usually errors you don't want to be notified about, so we ignore them by default now.

    Customize the ignore_errors config option to continue receiving these errors.

Fixed

  • Fix request parameter reporting for Hanami 2.2.

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

Nov 07, 2024

Fix build on ARM64 Linux and other improvements

Ruby4.1.3

Added

  • Add activate_if_environment helper for Appsignal.configure. Avoid having to add conditionals to your configuration file and use the activate_if_environment helper to specify for which environments AppSignal should become active. AppSignal will automatically detect the environment and activate itself it the environment matches one of the listed environments.

    Ruby
    # Before Appsignal.configure do |config| config.active = Rails.env.production? || Rails.env.staging? end # After Appsignal.configure do |config| # Activate for one environment config.activate_if_environment(:production) # Activate for multiple environments config.activate_if_environment(:production, :staging) end
  • Add a hostname AppSignal tag automatically, based on the OpenTelemetry host.name resource attribute. (Beta only)

  • Add incident error count metric for enriched OpenTelemetry traces. (Beta only)

  • Set the app revision config option for Scalingo deploys automatically. If the CONTAINER_VERSION system environment variable is present, it will use used to set the revision config option automatically. Overwrite it's value by configuring the revision config option for your application.

Changed

  • Ignore the Rails healthcheck endpoint (Rails::HealthController#show) by default for Rails apps.

    If the ignore_actions option is set in the config/appsignal.yml file, the default is overwritten. If the APPSIGNAL_IGNORE_ACTIONS environment variable is set, the default is overwritten. When using the Appsignal.configure helper, add more actions to the default like so:

    Ruby
    # config/appsignal.rb Appsignal.configure do |config| # Add more actions to ignore config.ignore_actions << "My action" end

    To overwrite the default using the Appsignal.configure helper, do either of the following:

    Ruby
    # config/appsignal.rb Appsignal.configure do |config| # Overwrite the default value, ignoring all actions ignored by default config.ignore_actions = ["My action"] # To only remove the healtcheck endpoint config.ignore_actions.delete("Rails::HealthController#show") end

Fixed

  • Fix an issue where the extension fails to build on ARM64 Linux.

View the Ruby gem v4.1.3 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!