-
Notifications
You must be signed in to change notification settings - Fork 15
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
Internal errors in @axiomhq/pino cause server to crash #140
Comments
It would be appreciable to have a |
@charles-rc I had a very similar problem-incident while using try{
// Data ingestion as mentioned in their @axiomhq/js readme
axiom.ingest(dataset, [{ foo: 'bar' }]);
await axiom.flush()
}catch(err){
console.log(err)
} |
I am working on handling those exception now, finalizing the PR. |
we have a released a new version of axiom-js and axiom-pino that would solve the exceptions handling in axiom-js. on Monday we will continue investigating Pino package and add some tests to ensure that doesn't happen again. let us know if this works our for you, and if there is any thing we can improve on the new |
@schehata thanks for doing that! Unfortunately, I am getting this error when attempting to pass in a custom
I think it's to do with how However, it doesn't seem like I can pass in a custom handler to pass the error onto Sentry or the like. Am I maybe doing something wrong? |
the |
looks like, doing this won't be straight forward. I think the problem is that the worker can't pass a function in There is another way but that will need some work, I am wondering if its worth it? or the current console.log would be enough? |
I think this is a similar issue to #131.
We currently use
@axiomhq/pino
in our Koa Node servers. Our logging (and our servers!) went down for an hour. We have Sentry errors during this time for errors internal to Axiom -Error FetchClient.<anonymous>(@axiomhq.js.dist.cjs:fetchClient) Service Unavailable
.It seems that either Axiom ingestion (via the
api.axiom.co
endpoint) went down for an hour or potentially our network connectivity in AWS ECS dropped.It appears that thrown (network) errors during
axiom.ingest
aren't caught properly. You can reproduce this by logging with an instance of@axiomhq/pino
with your internet connection disabled. The error is thrown at the root of the program so it halts execution.I tried using the
hooks
functionality of pino to put a wrapper around the logs but it appears I cannot awaitingest()
as its promise is not returned by the log function.I would love your advice on how to resolve this. I think either better error handling inside
@axiomhq/pino
or some callback we can subscribe to would be best.I guess I could also try wrapping the instantiation of the logger in a function to attempt to catch errors there rather than at the script level?
This is obviously a bit concerning that a network error can bring down our server. Other libraries like
ioredis
have anonError
callback that will be invoked if network connectivity drops, but it doesn't crash the server.Thanks in advance for all your help!
The text was updated successfully, but these errors were encountered: