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

use process.emitWarning for user warnings #2029

Open
trentm opened this issue Apr 2, 2021 · 1 comment
Open

use process.emitWarning for user warnings #2029

trentm opened this issue Apr 2, 2021 · 1 comment
Labels
agent-nodejs Make available for APM Agents project planning.

Comments

@trentm
Copy link
Member

trentm commented Apr 2, 2021

As a follow-on to both #2001 and the coming elastic/apm-nodejs-http-client#144 let's consider changing the agent to use process.emitWarning when we want to give warnings to the user rather than logger.warn() or logger.error(). That will:

  1. allow us to not spam to user if it is a repeated situation (e.g. if we are dropping events because of load on the APM server)
  2. make the text more readable for the user (it won't be a JSON log record)
  3. allow the user to handle/silence particular warnings if they want

A starter list of specific things we should be warning about:

  • demote the log.error about APM server connection issues to a warning (the occasional APM server conn issue is not typically an error the user needs to deal with)
  • add a warning if we are dropping a significant number of events because of load to the APM server (this from the maxQueueSize config coming after fix: blocking behaviour under load apm-nodejs-http-client#144
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Apr 2, 2021
@trentm trentm added this to Planned in APM-Agents (OLD) via automation Apr 2, 2021
@trentm
Copy link
Member Author

trentm commented Feb 2, 2023

Note that process.emitWarning is now being used in a few places in the agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
APM-Agents (OLD)
  
Planned
Development

No branches or pull requests

1 participant