-
Notifications
You must be signed in to change notification settings - Fork 225
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
remove logUncaughtExceptions
config var and print uncaught exceptions to stderr by default
#2412
Comments
logUncaughtException
should default to truelogUncaughtExceptions
should default to true
See #2367 (comment) |
logUncaughtExceptions
should default to truelogUncaughtExceptions
config var and print uncaught exceptions to stderr by default
Closed by #3570 on the "dev/4.x" branch, which will become the 4.x release branch soonish. |
feat!: the start of v4.x Significant and breaking changes: - Min supported Node.js is now 14.5.0 (up from 8.6). - Drop support for the obsolete "patch" context manager, i.e. the `contextManager: "patch"` config option. This was a limited async context management that predated the preferred `AsyncLocalStorage` core Node.js mechanism for context tracking. (#3529) - Config vars: - Remove `logUncaughtExceptions` config option, if the agent's `uncaughtException` handler is active it now *always* logs the error to the console. (#2412) - Remove `filterHttpHeaders` config option, see `sanitizeFieldNames` instead. (#3332) - Remove long deprecate `ELASTIC_APM_KUBERNETES_*` envvars, use `KUBERNETES_*` instead. (#2661) - The `useElasticTraceparentHeader` config option now defaults to `false`. This means the `elastic-apm-traceparent` HTTP header is now no longer sent by default. (#3555) - Drop erroneous `ELASTIC_SANITIZE_FIELD_NAMES` and `ELASTIC_IGNORE_MESSAGE_QUEUES` config envvars. - Instrumentations: - Drop instrumentation for old `hapi`, the current `@hapi/hapi` is still instrumented. (#2691) - APIs: - Ignore a `timer` option passed to `startTransaction()` and `startSpan()` APIs. (#2990) - Remove the deprecated `span.toString()` and `transaction.toString()` APIs. (#2348) - Change `apm.startTransaction()` API to return a noop transaction instead of null when the agent is not started. (#2429) - Remove `transaction.subtype` and `transaction.action` properties from the API. This also impacts <<apm-start-transaction>> and `transaction.setType(...)`, both of which now no longer accept `subtype` and `action` parameters. (#3557)
feat!: the start of v4.x Significant and breaking changes: - Min supported Node.js is now 14.5.0 (up from 8.6). - Drop support for the obsolete "patch" context manager, i.e. the `contextManager: "patch"` config option. This was a limited async context management that predated the preferred `AsyncLocalStorage` core Node.js mechanism for context tracking. (elastic#3529) - Config vars: - Remove `logUncaughtExceptions` config option, if the agent's `uncaughtException` handler is active it now *always* logs the error to the console. (elastic#2412) - Remove `filterHttpHeaders` config option, see `sanitizeFieldNames` instead. (elastic#3332) - Remove long deprecate `ELASTIC_APM_KUBERNETES_*` envvars, use `KUBERNETES_*` instead. (elastic#2661) - The `useElasticTraceparentHeader` config option now defaults to `false`. This means the `elastic-apm-traceparent` HTTP header is now no longer sent by default. (elastic#3555) - Drop erroneous `ELASTIC_SANITIZE_FIELD_NAMES` and `ELASTIC_IGNORE_MESSAGE_QUEUES` config envvars. - Instrumentations: - Drop instrumentation for old `hapi`, the current `@hapi/hapi` is still instrumented. (elastic#2691) - APIs: - Ignore a `timer` option passed to `startTransaction()` and `startSpan()` APIs. (elastic#2990) - Remove the deprecated `span.toString()` and `transaction.toString()` APIs. (elastic#2348) - Change `apm.startTransaction()` API to return a noop transaction instead of null when the agent is not started. (elastic#2429) - Remove `transaction.subtype` and `transaction.action` properties from the API. This also impacts <<apm-start-transaction>> and `transaction.setType(...)`, both of which now no longer accept `subtype` and `action` parameters. (elastic#3557)
By default the APM agent installs an
uncaughtException
handler to send an error to APM server. By default, so as to not change application behaviour, it exits the process after sending the error.A side-effect of installing an
uncaughtException
handler is that node core no longer does its full default behaviour if there are no such handlers. Its default behaviour is to (a) print the error to stderr and (b) exit (modulo--abort-on-uncaught-exception
).If the
logUncaughtExceptions: true
config option is given to the APM agent, then it will also print the error to stderr.https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#log-uncaught-exceptions
logUncaughtExceptions
defaults to false. I think it should default to true.Note #2367 as well. If we switch to using uncaughtExceptionMonitor (in node v12.7.0 and greater) and that solves this issue, then great. Perhaps, then, this issue will only be relevant for earlier node versions.
Update 2023-08-08: Using
uncaughtExceptionMonitor
is promising but too much work for now. We can just drop thelogUncaughtExceptions
config option instead, and print a captured uncaught exception to stderr by default.The text was updated successfully, but these errors were encountered: