Skip to content

Conversation

cwli24
Copy link
Contributor

@cwli24 cwli24 commented Sep 16, 2025

Please follow conventional commit standards
in your commit messages and pull request title.

Give us some context

Follow up to #20194 . Browser Agent is nearing roll out phase (target end of month) for replacing old SPA with newer soft nav feature, with the additional add of long task consideration aka SPA 2.1.

Important: Please do not merge until agent is ready or we give the go-ahead signal.

Copy link

Hi @cwli24 👋

Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days.

Please ensure the propsed changes look good by building it first in your local environment. Refer to this contribution guide to get the site up and running in your local.

If you really require a preview url, reach out to one of the writers and they will generate one for you.

@sujitnewrelic
Copy link
Contributor

netlify build fork

@svc-docs-eng-opensource-bot
Copy link
Contributor

✅ Your PR has been mirrored to our repository as PR #21779.
Commit: 1fe34a3400294a6aff36a95c339bd6fb977ffff5 (1fe34a3)
Our workflows will run in the mirrored PR linked above.
🚀 If the build is successful, a Netlify preview will be available shortly at: https://cwli24-browser-spa-2-1--docs-website-netlify.netlify.app

Copy link
Contributor

@sujitnewrelic sujitnewrelic left a comment

Choose a reason for hiding this comment

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

Please review the suggested changes and update.


<Callout variant="important">
The `createTracer` method in the SPA API has been deprecated. The recommended way to trace the duration of a task is to capture a performance [mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) and/or [measure](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure). Future browser agent versions will capture marks and measures automatically, at which point support for `createTracer` will cease.
The `createTracer` method in the SPA API has been deprecated. The recommended way to trace the duration of a task is to capture a performance [mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) and/or [measure](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure) for measuring callback execution time. In SPA v2+, this method has become a dummy method that no longer work to tie JS execution to interactions or keep them open--it effectively does nothing!
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `createTracer` method in the SPA API has been deprecated. The recommended way to trace the duration of a task is to capture a performance [mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) and/or [measure](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure) for measuring callback execution time. In SPA v2+, this method has become a dummy method that no longer work to tie JS execution to interactions or keep them open--it effectively does nothing!
The `createTracer` method in the SPA API has been deprecated. The recommended way to trace the duration of a task is to capture a performance [mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) and/or [measure](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure) for measuring callback execution time. this method is now inactive and no longer functions to link JavaScript execution with interactions or maintain them open.

Copy link
Contributor Author

@cwli24 cwli24 Sep 29, 2025

Choose a reason for hiding this comment

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

There's a capitalization issue in here, and "maintain them open" is grammatically incorrect (Gemini verified this).

## Description

This SPA method will end the browser interaction at the current time. Any subsequent callbacks or requests will not be included as part of the SPA interaction.
This SPA method will end the browser interaction at the current time. Any subsequent network requests that start after this method is called will not be included as part of the current SPA interaction. In SPA v2.1+, this can also be used to terminate an interaction in a pending state that's monitoring for any long task in a 5s window.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This SPA method will end the browser interaction at the current time. Any subsequent network requests that start after this method is called will not be included as part of the current SPA interaction. In SPA v2.1+, this can also be used to terminate an interaction in a pending state that's monitoring for any long task in a 5s window.
This SPA method will end the browser interaction at the current time. Any subsequent network requests that begin after this method is called will not be included as part of the current SPA interaction. In SPA v2.1 and later, this method can also be used to terminate an interaction in a pending state when monitoring for any long task in a 5-second window.

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 want to emphasize that the interaction itself is doing the monitoring. A better edit here according to Gemini would be "pending state and is monitoring for" OR "pending state that monitors for" -- either of which I can agree with. Can you pick one of these and update your suggested change?

Following these steps, browser interactions are considered finished on the next repaint frame. They will also associate XHR and fetch requests started within their span. v2.1 introduced another step:

All apps are different and have different monitoring needs. That's why we include default monitoring as well as the ability to set up custom monitoring for any browser interactions you choose.
4. Monitor for long running callbacks for a period of 5 seconds. If any are detected, extend the interaction and repeat.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
4. Monitor for long running callbacks for a period of 5 seconds. If any are detected, extend the interaction and repeat.
4. For SPA v2.1, Monitor for long running callbacks for a period of 5 seconds. If any are detected, extend the interaction and repeat.

Copy link
Contributor Author

@cwli24 cwli24 Sep 29, 2025

Choose a reason for hiding this comment

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

Suggested change
4. Monitor for long running callbacks for a period of 5 seconds. If any are detected, extend the interaction and repeat.
4. For SPA v2.1 and onward: monitor for long running callbacks for a period of 5 seconds. If any are detected, extend the interaction and repeat.

Like this?

@sujitnewrelic sujitnewrelic self-assigned this Sep 25, 2025
@sujitnewrelic
Copy link
Contributor

Hi @cwli24 . I have reviewed and added my comments in the PR. Please fix those.

cwli24 and others added 4 commits September 29, 2025 10:42
…ction.mdx

Co-authored-by: sujitnewrelic <sujitkumarswain@newrelic.com>
…ction.mdx

Co-authored-by: sujitnewrelic <sujitkumarswain@newrelic.com>
Co-authored-by: sujitnewrelic <sujitkumarswain@newrelic.com>
@PallaviWrite PallaviWrite added documentation from_internal Identifies issues/PRs from Relics (except writers) labels Oct 3, 2025
Copy link
Contributor

@PallaviWrite PallaviWrite left a comment

Choose a reason for hiding this comment

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

lgtm

@PallaviWrite PallaviWrite merged commit 658a8ce into newrelic:develop Oct 3, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation from_internal Identifies issues/PRs from Relics (except writers)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants