From 5e25417081ab7316d883ecba5983f8b5e023973f Mon Sep 17 00:00:00 2001 From: David Davis Date: Tue, 25 Feb 2020 09:53:19 -0800 Subject: [PATCH] Fix ::Rack::Utils namespace resolution * conflicted when using rack instrumentation, since it has Rack::Utils as well --- .../adapters/sinatra/middlewares/tracer_middleware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/sinatra/lib/opentelemetry/adapters/sinatra/middlewares/tracer_middleware.rb b/adapters/sinatra/lib/opentelemetry/adapters/sinatra/middlewares/tracer_middleware.rb index ae47fbe06..d66c0b759 100644 --- a/adapters/sinatra/lib/opentelemetry/adapters/sinatra/middlewares/tracer_middleware.rb +++ b/adapters/sinatra/lib/opentelemetry/adapters/sinatra/middlewares/tracer_middleware.rb @@ -43,7 +43,7 @@ def trace_response(span, env, resp) status, _headers, _response_body = resp span.set_attribute('http.status_code', status) - span.set_attribute('http.status_text', Rack::Utils::HTTP_STATUS_CODES[status]) + span.set_attribute('http.status_text', ::Rack::Utils::HTTP_STATUS_CODES[status]) span.set_attribute('http.route', env['sinatra.route'].split.last) span.status = OpenTelemetry::Trace::Status.http_to_status(status) end