Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out request metrics by their URL tag #1434

Open
Tracked by #1460
ankur22 opened this issue Sep 20, 2024 · 2 comments
Open
Tracked by #1460

Filter out request metrics by their URL tag #1434

ankur22 opened this issue Sep 20, 2024 · 2 comments
Labels
feature A new feature next Might be eligible for the next planning (not guaranteed!) user request Requested by the community

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Sep 20, 2024

Feature Description

As mentioned in #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)

  1. Implement page.route (Implement route(url, handler[, options]) #10), to allow the user to add urls to intercept and abort, thus not recording metrics to do with that request. This would also prevent the request from being sent.
  2. 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)

Compliments #371
Connected: #10

@ankur22 ankur22 added feature A new feature user request Requested by the community labels Sep 20, 2024
@ankur22 ankur22 changed the title Implement page.route to abort unnecessary requests Filter out request metrics by their URL tag Oct 3, 2024
@inancgumus inancgumus mentioned this issue Oct 4, 2024
@andrewslotin
Copy link
Contributor

Can we filter out about:blank metrics by default once this is in place?

@ankur22
Copy link
Collaborator Author

ankur22 commented Oct 11, 2024

Can we filter out #518 by default once this is in place?

Nice idea! Yes, we should do that 👍

@ankur22 ankur22 added the next Might be eligible for the next planning (not guaranteed!) label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature next Might be eligible for the next planning (not guaranteed!) user request Requested by the community
Projects
Development

No branches or pull requests

2 participants