-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Perf: Add diagnostic sub-spans to ManualOpenSearchRouter #83076
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
base: main
Are you sure you want to change the base?
Changes from all commits
9a89d49
ef575b5
5f99d51
b1112c6
ff0acd5
8b8ae8d
a3d27e3
4016f14
08ed61f
2444370
61bb27a
7fe536c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ import React, {useContext, useEffect, useRef, useState} from 'react'; | |
| import type {AnimatedTextInputRef} from '@components/RNTextInput'; | ||
| import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute'; | ||
| import {navigationRef} from '@libs/Navigation/Navigation'; | ||
| import {startSpan} from '@libs/telemetry/activeSpans'; | ||
| import {endSpan, getSpan, startSpan} from '@libs/telemetry/activeSpans'; | ||
| import {close} from '@userActions/Modal'; | ||
| import CONST from '@src/CONST'; | ||
| import NAVIGATORS from '@src/NAVIGATORS'; | ||
|
|
@@ -77,8 +77,14 @@ function SearchRouterContextProvider({children}: ChildrenProps) { | |
| if (isBrowserWithHistory) { | ||
| window.history.pushState({isSearchModalOpen: true} satisfies HistoryState, ''); | ||
| } | ||
| startSpan(CONST.TELEMETRY.SPAN_SEARCH_ROUTER_MODAL_CLOSE_WAIT, { | ||
| name: CONST.TELEMETRY.SPAN_SEARCH_ROUTER_MODAL_CLOSE_WAIT, | ||
| op: 'ui.modal.wait', | ||
| parentSpan: getSpan(CONST.TELEMETRY.SPAN_OPEN_SEARCH_ROUTER), | ||
| }); | ||
| close( | ||
| () => { | ||
| endSpan(CONST.TELEMETRY.SPAN_SEARCH_ROUTER_MODAL_CLOSE_WAIT); | ||
| openSearch(setIsSearchRouterDisplayed); | ||
| searchRouterDisplayedRef.current = true; | ||
| }, | ||
|
|
@@ -103,7 +109,7 @@ function SearchRouterContextProvider({children}: ChildrenProps) { | |
| name: CONST.TELEMETRY.SPAN_OPEN_SEARCH_ROUTER, | ||
| op: CONST.TELEMETRY.SPAN_OPEN_SEARCH_ROUTER, | ||
| attributes: { | ||
| trigger: 'keyboard', | ||
| [CONST.TELEMETRY.ATTRIBUTE_TRIGGER]: 'keyboard', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. The attribute keys ( |
||
| }, | ||
| }); | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are dots in values here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dots are intentional to visually distinguish these as diagnostic sub-spans from the top-level parent spans in Sentry's trace view. The existing parent spans use flat PascalCase (
ManualOpenReport,ManualOpenSearchRouter, etc.) while these child spans use theSearchRouter.prefix to make it immediately clear they belong to the SearchRouter flow when browsing traces. It's a common Sentry convention for hierarchical span naming. Happy to change to flat PascalCase (e.g.SearchRouterModalCloseWait) if you feel consistency with the parent span naming is more important.