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

Dependency detection: duplicated log entries, potentially duplicated invocations #2516

Closed
fallwith opened this issue Mar 19, 2024 · 5 comments
Labels
apr-jun qtr Represents proposed work item for the Apr-Jun quarter bug

Comments

@fallwith
Copy link
Contributor

Issues:

  • dependency detection logic is double reported for every instrumented gem
  • dependency detection logic may possibly also be involving doubled, redundant invocations

To reproduce:

  • set the log level to debug and init the agent
  • observe the log to see duplicated detection lines such as these:
DEBUG : Using auto configuration value for bunny to configure instrumentation
DEBUG : Using auto configuration value for bunny to configure instrumentation
DEBUG : Using auto configuration value for concurrent_ruby to configure instrumentation
DEBUG : Using auto configuration value for concurrent_ruby to configure instrumentation
DEBUG : Using auto configuration value for curb to configure instrumentation
DEBUG : Using auto configuration value for curb to configure instrumentation
DEBUG : Using auto configuration value for delayed_job to configure instrumentation
DEBUG : Using auto configuration value for delayed_job to configure instrumentation

Source:
The log output is generated by the fetch_config_value method defined in lib/new_relic/dependency_detection.rb.

Pathways:
The doubled log output is produced by 2 different call stacks:

# pathway 1
"lib/new_relic/dependency_detection.rb:183:in `fetch_config_value'",
"lib/new_relic/dependency_detection.rb:202:in `config_value'",
"lib/new_relic/dependency_detection.rb:170:in `block (2 levels) in <class:Dependent>'",
"lib/new_relic/dependency_detection.rb:139:in `allowed_by_config?'",
"lib/new_relic/dependency_detection.rb:122:in `check_dependencies'",
"lib/new_relic/dependency_detection.rb:64:in `dependencies_satisfied?'",
"lib/new_relic/dependency_detection.rb:28:in `block in detect!'",
"lib/new_relic/dependency_detection.rb:27:in `each'",
"lib/new_relic/dependency_detection.rb:27:in `detect!'",
"lib/new_relic/control/instrumentation.rb:64:in `_install_instrumentation'",
"lib/new_relic/control/instrumentation.rb:47:in `install_instrumentation'",
"lib/new_relic/control/private_instance_methods.rb:39:in `init_instrumentation'",
"lib/new_relic/control/instance_methods.rb:75:in `init_plugin'",

# pathway 2
"lib/new_relic/dependency_detection.rb:183:in `fetch_config_value'",
"lib/new_relic/dependency_detection.rb:202:in `config_value'",
"lib/new_relic/dependency_detection.rb:170:in `block (2 levels) in <class:Dependent>'",
"lib/new_relic/dependency_detection.rb:31:in `block in detect!'",
"lib/new_relic/dependency_detection.rb:27:in `each'",
"lib/new_relic/dependency_detection.rb:27:in `detect!'",
"lib/new_relic/control/instrumentation.rb:64:in `_install_instrumentation'",
"lib/new_relic/control/instrumentation.rb:47:in `install_instrumentation'",
"lib/new_relic/control/private_instance_methods.rb:39:in `init_instrumentation'",
"lib/new_relic/control/instance_methods.rb:75:in `init_plugin'",

Impact:

  • The agent logs more than it should when using a debug log level (default = info)
  • The agent potentially does more detection work that it needs to at startup
@fallwith fallwith added the bug label Mar 19, 2024
@workato-integration
Copy link

@kaylareopelle
Copy link
Contributor

This one reminds me of #2434

@kaylareopelle
Copy link
Contributor

I love the detailed repro and data in your description here

@kford-newrelic kford-newrelic added estimate Issue needing estimation apr-jun qtr Represents proposed work item for the Apr-Jun quarter labels Mar 29, 2024
@kford-newrelic kford-newrelic removed the estimate Issue needing estimation label Apr 12, 2024
@fallwith
Copy link
Contributor Author

Let's confirm the output shown in the description has gone away once #2434 has been completed.

@fallwith
Copy link
Contributor Author

fallwith commented Jun 3, 2024

We'll let #2434 drive this one. Closing as a dupe.

@fallwith fallwith closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apr-jun qtr Represents proposed work item for the Apr-Jun quarter bug
Projects
Archived in project
Development

No branches or pull requests

3 participants