-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
OpenTelemetry plugin not sending logs to collector #14068
Comments
Hi @DMaxter, thank you for opening this issue. Is any log produced in your Kong
If understood correctly, the moment you added a log with a level that is compatible to your logging configuration, i.e. higher than INFO: The two log entries you mention in your description are likely the following:
Which are expected to only be outputed once for each worker. To reiterate, you should only expect logs that exist in the |
Hello The logs I'm expecting to be exported are in the |
Hi @DMaxter , at this time only the error log output is reported in OpenTelemetry format via the OpenTelemetry plugin when this feature is enabled. In addition to that, any entry that is generated in custom plugins, using the
Could you point me to that information? It's possible that this is incorrectly documented, in which case I'll make sure it is addressed. |
Okay, I was reading it again and it doesn't say they should be exported, my bad. But I find this information very unclear.
Here it says that they are produced during the request lifecycle and that could be logs generated by plugins, not that it is only generated by them, which from the information you gave me, seems to be the case? Or are there still other logs associated with requests that are sent?
Here the confusing part is that operators should capture the |
hey @DMaxter, thank you for clarifying. Where the documentation mentions
Regarding the last paragraph, it is stating that not all (error) logs are guaranteed to always be captured, in fact, some low-level errors produced by Nginx and logs produced by the Nginx master process are not captured, for that reason, the I hope that helps clarifying the functionality of OTel formatted logs. Let me know in case of any doubt, thank you! |
Is there an existing issue for this?
Kong version (
$ kong version
)3.9.0
Current Behavior
When setting the OpenTelemetry plugin and setting the logs endpoint, it sends a request to the collector (sometimes 2), but after that nothing else is sent (even after waiting some minutes).
I noticed that if the log level is debug the requests are then sent.
I compiled kong from source and played around a bit, and the behavior is super strange:
If I add
in either of these functions
kong/kong/plugins/opentelemetry/logs.lua
Line 22 in 0118b3c
kong/kong/plugins/opentelemetry/utils.lua
Line 16 in 0118b3c
To check that this was indeed a problem on Kong side, I even checked with tcpdump and there seems to be no traffic at all. Connection is established and around 1min later we have the connection being closed and nothing more.
This seems to be either some buffer that needs to be flushed or the worker thread that is supposed to make the request not running. If I used
ngx.DEBUG
instead ofngx.ERR
, I would have the same behavior as if the statement wasn't there, because default log level is higher (info)Expected Behavior
Logs sent to OpenTelemetry collector after a timeout (which should be some seconds) or right after making them if timeout is too low.
Steps To Reproduce
Anything else?
No response
The text was updated successfully, but these errors were encountered: