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

hotfix: prevent exception in record_one_broadcast_with_new_relic #2510

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

nathan-appere
Copy link
Contributor

Before contributing, please read our contributing guidelines and code of conduct.

Overview

Describe the changes present in the pull request

Submitter Checklist:

  • Include a link to the related GitHub issue, if applicable
  • Include a security review link, if applicable

Testing

The agent includes a suite of unit and functional tests which should be used to
verify your changes don't break existing functionality. These tests will run with
GitHub Actions when a pull request is made. More details on running the tests locally can be found
here for our unit tests,
and here for our functional tests.
For most contributions it is strongly recommended to add additional tests which
exercise your changes.

Reviewer Checklist

  • Perform code review
  • Add performance label
  • Perform appropriate level of performance testing
  • Confirm all checks passed
  • Add version label prior to acceptance

@CLAassistant
Copy link

CLAassistant commented Mar 14, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label Mar 14, 2024
@nathan-appere nathan-appere force-pushed the hotfix/nil-exception branch 2 times, most recently from 145c152 to 7cac1f9 Compare March 14, 2024 12:05
yield
broadcasts.each { |broadcasted_logger| broadcasted_logger.instance_variable_set(:@skip_instrumenting, false) }
else
::NewRelic::Agent.record_custom_event('NR Error - record_one_broadcast_with_new_relic - nil broadcasts', {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a something you hoped to get out of using record_custom_event?

We'd typically log an error instead, something like:

Suggested change
::NewRelic::Agent.record_custom_event('NR Error - record_one_broadcast_with_new_relic - nil broadcasts', {})
NewRelic::Agent.logger.error('Error recording broadcasted logger')

@hannahramadan
Copy link
Contributor

Hi @nathan-appere! Thank you so much for this contribution. I've left one small comment and we will need the Contributor License Agreement signed before merging ◡̈

@nathan-appere
Copy link
Contributor Author

Hey @hannahramadan thanks for having a look, I ended up not deploying as it seems a bit dangerous to have a Rails version with random errors 🤔

Copy link
Contributor

@tannalynn tannalynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for getting this updated and signing the CLA!

@tannalynn tannalynn merged commit 7aef0a5 into newrelic:dev Mar 22, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community To tag external issues and PRs submitted by the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants