Changelog

Improving AppSignal, one deploy at a time.

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.

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!