As mentioned in https://github.com/grafana/xk6-browser/issues/371, there could be a need to filter out metrics from requests with given urls which just create noise in the results. These could be requests that track user flow, adverts, or requests which aren't related to your team's ownership (if a website/page is split between multiple teams). These wouldn't be useful to see in the results and instead create noise.
Extend the functionality in page.on('metric') to allow for an ignore function, so that users can ignore metrics but still allow the request to complete e.g.:
page.on('metric', metric => {
// All metrics will not be recorded if the url tag matches the regex.
metric.ignoreURLTag({
urls: [
{url: /^https:\/\/example\.com\/[0-9a-f]*\/checkout\/[0-9a-f]*$/},
{url: /^https:\/\/example\.com\/catalogue\?session=[0-9a-f]*$/},
]});
});
Other considerations
We should use the feature to ignore about:blank metrics!
Already existing or connected issues / PRs (optional)
Feature Description
As mentioned in https://github.com/grafana/xk6-browser/issues/371, there could be a need to filter out metrics from requests with given urls which just create noise in the results. These could be requests that track user flow, adverts, or requests which aren't related to your team's ownership (if a website/page is split between multiple teams). These wouldn't be useful to see in the results and instead create noise.
Suggested Solution (optional)
page.on('metric')
to allow for an ignore function, so that users can ignore metrics but still allow the request to complete e.g.:Other considerations
We should use the feature to ignore
about:blank
metrics!Already existing or connected issues / PRs (optional)
Compliments https://github.com/grafana/xk6-browser/issues/371 Connected: https://github.com/grafana/xk6-browser/issues/10