Module: NewRelic::Agent::Instrumentation::Sinatra

Includes:
ControllerInstrumentation
Defined in:
lib/new_relic/agent/instrumentation/sinatra.rb

Overview

NewRelic instrumentation for Sinatra applications. Sinatra actions will appear in the UI similar to controller actions, and have breakdown charts and transaction traces.

The actions in the UI will correspond to the pattern expression used to match them. HTTP operations are not distinguished. Multiple matches will all be tracked as separate actions.

Defined Under Namespace

Modules: NewRelic

Constant Summary

Constants included from QueueTime

QueueTime::ALL_MIDDLEWARE_METRIC, QueueTime::ALL_QUEUE_METRIC, QueueTime::ALL_SERVER_METRIC, QueueTime::ALT_QUEUE_HEADER, QueueTime::APP_HEADER, QueueTime::HEADER_REGEX, QueueTime::HEROKU_QUEUE_HEADER, QueueTime::MAIN_HEADER, QueueTime::MIDDLEWARE_HEADER, QueueTime::MIDDLEWARE_METRIC, QueueTime::QUEUE_HEADER, QueueTime::SERVER_METRIC

Instance Method Summary collapse

Methods included from ControllerInstrumentation

included, #newrelic_metric_path, #perform_action_with_newrelic_trace

Methods included from QueueTime

#parse_frontend_headers

Instance Method Details

#dispatch_with_newrelicObject



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/new_relic/agent/instrumentation/sinatra.rb', line 36

def dispatch_with_newrelic
  txn_name = NewRelic.transaction_name(self.class.routes, @request) do |pattern, keys, conditions|
    process_route(pattern, keys, conditions) do
      pattern.source
    end
  end
  
  perform_action_with_newrelic_trace(:category => :sinatra,
                                     :name => txn_name,
                                     :params => @request.params) do
    dispatch_without_newrelic
  end
end