-
Notifications
You must be signed in to change notification settings - Fork 196
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
Logrus hook causing performance issues #1422
Comments
apm-agent-go/module/apmlogrus/hook.go Lines 118 to 120 in c953eed
Given that the default behaviour for fatal level logging is for logrus to exit the process, it seems like a reasonable behaviour. You can override the timeout by setting apm-agent-go/module/apmlogrus/hook.go Line 67 in c953eed
|
Thank you for this issue. I just renamed it to have a more meaningful (and less clickbait-y) title. |
I admit that we've faced performance issue because of some silly decisions in an old library and misconfigured logger. But I also want to point out that it's a bad system design to rule one infra subsystem from another with some hookish code. It's not obvious for people who would debug same problems that the root of such a lag is a logger but not the tracer or APM agent itself. |
Describe the bug
It is not a bug report but an attempt to warn on harm from code of logrus logger hook. https://github.com/elastic/apm-agent-go/blob/main/module/apmlogrus/hook.go In our case, this code produce a 5 second performance penalty on API endpoints which produces errors (like http 404 error). Moreover, since this hook was a part of a custom legacy library, it was hard to find a reason of such behavior. But switching off a tracer integration removed the lag, so an Apm Agent and tracing was a first suspect.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I think the code of this hook should be deprecated and abandoned in the future. My points for this decision:
The text was updated successfully, but these errors were encountered: