lib/skylight/instrumenter.rb in skylight-5.0.0.beta vs lib/skylight/instrumenter.rb in skylight-5.0.0.beta2

- old
+ new

@@ -58,12 +58,10 @@ @subscriber = Skylight::Subscriber.new(config, self) @trace_info = @config[:trace_info] || TraceInfo.new(KEY) @mutex = Mutex.new @extensions = Skylight::Extensions::Collection.new(@config) - - enable_extension!(:source_location) if @config.enable_source_locations? end def enable_extension!(name) @mutex.synchronize { extensions.enable!(name) } end @@ -174,10 +172,11 @@ unless native_start warn "failed to start instrumenter" return end + enable_extension!(:source_location) if @config.enable_source_locations? config.gc.enable @subscriber.register! ActiveSupport::Notifications.instrument("started_instrumenter.skylight", instrumenter: self) @@ -200,9 +199,11 @@ return trace end begin + meta ||= {} + extensions.process_trace_meta(meta) trace = Trace.new(self, endpoint, Skylight::Util::Clock.nanos, cat, title, desc, meta: meta, segment: segment, component: component) rescue Exception => e log_error e.message t { e.backtrace.join("\n") }