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

Log errors to stdout/err #29

Open
eh-am opened this issue Feb 22, 2023 · 1 comment
Open

Log errors to stdout/err #29

eh-am opened this issue Feb 22, 2023 · 1 comment

Comments

@eh-am
Copy link
Collaborator

eh-am commented Feb 22, 2023

When first starting the

Pyroscope.init({
  serverAddress: 'https://pyroscope.cloud',
  appName: 'nodejs-test',
})

Pyroscope.start()

And error was thrown:

throw 'Pyroscope is not configured. Please call init() first.';

But I was calling init, which is confusing.

By setting the DEBUG environment variable, the error message is shown:

 DEBUG='pyroscope*' node main.js
  pyroscope Pyroscope is running on a cloud server, but no authToken was provided. Pyroscope will not be able to ingest data. +1ms

Therefore we should just log that message to stdout/err instead of hiding behind an env var.

@GeoffreyPlitt
Copy link

Another symptom of the same issue: We got our token wrong, but we had no idea at first. No errors or warnings on STDOUT. Finally after turning on debug logging, we found pyroscope { status: 'error', error: 'authentication error: invalid token' }. Errors like this should not be swallowed in DEBUG logs.

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

No branches or pull requests

2 participants