From 1890d440387857d1f453508075e3f8c98201dc82 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sun, 5 Mar 2023 08:44:28 -0600 Subject: [PATCH] feat: Sinatra Rack Events This PR makes it possible for users to toggle between using the Rack Events and Middleware based instrumentation See https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/341 Depends on https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/342 --- .../instrumentation/sinatra/extensions/tracer_extension.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/extensions/tracer_extension.rb b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/extensions/tracer_extension.rb index c00246335..c14c6424d 100644 --- a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/extensions/tracer_extension.rb +++ b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/extensions/tracer_extension.rb @@ -28,7 +28,7 @@ def render(_engine, data, *) end end end - app.use OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware + app.use(*OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args) app.use Middlewares::TracerMiddleware end end