-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
chore: Add newrelic tracking spans to AppViewer engine and AppEditor engine #34716
base: release
Are you sure you want to change the base?
Conversation
WalkthroughThe changes integrate OpenTelemetry to enhance tracing in the app's engine, focusing on performance tracking and telemetry. The updates introduce Changes
Sequence Diagram(s)sequenceDiagram
participant UI as User Interface
participant SAGA as InitSagas
participant AE as AppEngine
participant TEL as UITelemetry
UI ->> SAGA: Dispatch startAppEngine
SAGA ->> TEL: startRootSpan("App Engine Start", {...})
activate TEL
TEL -->> SAGA: rootSpan
SAGA ->> AE: setupEngine(payload, rootSpan)
activate AE
AE ->> TEL: startNestedSpan("Engine Setup", rootSpan)
activate TEL
TEL -->> AE: span
AE ->> AE: Perform setup
AE ->> TEL: endSpan(span)
deactivate TEL
AE ->> AE: loadAppData(payload, rootSpan)
AE ->> TEL: startNestedSpan("Load App Data", rootSpan)
activate TEL
TEL -->> AE: span
AE ->> AE: Perform data load
AE ->> TEL: endSpan(span)
deactivate TEL
AE ->> TEL: endSpan(rootSpan)
deactivate TEL
AE ->> SAGA: Setup complete
deactivate AE
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9792055839. |
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- app/client/src/UITelemetry/generateTraces.ts (1 hunks)
- app/client/src/entities/Engine/AppEditorEngine.ts (8 hunks)
- app/client/src/entities/Engine/AppViewerEngine.ts (4 hunks)
- app/client/src/entities/Engine/index.ts (5 hunks)
- app/client/src/sagas/ActionExecution/PluginActionSaga.ts (3 hunks)
- app/client/src/sagas/InitSagas.ts (2 hunks)
Additional context used
Biome
app/client/src/entities/Engine/index.ts
[error] 132-132: This default parameter should follow the last required parameter or should be a required parameter.
The last required parameter is here:
A default parameter that precedes a required parameter cannot be omitted at call site.
Unsafe fix: Turn the parameter into a required parameter.(lint/style/useDefaultParameterLast)
Additional comments not posted (24)
app/client/src/UITelemetry/generateTraces.ts (2)
79-80
: LGTM!The
endSpan
function correctly handles the optionalspan
parameter using optional chaining.
84-87
: LGTM!The
setAttributesToSpan
function correctly handles the optionalspan
parameter using optional chaining.app/client/src/entities/Engine/index.ts (2)
34-41
: LGTM!The changes to the
IAppEngine
interface align with the PR objective to add New Relic tracking spans to all function calls within the AppViewer and AppEditor engines.
64-66
: LGTM!The changes to the
AppEngine
abstract class align with the PR objective to add New Relic tracking spans to all function calls within the AppViewer and AppEditor engines.Also applies to: 69-75
app/client/src/entities/Engine/AppViewerEngine.ts (6)
54-66
: LGTM!The changes to the
completeChore
method align with the PR objective to add New Relic tracking spans to all function calls within the AppViewer engine.
69-77
: LGTM!The changes to the
setupEngine
method align with the PR objective to add New Relic tracking spans to all function calls within the AppViewer engine.
Line range hint
96-175
:
LGTM!The changes to the
loadAppEntities
method align with the PR objective to add New Relic tracking spans to all function calls within the AppViewer engine.
152-158
: LGTM!The addition of the
waitForFetchUserSuccess
span aligns with the PR objective to add New Relic tracking spans to all function calls within the AppViewer engine.
159-165
: LGTM!The addition of the
waitForSegmentInit
span aligns with the PR objective to add New Relic tracking spans to all function calls within the AppViewer engine.
166-172
: LGTM!The addition of the
waitForFetchEnvironments
span aligns with the PR objective to add New Relic tracking spans to all function calls within the AppViewer engine.app/client/src/entities/Engine/AppEditorEngine.ts (6)
92-102
: LGTM!The changes to the
setupEngine
method align with the PR objective to add New Relic tracking spans to all function calls within the AppEditor engine.
Line range hint
121-197
:
LGTM!The changes to the
loadPageThemesAndActions
method align with the PR objective to add New Relic tracking spans to all function calls within the AppEditor engine.
Line range hint
200-241
:
LGTM!The changes to the
loadPluginsAndDatasources
method align with the PR objective to add New Relic tracking spans to all function calls within the AppEditor engine.
252-261
: LGTM!The changes to the
loadAppEntities
method align with the PR objective to add New Relic tracking spans to all function calls within the AppEditor engine.
Line range hint
264-327
:
LGTM!The changes to the
completeChore
method align with the PR objective to add New Relic tracking spans to all function calls within the AppEditor engine.
Line range hint
330-349
:
LGTM!The changes to the
loadGit
method align with the PR objective to add New Relic tracking spans to all function calls within the AppEditor engine.app/client/src/sagas/InitSagas.ts (3)
88-92
: LGTM!The new imports for New Relic tracking spans are appropriate.
292-297
: LGTM!The addition of the root span and nested spans in the
startAppEngine
function is correct and enhances monitoring and performance tracking.Also applies to: 305-306, 307-310, 315-317, 324-325, 331-331, 339-339, 341-342, 350-351
Line range hint
1290-1291
:
LGTM!The use of
startRootSpan
andsetAttributesToSpan
in theexecutePageLoadActionsSaga
function is appropriate and improves performance tracking.app/client/src/sagas/ActionExecution/PluginActionSaga.ts (5)
Line range hint
105-107
:
LGTM!The new imports for New Relic tracking spans are appropriate.
543-547
: LGTM!The addition of the root span and setting attributes in the
executePluginActionTriggerSaga
function enhances monitoring and performance tracking.
Line range hint
1061-1061
:
LGTM!The addition of the root span in the
runActionSaga
function is correct and enhances monitoring and performance tracking.
1290-1290
: LGTM!The addition of the root span and setting attributes in the
executePageLoadActionsSaga
function enhances monitoring and performance tracking.
1347-1352
: LGTM!The addition of setting attributes to the parent span in the
executePluginActionSaga
function enhances monitoring and performance tracking.
} | ||
|
||
*loadAppURL(pageId: string, pageIdInUrl?: string) { | ||
*loadAppURL(pageId: string, pageIdInUrl: string = "", rootSpan: Span) { |
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.
Address the default parameter issue.
The default parameter should follow the last required parameter.
- *loadAppURL(pageId: string, pageIdInUrl: string = "", rootSpan: Span) {
+ *loadAppURL(pageId: string, rootSpan: Span, pageIdInUrl: string = "") {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
*loadAppURL(pageId: string, pageIdInUrl: string = "", rootSpan: Span) { | |
*loadAppURL(pageId: string, rootSpan: Span, pageIdInUrl: string = "") { |
Tools
Biome
[error] 132-132: This default parameter should follow the last required parameter or should be a required parameter.
The last required parameter is here:
A default parameter that precedes a required parameter cannot be omitted at call site.
Unsafe fix: Turn the parameter into a required parameter.(lint/style/useDefaultParameterLast)
Deploy-Preview-URL: https://ce-34716.dp.appsmith.com |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- app/client/src/entities/Engine/index.ts (5 hunks)
- app/client/src/sagas/InitSagas.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- app/client/src/entities/Engine/index.ts
- app/client/src/sagas/InitSagas.ts
const loadAppUrlSpan = startNestedSpan("AppEngine.loadAppURL", rootSpan); | ||
|
||
if (!this._urlRedirect) return; | ||
const newURL: string = yield call( | ||
this._urlRedirect.generateRedirectURL.bind(this), | ||
pageId, | ||
pageIdInUrl, | ||
); | ||
|
||
endSpan(loadAppUrlSpan); | ||
|
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.
Is this necessary, no blocking or expensive code 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.
yeah that's true, I just added them to all components.
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.
Also i think the start span should be after the return statement in line 144, so that we don't have an incomplete span.
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.
loadAppData set the value of _urlRedirect
and it is called before loadAppURL
in initSagas. This block is present for just type safety.
But yeah I agree, we should avoid any case where there are spans that don't end.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- app/client/src/entities/Engine/index.ts (5 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/client/src/entities/Engine/index.ts
Description
Add new relic tracking spans to all fn calls in Appviewer and AppEditor engine.
Fixes #
Issue Number
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9806332006
Commit: 39dedf6
Cypress dashboard.
Tags:
@tag.Sanity
Fri, 05 Jul 2024 10:05:46 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit