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

New Relic: add error for agent not being found #1457

Merged
merged 5 commits into from
Aug 15, 2022

Conversation

zawadzkip
Copy link
Contributor

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # #1419 (reply in thread)

Type of change

Added a more readable error message with the New Relic agent is not found

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Disabled the new relic agent from being installed on my application, and ran the application locally.

Test Environment:

  • OS: macOS 12.4
  • @envelop/...:
  • NodeJS: 14.17.0

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@changeset-bot
Copy link

changeset-bot bot commented Jul 27, 2022

🦋 Changeset detected

Latest commit: dd9474c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@envelop/newrelic Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 27, 2022

@zawadzkip is attempting to deploy a commit to the The Guild Team on Vercel.

A member of the Team first needs to authorize it.

@santino
Copy link
Contributor

santino commented Jul 28, 2022

Thank you for your contribution and the discussion!

A couple of minor comments from me.

I think in this case it makes sense to use EnvelopError class.

import { EnvelopError } from '@envelop/core'

throw new EnvelopError('message')

cc @n1ru4l to confirm this.

As about the message, I would change it to "Agent unavailable. Please check your New Relic Agent configuration"

@n1ru4l
Copy link
Owner

n1ru4l commented Aug 4, 2022

@santino Since this error message should probably not reach the client, I think just using Error is totally fine here!

@zawadzkip If you are ready with this PR, please change it status to "Ready for review" and also add a changeset as instructed in #1457 (comment)

@zawadzkip zawadzkip marked this pull request as ready for review August 14, 2022 17:47
@zawadzkip
Copy link
Contributor Author

zawadzkip commented Aug 14, 2022

@n1ru4l @santino Thanks for the patience! I finally got around to adding the changeset. First time doing so, please let me know if I did it incorrectly.

I also updated the error message plus a bit more verbiage based on the comments. My initial use case for this error was surrounding a service that had new relic installed and configured, however, we had environment variables enabling/disabling new relic, which took a little time to debug.

Looks like my formatter also changed some things, if you'd like me to undo those im happy to.

@n1ru4l n1ru4l merged commit ff8b447 into n1ru4l:main Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants