File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ RUN export gem_file=$(cat gem_file.txt) && \
20
20
bundle update; \
21
21
fi
22
22
23
- RUN rm /build/layer/ruby/ruby/3.2.0/cache/*
23
+ RUN rm /build/layer/ruby/ruby/3.2.0/cache/* && rm -rf /build/layer/ruby/ruby/3.2.0/doc/*
24
24
25
25
WORKDIR /build/layer/ruby/ruby
26
26
RUN zip -qr gems-3.2.0.zip 3.2.0/
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ RUN export gem_file=$(cat gem_file.txt) && \
20
20
bundle update; \
21
21
fi
22
22
23
- RUN rm /build/layer/ruby/ruby/3.3.0/cache/*
23
+ RUN rm /build/layer/ruby/ruby/3.3.0/cache/* && rm -rf /build/layer/ruby/ruby/3.3.0/doc/*
24
24
25
25
WORKDIR /build/layer/ruby/ruby
26
26
RUN zip -qr gems-3.3.0.zip 3.3.0/
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def preload_function_dependencies
15
15
16
16
unless handler_file && File . exist? ( "#{ default_task_location } /#{ handler_file } .rb" )
17
17
OpenTelemetry . logger . warn { 'Could not find the original handler file to preload libraries.' }
18
- return
18
+ return nil
19
19
end
20
20
21
21
libraries = File . read ( "#{ default_task_location } /#{ handler_file } .rb" )
@@ -27,11 +27,16 @@ def preload_function_dependencies
27
27
rescue StandardError => e
28
28
OpenTelemetry . logger . warn { "Could not load library #{ lib } : #{ e . message } " }
29
29
end
30
+ handler_file
30
31
end
31
32
32
- unless ENV [ 'SW_APM_LAMBDA_PRELOAD_DEPS' ] . to_s . downcase == 'false'
33
+ if ENV [ 'SW_APM_LAMBDA_PRELOAD_DEPS' ] . to_s . downcase == 'false'
33
34
OpenTelemetry . logger . warn { "SW_APM_LAMBDA_PRELOAD_DEPS set to #{ ENV . fetch ( 'SW_APM_LAMBDA_PRELOAD_DEPS' , nil ) } . No libraries will be preloaded." }
34
- preload_function_dependencies
35
+ else
36
+
37
+ handler_file = preload_function_dependencies
38
+
39
+ OpenTelemetry . logger . info { "Libraries in #{ handler_file } have been preloaded." } if handler_file
35
40
36
41
require 'opentelemetry-registry'
37
42
require 'opentelemetry-instrumentation-all'
You can’t perform that action at this time.
0 commit comments