Optimisation to shrink the agent's footprint: don't require disabled or absent gem based instrumentation code #2844
Labels
oct-dec qtr
Possible FY Q3 candidate
Milestone
Most every gem instrumentation's detection code has some top-level lines like so:
These lines are evaluated by Ruby and cause all of instrumentation logic for the gem to be loaded into the Ruby VM even if the gem does not exist in the customer's tech stack and even if the customer's configuration has explicitly disabled the instrumentation. Essentially some Ruby methods will sit defined but orphaned in the customer's Ruby VM instance.
We can shrink the relevant footprint by moving these
require_relative
lines either into the existingexecutes do
block within each instrumentation file, or within their own dedicatedexecutes do
block. By having the lines live within a block, they will only being executed by Ruby conditionally, based on the instrumentation'sdepends_on
block(s).We did this recently with the
rdkafka
gem instrumentation and we should consider doing the same for all gems.The text was updated successfully, but these errors were encountered: