Sha256: c781101abe552b3b56011f5ca0182066ca093fb1404aafb7dcd32e9f5be20bfe
Contents?: true
Size: 1.31 KB
Versions: 37
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.info "#{__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.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" Instana.logger.debug e.backtrace.join("\r\n") return nil end end end end
Version data entries
37 entries across 37 versions & 1 rubygems