We do some performance analysis on how long it takes to load certain elements in the page which we currently report using console.log... example, loginTime:
step.soft('loginTime: Waiting for recommendations to load', async () => {
//Start a timer and then click the login button
var loginTime = Date.now();
await page.getByRole('button', {
name: 'Log in'
}).click();
await expect(page.locator("xpath=//*[@data-gtm-strip-source-type='CF_RECOMMENDATION']")).toBeVisible();
loginTime = Date.now() - loginTime;
console.log("custom.loginTime: " + loginTime);
});
In Elastic search this typically shows up as synthetics.payload.message:
We use these recorded values to run some reports on how long certain functions are taking on different sites from different locations.
This disappeared for a period of 2 weeks and then randomly came back and we don't understand why. I had a thought that console.log was only recorded in Elastic Search under some specific condition (like an error) but the monitors don't have any errors so I'm a bit perplexed.
Is there another method where we could have these values show up in elastic query or is console.log still the best way to go? Any idea why they vanished randomly? They had been working for at least a month or so.