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

Closed
4 tasks
hannahramadan opened this issue Feb 12, 2024 · 2 comments · Fixed by #2881
Closed
4 tasks

Cleanup instrumentation info-level logging #2434

hannahramadan opened this issue Feb 12, 2024 · 2 comments · Fixed by #2881
Assignees
Labels
oct-dec qtr Possible FY Q3 candidate 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 the estimate Issue needing estimation label Feb 16, 2024
@kford-newrelic kford-newrelic added 3 Story Point Estimate and removed estimate Issue needing estimation labels Feb 16, 2024
@kford-newrelic kford-newrelic moved this from Triage to In Quarter in Ruby Engineering Board Apr 12, 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.

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 technical debt
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants