module Instana::CubaPathTemplateExtractor

Constants

REPLACE_TARGET

Public Class Methods

prepended(base) click to toggle source
# File lib/instana/frameworks/cuba.rb, line 10
def self.prepended(base)
  ::Instana.logger.debug "#{base} prepended #{self}"
end

Public Instance Methods

call!(env) click to toggle source
Calls superclass method
# File lib/instana/frameworks/cuba.rb, line 26
def call!(env)
  env['INSTANA_PATH_TEMPLATE_FRAGMENTS'] = []
  response = super(env)
  env['INSTANA_HTTP_PATH_TEMPLATE'] = env['INSTANA_PATH_TEMPLATE_FRAGMENTS']
    .join('/')
    .gsub(REPLACE_TARGET, '{\k<term>}')
  response
end
on(*args, &blk) click to toggle source
Calls superclass method
# File lib/instana/frameworks/cuba.rb, line 14
def on(*args, &blk)
  wrapper = lambda do |*caputres|
    env['INSTANA_PATH_TEMPLATE_FRAGMENTS'] << args
      .select { |a| a.is_a?(String) }
      .join('/')

    blk.call(*captures)
  end

  super(*args, &wrapper)
end