Fix an issue with loggers not supporting a formatter on Rails boot. This will prevent the AppSignal logger config from running into an error if the logger configuration is added to config/application.rb or one of the environments in config/environments/.
Do not log long (error) messages to the internal AppSignal log. If an error like ActionController::BadRequest occurred and the error message contained the entire file upload, this would grow the appsignal.log file quickly if the error happens often. Internal log messages are now truncated by default.
Detect the log format automatically. We now detect if a log line is in the JSON, Logfmt or plaintext formats. No further config needed when calling our logger, like so:
Fix sample data not being reported for JRuby applications. Data like tags, parameters, session data, etc. would not be set if a transaction was sampled.
Do not patch Rack::Events when using recent Rack versions. When using versions 3.2.1 and above,
which contain a fix for the bug where using Rack::Events breaks requests with streaming bodies,
use Rack::Events directly, instead of our patched subclass.
Fixed
Fix Rails version detection when only one of Rails's gems is present.
This prevents loading errors when non-Rails code defines a Rails constant without the full Rails framework.
Add Sidekiq worker-level job status metric: worker_job_count. This new counter metric's status tag will be processed for each job that's processed and reports another counter with the failure status if the job encountered an error.
Fixed
Support streaming bodies. AppSignal's Rack instrumentation now supports streaming bodies in responses, such as those produced by Async::Cable. This fixes an issue where AppSignal's Rack instrumentation would cause requests with streaming bodies to crash.
If you use our Rack instrumentation through a framework that is automatically instrumented by AppSignal, such as Rails, Hanami, Padrino or Sinatra, this fix is applied automatically.
If your application instruments Rack manually, you must remove the following line from your application's initial setup:
Shell
use Rack::Events, [Appsignal::Rack::EventHandler.new]
And replace it with the following line:
Shell
use Appsignal::Rack::EventMiddleware
Avoid instrumenting Rails when AppSignal is not active. If AppSignal is configured to start when the Rails application loads, rather than after it has initialised, only add Rails' instrumentation middlewares if AppSignal was actually started.
Add Sorbet and RBS type signatures for the gem's public APIs. If your editor supports showing type signatures, they will now show up in for the AppSignal Ruby gem.
When a deployment tool (Capistrano, Hatchbox.io) provides the REVISION file in the deployed application, AppSignal will now use that to set the revision config.
Changed
Improve the YARD documentation for public APIs. This will make the documentation clearer and more useful for developers using the Ruby gem. Private APIs have been hidden from the generated output.
When an error occurs while initializing AppSignal or when running a probe, use the error log level to log the error's backtrace.
Fixed
When a Hash-like value (such as ActiveSupport::HashWithIndifferentAccess or Sinatra::IndifferentHash) is passed to a transaction helper (such as add_params, add_session_data, ...) it is now converted to a Ruby Hash before setting it as the value or merging it with the existing value. This allows Hash-like objects to be merged, instead of logging a warning and only storing the new value.
When an Appsignal::Logger uses .broadcast_to to broadcast messages to other loggers, broadcast those messages even if the log level of those messages is lower than the logger's threshold. This allows other loggers to set their own logging thresholds.
When the logger is silenced, messages below the silencing threshold are not broadcasted to other loggers.
When an Appsignal::Logger uses .broadcast_to to broadcast messages to other loggers, broadcast the original message received by the logger, without formatting it or converting it to a string.
Call the Appsignal::Logger formatter with the original message object given, rather than converting it to a string before calling the formatter.
When an error is passed to an Appsignal::Logger as the message, format it regardless of the logging level. Previously it would only be formatted when passed to #error.
Ignore Errno::ECONNRESET errors in the Rack wrapper.
Add nginx_port configuration option. This configuration option can be used to customize the port on which the AppSignal integration exposes the NGINX metrics server.
Resolve problems with transactions not being properly closed when using libraries that change Fibers during the transactions. Previously, completed transactions would be attempted to be reused when creating a transaction, when the Fiber would be switched during a transaction.
Fix a config error log message when the config is not active and should not validate the config.
Remove redundant cron check-in pairs. When more than one pair of start and finish cron check-in events is reported for the same identifier in the same period, only one of them will be reported to AppSignal.
Ensure request transactions are always closed in the Rack::EventHandler. A problem with Fibers changing during a request would cause transactions transactions to be left open and the data from requests to not be sent to our servers.
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.
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.
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.
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!