[EBT] define global method for determining when telemetry has been shipped #140521
Labels
Feature:Telemetry
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
technical debt
Improvement of the software architecture and operational architecture
In #140383 we added a request tracker which observes every request from the page and produces a promise for every request to
telemetry-staging.elastic.co
, which is resolved as soon as the request succeeds or fails. When a performance journey completes a three second timer is started, and when the three second timer is completed the listener for requests is stopped and all pending requests are awaited.We do this to try and make sure that we are able to wait for all telemetry requests to complete without just placing an arbitrary delay on every journey.
There is still an edge case here that we might need to fix at some point: the EBT client buffers telemetry for 1 second and the timer which is created to build that 1 second collection of telemetry might not fire before our 3 second timer. Browsers delay timers for all sorts of reasons, and it would be ideal if we could be notified when the buffer is actually cleared and the telemetry up to that point has been sent successfully.
In order for browser automation to interact with the buffer at all there must be a global method written to the
window
object.I'm thinking the method might work something like this:
The text was updated successfully, but these errors were encountered: