lib/opentracing/instrumentation/rack/trace_middleware.rb in opentracing-instrumentation-0.1.18 vs lib/opentracing/instrumentation/rack/trace_middleware.rb in opentracing-instrumentation-0.2.0
- old
+ new
@@ -34,14 +34,14 @@
end
end
private
- attr_reader :app
- attr_reader :http_tagger
- attr_reader :tracer
- attr_reader :logger
+ attr_reader :app,
+ :http_tagger,
+ :tracer,
+ :logger
def trace_request(env)
extracted_ctx = tracer.extract(OpenTracing::FORMAT_RACK, env)
logger&.info('Tracing context extracted') if extracted_ctx
command_name = @command_name_builder.build_command_name(env)
@@ -82,10 +82,10 @@
end
def set_header_tags(span, headers)
http_tagger
.response_tags(headers)
- .each(&span.method(:set_tag))
+ .each { |(key, value)| span.set_tag(key, value) }
end
def error_tag(span, error)
span.set_tag('error', true)
span.log_kv('error.kind': error.class.to_s)