Skip to content

Commit 8b15203

Browse files
committed
update
1 parent 2d85cd8 commit 8b15203

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/stack-service-base.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ def rack_setup app
1010
return unless app.respond_to? :use
1111

1212
app.instance_eval do
13+
if OTEL_ENABLED
14+
otel_initialize
15+
end
16+
1317
RackHelpers.rack_setup app
18+
1419
if ENV.fetch('PROMETHEUS_METRICS_EXPORT', 'true') == 'true'
1520
require 'stack-service-base/prometheus'
1621

@@ -19,11 +24,6 @@ def rack_setup app
1924
use Prometheus::Middleware::Exporter
2025
end
2126

22-
if OTEL_ENABLED
23-
otel_initialize
24-
use *OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args
25-
end
26-
2727
if defined? Sequel
2828
Sequel::Database.after_initialize { _1.loggers << LOGGER }
2929

lib/stack-service-base/open_telemetry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def otel_initialize
6464
# Rack::Builder
6565
OpenTelemetry::Instrumentation::Sinatra
6666
c.use_all({
67-
'OpenTelemetry::Instrumentation::Sinatra' => { install_rack: false }, # instlled by stack-service-base.rb#24 (use *OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args)
67+
'OpenTelemetry::Instrumentation::Sinatra' => { install_rack: false }, # installed by rack-helpers.rb#176
6868
'OpenTelemetry::Instrumentation::Rack' => {
6969
use_rack_events: false, # TODO: doesnt work with Websoket requests
7070
# /home/user/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/opentelemetry-instrumentation-rack-0.26.0/lib/opentelemetry/instrumentation/rack/instrumentation.rb#43

lib/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module StackServiceBase
22
class Base
3-
VERSION = '0.0.14'
3+
VERSION = '0.0.15'
44
end
55
end

0 commit comments

Comments
 (0)