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.
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.
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.
# 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:
# 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.
# 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.
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.
# 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.
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.require "appsignal/integrations/hanami"
. Use the new Appsignal.load(:hanami)
method instead. Read our Hanami docs for more information.require "appsignal/integrations/padrino"
. Use the new Appsignal.load(:padrino)
method instead. Read our Padrino docs for more information.require "appsignal/integrations/sinatra"
. Use the new Appsignal.load(:sinatra)
method instead. Read our Sinatra docs for more information.require "appsignal/integrations/grape"
. Use the new Appsignal.load(:grape)
method instead. Read our Grape docs for more information.process_response_body.rack
events.View the Ruby gem v3.12.0 changelog for more information.
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.
# 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.
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.
Appsignal.set_headers("PATH_INFO" => "/some-path", "HTTP_USER_AGENT" => "Firefox")
Report request headers for webmachine apps.
Allow tags to have boolean (true/false) values.
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.
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.
# 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.
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.
# 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:
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.
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.
Appsignal.set_params do # Some slow code to parse parameters JSON.parse('{"param1": "value1"}') end
Deprecate the appsignal.action
and appsignal.route
request env methods to set the transaction action name. Use the Appsignal.set_action
helper instead.
# 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
.
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.Bundler.rubygems.all_specs
usage.View the Ruby gem v3.10.0 changelog for more information.
500
for the response_status
tag on the transaction and on the response_status
metric.require "appsignal"
had to be called before require "appsignal/integrations/grape"
. This require "appsignal"
is no longer required.hostname
tag, add process_name
and process_id
tags to the gvl_global_timer
and gvl_waiting_threads
metrics emitted by the GVL probe, allowing these metrics to be tracked in a per-process basis.Deprecate Appsignal::Grape::Middleware
constant in favor of Appsignal::Rack::GrapeMiddleware
constant.
To fix this deprecation warning, update the usage of Appsignal::Grape::Middleware
like this:
# Grape only apps insert_before Grape::Middleware::Error, Appsignal::Rack::GrapeMiddleware # or use Appsignal::Rack::GrapeMiddleware # Grape on Rails app use Appsignal::Rack::GrapeMiddleware
Deprecate the Appsignal.start_logger
method. Remove this method call from apps if it is present. Calling Appsignal.start
will now initialize the logger.
request_method
method, like ActionDispatch::Request
.require "appsignal/integrations/hanami"
This could happen in nested applications, like a Hanami app in a Rails app. It will now use the first config AppSignal starts with.View the Ruby gem v3.9.3 changelog for more information.
response_status
tag and metric for Hanami requests.require "appsignal/integrations/sinatra"
will now report more of the request, if previously other middleware were not instrumented. It will also report the response status with the response_status
tag and metric.Transacation.params=
usage by updating how we record parameters in our instrumentations.View the Ruby gem v3.9.2 changelog for more information.
View the Ruby gem v3.9.1 changelog for more information.
sidekiq_report_errors
config option to "discard" to only report errors when the job is not retried further.require "appsignal/integrations/sinatra"
This could happen in nested applications, like a Sinatra app in a Rails app. It will now use the first config AppSignal starts with.View the Ruby gem v3.9.0 changelog for more information.
process_request.rack
event in the event timeline.Fix ArgumentError being raised on Ruby logger and Rails.logger error calls. This fixes the error from being raised from within the AppSignal Ruby gem. Please do not use this for error reporting. We recommend using our error reporting feature instead to be notified of new errors. Read more on exception handling in Ruby with our Ruby gem.
# No longer raises an error Rails.logger.error StandardError.new("StandardError log message")
View the Ruby gem v3.8.0 changelog for more information.
View the Ruby gem v3.7.6 changelog for more information.
Support events emitted by ViewComponent. Rendering of ViewComponent-based components will appear as events in your performance samples' event timeline.
For AppSignal to instrument ViewComponent events, you must first configure ViewComponent to emit those events:
# config/application.rb module MyRailsApp class Application < Rails::Application config.view_component.instrumentation_enabled = true config.view_component.use_deprecated_instrumentation_name = false end end
Thanks to Trae Robrock (@trobrock) for providing a starting point for this implementation!
Support Kamal-based deployments. Read the KAMAL_VERSION
environment variable, which Kamal exposes within the deployed container, if present, and use it as the application revision if it is not set. This will automatically report deploy markers for applications using Kamal.
Fix an issue where an error about the AppSignal internal logger is raised when sending a heartbeat.
See the Ruby gem 3.7.5 changelog for more information.
Fix LocalJumpError in Active Job instrumentation initialization for Active Job < 7.1.
See the Ruby gem 3.7.4 changelog for more information.
Add option to activejob_report_errors
option to only report errors when a job is discard by Active Job. In the example below the job is retried twice. If it fails with an error twice the job is discarded. If activejob_report_errors
is set to discard
, you will only get an error reported when the job is discarded. This new discard
value only works for Active Job 7.1 and newer.
class ExampleJob < ActiveJob::Base retry_on StandardError, :attempts => 2 # ... end
More information in our Active Job documentation.
Track Active Job executions per job. When a job is retried the "executions" metadata for Active Job jobs goes up by one for every retry. We now track this as the executions
tag on the job sample.
See the Ruby gem 3.7.3 changelog for more information.
See the Ruby gem 3.7.2 changelog for more information.
log/
directory, it will no longer print the warning more than once.Appsignal.stop
is called. When Appsignal.stop
is called, the probes thread will no longer continue running in the app process.APPSIGNAL_HTTP_PROXY
environment variable in the extension installer. When APPSIGNAL_HTTP_PROXY
is set during gem instal appsignal
or bundle install
, it will use the proxy specified in the APPSIGNAL_HTTP_PROXY
environment variable to download the extension and agent.Appsignal::Probes.unregister
to unregister probes registered with Appsignal::Probes.register
if you do not need a certain probe, including default probes.Appsignal::Probes.register
method as the preferred method to register probes. The Appsignal::Probes.probes.register
and Appsignal::Minutely.probes.register
methods are now deprecated.Appsignal::Probes.register
when the gem has already started the probes thread. Previously, the late registered probes would not be run.Appsignal::Minutely
, please update it to Appsignal::Probes
. If your app calls Appsignal::Minutely
after this upgrade without the name change, the gem will print a deprecation warning for each time the Appsignal::Minutely
is called.See the Ruby gem 3.7.1 changelog for more information.
ignore_logs
configuration optionAdd the ignore_logs
configuration option, which can also be configured as the APPSIGNAL_IGNORE_LOGS
environment variable.
The value of ignore_logs
is a list (comma-separated, when using the environment variable) of log line messages that should be ignored. For example, the value "start"
will cause any message containing the word "start" to be ignored. Any log line message containing a value in ignore_logs
will not be reported to AppSignal.
The values can use a small subset of regular expression syntax (specifically, ^
, $
and .*
) to narrow or expand the scope of lines that should be matched.
For example, the value "^start$"
can be used to ignore any message that is exactly the word "start", but not messages that merely contain it, like "Process failed to start". The value "Task .* succeeded"
can be used to ignore messages about task success regardless of the specific task name.
Heartbeats are currently only available to beta testers. If you are interested in trying it out, send an email to support@appsignal.com!
Add heartbeats support. You can send heartbeats directly from your code, to track the execution of certain processes:
def send_invoices() # ... your code here ... Appsignal.heartbeat("send_invoices") end
You can pass a block to Appsignal.heartbeat
, to report to AppSignal both when the process starts, and when it finishes, allowing you to see the duration of the process:
def send_invoices() Appsignal.heartbeat("send_invoices") do # ... your code here ... end end
If an exception is raised within the block, the finish event will not be reported to AppSignal, triggering a notification about the missing heartbeat. The exception will bubble outside of the heartbeat block.
See the Ruby gem 3.7.0 changelog for more information.
Fix CPU user
/system
usage measurements, as to take into account the amount of CPUs available.
Fix a bug where performing queries using older versions of redis-client
would result in a NoMethodError
being raised.
Using redis-client
version 0.14.0
or greater is a requirement for AppSignal to instrument Redis queries.
See the Ruby gem 3.6.5 changelog for more information.
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!