Skip to content

Commit 62ce1ca

Browse files
committed
Update action_pack to use middleware alias
1 parent b8e0c73 commit 62ce1ca

File tree

1 file changed

+8
-8
lines changed
  • instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack

1 file changed

+8
-8
lines changed

instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/railtie.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ class Railtie < ::Rails::Railtie
1515
stability_opt_in = ENV.fetch('OTEL_SEMCONV_STABILITY_OPT_IN', '')
1616
values = stability_opt_in.split(',').map(&:strip)
1717

18-
middleware_args = if values.include?('http/dup')
19-
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_dup
20-
elsif values.include?('http')
21-
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_stable
22-
else
23-
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_old
24-
end
18+
rack_middleware_args = if values.include?('http/dup')
19+
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_dup
20+
elsif values.include?('http')
21+
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_stable
22+
else
23+
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args
24+
end
2525

2626
app.middleware.insert_before(
2727
0,
28-
*middleware_args
28+
*rack_middleware_args
2929
)
3030
end
3131
end

0 commit comments

Comments
 (0)