Sha256: 8d0f3ac554810dac0a48c652a8d37a736cd16767f4441fb6b1b85331c497ce39
Contents?: true
Size: 1.31 KB
Versions: 19
Compression:
Stored size: 1.31 KB
Contents
module Instana module Helpers EUM_SNIPPET= (File.read(File.dirname(__FILE__) + '/eum/eum.js.erb')).freeze EUM_TEST_SNIPPET= (File.read(File.dirname(__FILE__) + '/eum/eum-test.js.erb')).freeze class << self # Returns a processed javascript snippet to be placed within the HEAD tag of an HTML page. # def eum_snippet(api_key, kvs = {}) return nil if !::Instana.tracer.tracing? ::Instana.config[:eum_api_key] = api_key ::Instana.config[:eum_baggage] = kvs ERB.new(EUM_SNIPPET).result rescue => e Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" Instana.logger.debug e.backtrace.join("\r\n") return nil end # Returns a processed javascript snippet to be placed within the HEAD tag of an HTML page. # This one is used for testing only # def eum_test_snippet(api_key, kvs = {}) return nil if !::Instana.tracer.tracing? ::Instana.config[:eum_api_key] = api_key ::Instana.config[:eum_baggage] = kvs ERB.new(EUM_TEST_SNIPPET).result rescue => e Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" Instana.logger.debug e.backtrace.join("\r\n") return nil end end end end
Version data entries
19 entries across 19 versions & 1 rubygems