designcourse
designcourse copied to clipboard
Improve sending events on browser exit
I don't see the ability to configure flush timeout. I see it's only set in DEFAULT_CONFIGURATION.
This is not an option we expose publicly. What would be your use-case?
I am not sure that flushOnVisibilityHidden will always work (it definitely will not under IE11, and I am not sure it will work when closing frame, checking this), so searching the way to make sure all logs are sent. The other solution would be probably to add manual flush function.
We will re-explore the flushOnVisibilityHidden
strategy to see what could be improved in the use cases you mention (IE11 and removed iframe)
We won't add a way to flush manually in the short term, as we prefer to control when events are flushed. But we will keep this in mind.
Probably for IE11 the solution would be to send synchronous request in place where sendBeacon is used. Anyway the size of request is restricted, so it shouldn't block much.
Also I don't see logs are sent by Firefox on browser exit.
We also want the flush timeout can be configured or expose a API to be able to flush logs. Our use case is that we want to capture all the errors in all the cypress E2E tests(on headless mode). Once there is a failure happened, the test case/browser will be closed at once and there is no chance/time for flushing the errors. @BenoitZugmeyer
In my use-case I have a logger call in beforeunload
callback. Even though the callback is fired successfully DD fails to deliver those logs consistently in most cases (maybe 7 times out of 10 logs are not being delivered). I think it is related to the order in which beforeunload
handlers are called i.e. DD is able to send logs if its own callback is fired after log method calls: https://github.com/DataDog/browser-sdk/blob/68d010c13efec6a7a1ccec821adc1fb88f51b300/packages/core/src/transport/transport.ts#L201
Any update on this feature? Our use case is that we have a web app which may be displayed in a web view in a mobile application or accessed directly by mobile users on iOS or Android. It appears that beforeunload
doesn't trigger on mobile devices when a page is closed and so we're losing batches of logs.
It'll be great if flushTimeout
could be configured.
I'm running Datadog inside a Chrome extension - the flush interval seems enormous to the point that I don't get most of my logs because the extension is minimized before the SDK flushes.
This should be configurable just like the Node.js client which allows for manual flushing.