designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

Reduce the delay time to send the bulk post

Open huydoansg opened this issue 3 years ago • 3 comments

I added @datadog/browser-logs to our website,

As I observed, after the page loaded around 30 seconds, it will send the log to the server.

Unfortunately, our client just spends few seconds on our website so we might miss the log, so how can I configure the time to reduce it?

Just went through the document not found any document for this requirement.

huydoansg avatar Jul 23 '21 11:07 huydoansg

Hello @huydoansg,

The logs are batched before being sent to datadog servers and several conditions can make us flush the batch:

  • every 30s
  • when the batch reach 50 events
  • when the batch is > 16kB
  • on visibility hidden or beforeUnload

So when your client leave your website, pending logs should be sent to the server.

Let us know if there is any issue with that.

bcaudan avatar Jul 23 '21 11:07 bcaudan

Thank you for your quick response @bcaudan

My website is mainly displayed in a web view of Mobile Application of our client. So not sure any problem with the web view or not, can it lose the log? But for sure our users might spend a small time on our website. It is very convenient if we can configure the time that sends the bulk - reduce from 30s to a smaller number

huydoansg avatar Jul 23 '21 14:07 huydoansg

https://github.com/DataDog/browser-sdk/issues/767

faizan-ali avatar Jul 09 '23 23:07 faizan-ali