Skip to content

Conversation

@ankur22
Copy link
Contributor

@ankur22 ankur22 commented Nov 18, 2025

What?

When the FID metric is measured, a warning will be logged to let users know to move away from working with browser_web_vital_fid and instead use browser_web_vital_inp.

Why?

FID has been deprecated -- ttps://web.dev/blog/fid.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

Please do not merge this PR until the following items are filled out.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

#5179

@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 09:42 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 09:44 — with GitHub Actions Inactive
@ankur22 ankur22 force-pushed the add/fid-deprecation-warning-log branch from 2f0630d to 41ae3a1 Compare November 18, 2025 10:49

type browserBuildFunc func(ctx, vuCtx context.Context) (*common.Browser, error)

var fidDeprecationWarningOnce sync.Once
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely happy with this approach. Is there something I'm missing, maybe a state that I can rely on that allows me to log a single warning log regardless of how many iterations, VUs and scenarios are in the test?

@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 10:58 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 11:00 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 11:13 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 11:15 — with GitHub Actions Inactive
@ankur22 ankur22 force-pushed the add/fid-deprecation-warning-log branch from d5a3723 to 1079c97 Compare November 18, 2025 12:11
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 12:17 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 18, 2025 12:18 — with GitHub Actions Inactive
@ankur22 ankur22 marked this pull request as ready for review November 19, 2025 10:51
@ankur22 ankur22 requested a review from a team as a code owner November 19, 2025 10:51
@ankur22 ankur22 requested review from mstoykov and oleiade and removed request for a team November 19, 2025 10:51
Comment on lines 214 to 217
fidDeprecationWarningOnce.Do(func() {
vu.State().Logger.Warnf("FID has been deprecated and superseded by INP -- https://web.dev/blog/fid")
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it will ALWAYS log this instead of only when this is used. I am not aware how this is used, but if it is going to always be logged and we will just drop it ... maybe just drop a warning that will be useless for most people and lets just drop it in v2 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about logging a warning when the FID metric is about to be emitted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that still happen each time someone uses browser - irregardless of what they are using it for /

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, i see what you're saying. The user could be relying on the metric in a threshold, what about adding a log when a threshold uses the metric? Any other ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a quick POC, placing a warn log line here produces this:

> k6 run e2e/quickpizza-admin-user.js
WARN[0000] browser_web_vital_fid has been deprecated and superseded by browser_web_vital_inp 

         /\      Grafana   /‾‾/  
    /\  /  \     |\  __   /  /   
   /  \/    \    | |/ /  /   ‾‾\ 
  /          \   |   (  |  (‾)  |
 / __________ \  |_|\_\  \_____/ 

So pretty hidden, whereas i would want the log line to be more visible. I also don't want to spend too long on this with lots of changes just to get the log line in the correct place, since this is temporary and FID will be removed in v2.

@ankur22 ankur22 force-pushed the add/fid-deprecation-warning-log branch from c3bf882 to f9e449b Compare November 20, 2025 17:08
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 20, 2025 17:14 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 20, 2025 17:24 — with GitHub Actions Inactive
@ankur22 ankur22 temporarily deployed to azure-trusted-signing November 20, 2025 17:26 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants