module AppDynamics::BusinessTransactions
The BusinessTransactions
module specifies a list of named Business Transactions and which requests should map to them. All non-mapped requests are ignored.
AppDynamics::BusinessTransactions.define do bt "index" => "/" # exact match (any method) bt "help_page" => %r{^/help_topics/\d+/?$} # regex match (any method) bt "user_update" => %r{^/users/\d+/?$}, method: :put # regex match with method bt "multi" => ["/multi", %r{/multi/id/.+}], method: [:post, :put] bt "multi_block" do get "/foo", %r{^/foo/[a-z]+} # multiple strings or regexes post "/bar" end end
A Business Transaction
is specified as a name mapping to a path matcher which can be a String (for an exact match) or a Regex or an array of either type.
bt "users" => "/users" bt "admin" => %r{^/admin/?} bt "companies" => ["/company_list", "/companies", %r{/company/\d+}]
You can also specify an HTTP method or list of methods to limit to only requests of that type. Available options are `:get`, `:post`, `:put`, `:patch`, and `:delete`.
bt "new_user" => "/users", method: :post bt "update_user" => "/users", method: [:put, :patch]
Finally, more complex definitions can be made using the block API. Inside of the block a list of path matchers is specified for a specific HTTP method.
bt "api" do get "/users" post "/users", %r{.+\.json$} end
Constants
- METHODS
Public Class Methods
define(&block)
click to toggle source
# File lib/app_dynamics/business_transactions.rb, line 46 def self.define(&block) global_set.define(&block) end
global_set()
click to toggle source
# File lib/app_dynamics/business_transactions.rb, line 42 def self.global_set @global_set || reset! end
reset!()
click to toggle source
# File lib/app_dynamics/business_transactions.rb, line 38 def self.reset! @global_set = TransactionSet.new end