Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation to shrink the agent's footprint: don't require disabled or absent gem based instrumentation code #2844

Open
fallwith opened this issue Sep 10, 2024 · 1 comment
Labels
oct-dec qtr Possible FY Q3 candidate

Comments

@fallwith
Copy link
Contributor

Most every gem instrumentation's detection code has some top-level lines like so:

require_relative 'widget/instrumentation'
require_relative 'widget/chain'
require_relative 'widget/prepend'

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 existing executes do block within each instrumentation file, or within their own dedicated executes do block. By having the lines live within a block, they will only being executed by Ruby conditionally, based on the instrumentation's depends_on block(s).

We did this recently with the rdkafka gem instrumentation and we should consider doing the same for all gems.

@workato-integration
Copy link

@fallwith fallwith added the oct-dec qtr Possible FY Q3 candidate label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oct-dec qtr Possible FY Q3 candidate
Projects
Development

No branches or pull requests

2 participants