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

Cleanup instrumentation info-level logging #2434

Open
4 tasks
hannahramadan opened this issue Feb 12, 2024 · 2 comments
Open
4 tasks

Cleanup instrumentation info-level logging #2434

hannahramadan opened this issue Feb 12, 2024 · 2 comments
Labels
3 Story Point Estimate technical debt

Comments

@hannahramadan
Copy link
Contributor

hannahramadan commented Feb 12, 2024

When the agent instruments a customer's app, it records a log message about what is being instrumented, for example: Installing Fiber instrumentation. We often hard-code this log in instrumentation files. However, the method log_and_instrument, which is called whenever preprend or chain is used, also logs instrumentation and records a supportability metric. This results in cases where instrumentation notices are logged twice, or potentially not at all, and supportability metrics are not recorded.

def log_and_instrument(method, instrumenting_module, supportability_name)
  supportability_name ||= extract_supportability_name(instrumenting_module)
  NewRelic::Agent.logger.info("Installing New Relic supported #{supportability_name} instrumentation using #{method}")
  NewRelic::Agent.record_metric("Supportability/Instrumentation/#{supportability_name}/#{method}", 0.0)
  yield
end

We should review each instrumentation file to:

  • Remove log messages if preprend or chain is being used
  • Add a log statement if preprend or chain is not being used
  • Record a supportability metric if preprend or chain is not being used
  • Update Thor instrumentation to remove the log statement and add a comment about log_and_instrument so we can remember this

default_source.rb can be used to quickly determine if prepend or chain is avaliable or not.

dupe: #2516

@workato-integration
Copy link

@kford-newrelic kford-newrelic added estimate Issue needing estimation 3 Story Point Estimate and removed estimate Issue needing estimation labels Feb 16, 2024
@kford-newrelic kford-newrelic added the apr-jun qtr Represents proposed work item for the Apr-Jun quarter label Apr 12, 2024
@fallwith
Copy link
Contributor

Please re-test #2516 after closing this issue and then either close #2516 or specify that additional work still needs to be done to address it.

@kford-newrelic kford-newrelic removed the apr-jun qtr Represents proposed work item for the Apr-Jun quarter label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 Story Point Estimate technical debt
Projects
Development

No branches or pull requests

4 participants