datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

Buffer size of 4K in input worker limits log size to 4K when using UDP

Open behos opened this issue 8 years ago • 1 comments

When using the UDP log listener, we are seeing that whenever we send a log message over 4K, it only partially gets received by the agent. When this happens, we can see the first 4K of our message, followed by a complete message if that is less than 4K.

Essentially the pattern looks like this:

[ first 4K of a message [ first 4K of a message [ message smaller than 4K ]

I have pinpointed this behaviour here:

https://github.com/DataDog/datadog-agent/blob/6.3.2/pkg/logs/input/listener/worker.go#L88-L89

It seems to me that the expected behaviour of the listener is to read 4K blocks until either a newline is read, or the 256K limit is met here:

https://github.com/DataDog/datadog-agent/blob/6.3.2/pkg/logs/decoder/decoder.go#L15

However, from what I understand, when doing a read on a UDP connection, the 4K buffer is filled and the rest of the message is discarded.

This essentially limtis the log listener to 4K per message when using UDP, which is quite small for our needs. Could this become configurable by any chance?

behos avatar Jul 10 '18 15:07 behos

Hi @behos,

Thanks for opening this issue, we'll investigate and come back to you as soon as we have a fix. Best, Alexandre

ajacquemot avatar Jul 10 '18 15:07 ajacquemot