File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
sinatra/lib/opentelemetry/instrumentation/sinatra Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ def build_rack_app(api_class)
4949 elsif values . include? ( 'http' )
5050 use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_stable )
5151 else
52- use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_old )
52+ use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_old )
5353 end
54-
54+
5555 run api_class
5656 end
5757 Rack ::MockRequest . new ( builder )
Original file line number Diff line number Diff line change @@ -54,12 +54,14 @@ def install_middleware(app)
5454 stability_opt_in = ENV . fetch ( 'OTEL_SEMCONV_STABILITY_OPT_IN' , '' )
5555 values = stability_opt_in . split ( ',' ) . map ( &:strip )
5656
57- if values . include? ( 'http/dup' )
58- app . use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_dup ) if config [ :install_rack ]
59- elsif values . include? ( 'http' )
60- app . use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_stable ) if config [ :install_rack ]
61- else
62- app . use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_old ) if config [ :install_rack ]
57+ if config [ :install_rack ]
58+ if values . include? ( 'http/dup' )
59+ app . use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_dup )
60+ elsif values . include? ( 'http' )
61+ app . use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_stable )
62+ else
63+ app . use ( *OpenTelemetry ::Instrumentation ::Rack ::Instrumentation . instance . middleware_args_old )
64+ end
6365 end
6466
6567 app . use ( Middlewares ::TracerMiddleware )
You can’t perform that action at this time.
0 commit comments