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

chore: add first load telemetry to evaluations #33989

Merged

Conversation

rajatagrawal
Copy link
Contributor

@rajatagrawal rajatagrawal commented Jun 5, 2024

Description

This PR adds an attribute to evaluations span that tells whether the evaluation is first evaluation on page load or a subsequent one.

This attribute will help us filter evaluations and measure gains in update evaluations and first page load evaluations separately.

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/9381739425
Commit: 4cdd01d
Cypress dashboard url: Click here!

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes

    • Added a conditional check before calling endSpan to handle parentSpan in action execution.
  • Refactor

    • Updated types and interfaces related to telemetry data handling to enhance type safety and clarity.
    • Adjusted telemetry data processing to accommodate new SpanAttributes.
  • New Features

    • Introduced filtering for telemetry span data to exclude specific entries, improving data management.

Copy link
Contributor

coderabbitai bot commented Jun 5, 2024

Warning

Rate limit exceeded

@rajatagrawal has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 42 minutes and 24 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 8ca496e57a11a5249e71f3dd2938dc748842bc66 and 4cdd01d.

Walkthrough

The recent updates primarily focus on refining telemetry data handling in the application. This includes the introduction of new type aliases, adjustments to function signatures, and enhancements to telemetry processing functions. The changes emphasize improved type safety and streamlined data handling, particularly in the context of web worker telemetry. Additionally, new conditional checks and utility functions have been introduced to enhance the robustness and maintainability of the codebase.

Changes

File Path Change Summary
app/client/src/UITelemetry/generateTraces.ts Introduced type aliases OtlpSpan and SpanAttributes, refined function signatures, and removed unnecessary checks.
app/client/src/UITelemetry/generateWebWorkerTraces.ts Updated types and interfaces for telemetry data handling, including changes to attributes and spans types.
app/client/src/ce/workers/common/types.ts Updated WorkerRequest interface to allow WebworkerSpanData or SpanAttributes for webworkerTelemetry property.
app/client/src/sagas/ActionExecution/PluginActionSaga.ts Added a conditional check before calling endSpan to handle parentSpan.
app/client/src/utils/WorkerUtil.ts Modified GracefulWorkerService class to update webworkerTelemetry parameter types, introduced filterSpanData function, and adjusted telemetry data structure.
app/client/src/workers/Evaluation/handlers/evalTree.ts Updated imports and assignments related to SpanAttributes, added a debugging console.log statement.
app/client/src/workers/Evaluation/types.ts Updated EvalTreeResponseData to allow WebworkerSpanData or SpanAttributes for webworkerTelemetry property.
app/client/src/workers/common/DataTreeEvaluator/index.ts Modified setupFirstTree and setupUpdateTree methods to accept WebworkerSpanData or SpanAttributes for webworkerTelemetry parameter.

Poem

In the code where spans do dance,
Types refined, enhancing chance.
Web workers now with attributes clear,
Telemetry whispers we can hear.
Bugs and checks, they fade away,
For cleaner paths, we pave the way.
In the realm of code, we cheer,
For changes bright and future near.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jun 5, 2024
@rajatagrawal rajatagrawal force-pushed the chore/add-first-load-telemetry-to-evaluations branch from 8ca496e to f6be7a6 Compare June 5, 2024 09:23
@rajatagrawal rajatagrawal requested a review from vsvamsi1 June 5, 2024 09:25
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 326b617 and 8ca496e57a11a5249e71f3dd2938dc748842bc66.

Files selected for processing (8)
  • app/client/src/UITelemetry/generateTraces.ts (4 hunks)
  • app/client/src/UITelemetry/generateWebWorkerTraces.ts (5 hunks)
  • app/client/src/ce/workers/common/types.ts (2 hunks)
  • app/client/src/sagas/ActionExecution/PluginActionSaga.ts (1 hunks)
  • app/client/src/utils/WorkerUtil.ts (6 hunks)
  • app/client/src/workers/Evaluation/handlers/evalTree.ts (3 hunks)
  • app/client/src/workers/Evaluation/types.ts (2 hunks)
  • app/client/src/workers/common/DataTreeEvaluator/index.ts (3 hunks)
Additional comments not posted (10)
app/client/src/ce/workers/common/types.ts (1)

16-16: The update to webworkerTelemetry enhances flexibility in handling telemetry data.

#!/bin/bash
# Description: Verify integration of `webworkerTelemetry` with other components.

# Test: Search for usage of `WorkerRequest` and ensure proper handling of the new telemetry types.
rg --type typescript $'WorkerRequest'
app/client/src/UITelemetry/generateWebWorkerTraces.ts (1)

5-5: Refined telemetry handling with updated types and new filtering function.

#!/bin/bash
# Description: Verify integration of `filterSpanData` with telemetry processing.

# Test: Search for usage of `filterSpanData` and ensure it is integrated correctly.
rg --type typescript $'filterSpanData'

Also applies to: 16-16, 32-33, 45-47, 57-64

app/client/src/UITelemetry/generateTraces.ts (1)

17-18: Standardized telemetry types and updated function signatures for better trace management.

#!/bin/bash
# Description: Verify integration of `OtlpSpan` and `SpanAttributes` with telemetry functions.

# Test: Search for usage of these types in telemetry functions and ensure they are handled correctly.
rg --type typescript $'OtlpSpan|SpanAttributes'

Also applies to: 39-45, 59-60, 79-80, 83-83

app/client/src/workers/Evaluation/types.ts (1)

19-19: Updated webworkerTelemetry to accept more flexible telemetry data types, enhancing data handling in evaluation processes.

#!/bin/bash
# Description: Verify integration of `webworkerTelemetry` with evaluation processes.

# Test: Search for usage of `EvalTreeResponseData` and ensure proper handling of the new telemetry types.
rg --type typescript $'EvalTreeResponseData'

Also applies to: 63-63

app/client/src/utils/WorkerUtil.ts (1)

9-13: Enhanced worker utilities with robust telemetry handling and new functions for span management.

#!/bin/bash
# Description: Verify integration of new worker utilities with worker management processes.

# Test: Search for usage of `GracefulWorkerService` and related functions to ensure they are integrated correctly.
rg --type typescript $'GracefulWorkerService'

Also applies to: 160-183, 219-275

app/client/src/workers/Evaluation/handlers/evalTree.ts (1)

35-35: Refined telemetry handling in the evaluation tree for better data management and debugging.

#!/bin/bash
# Description: Verify integration of new telemetry handling with evaluation tree processes.

# Test: Search for usage of `evalTree` and related telemetry handling to ensure they are integrated correctly.
rg --type typescript $'evalTree'

Also applies to: 37-37, 89-90, 318-319

app/client/src/sagas/ActionExecution/PluginActionSaga.ts (1)

1665-1667: Proper handling of telemetry span in handleUpdateActionData.

The addition of endSpan to ensure that the telemetry span is closed correctly is a good practice. This aligns with the PR's objective of enhancing telemetry handling.

app/client/src/workers/common/DataTreeEvaluator/index.ts (3)

140-140: Ensure the new import SpanAttributes is utilized correctly throughout the file.


237-237: The default parameter for webworkerTelemetry now accepts SpanAttributes in addition to WebworkerSpanData. Verify that all data passed to this parameter throughout the application is compatible with these types.

#!/bin/bash
# Description: Verify compatibility of data passed to `webworkerTelemetry`.

# Test: Search for all usages of `webworkerTelemetry` and ensure compatibility.
rg --type typescript $'webworkerTelemetry'

493-493: Similar to the previous comment, ensure that the webworkerTelemetry parameter in the setupUpdateTree method is handled correctly wherever it's used.

#!/bin/bash
# Description: Verify correct handling of `webworkerTelemetry` in `setupUpdateTree`.

# Test: Search for all usages of `setupUpdateTree` and ensure correct handling.
rg --type typescript $'setupUpdateTree'

@rajatagrawal rajatagrawal force-pushed the chore/add-first-load-telemetry-to-evaluations branch from f6be7a6 to 4cdd01d Compare June 5, 2024 09:31
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Outside diff range and nitpick comments (11)
app/client/src/sagas/ActionExecution/PluginActionSaga.ts (7)

Line range hint 310-314: Consider replacing forEach with for...of for better performance.

-  blobUrlPaths.forEach((blobUrlPath) => {
+  for (const blobUrlPath of blobUrlPaths) {
     const blobUrl = value[blobUrlPath] as string;
     const resolvedBlobValue: unknown = yield call(readBlob, blobUrl);
     set(value, blobUrlPath, resolvedBlobValue);
     const blobUrlPathMap = get(value, "blobUrlPaths", {}) as Record<string, string>;
     set(blobUrlPathMap, blobUrlPath, blobUrl);
     set(value, "blobUrlPaths", blobUrlPathMap);
-  });
+  }

Line range hint 348-359: Consider replacing forEach with for...of for better performance.

-  Object.entries(blobUrlPaths as Record<string, string>).forEach(([path, blobUrl]) => {
+  for (const [path, blobUrl] of Object.entries(blobUrlPaths as Record<string, string>)) {
     if (isArrayBuffer(newVal[path])) {
       const sanitisedBlobURL = blobUrl.split("?")[0];
       blobMap.push(sanitisedBlobURL);
       set(blobDataMap, sanitisedBlobURL, new Blob([newVal[path]]));
       set(newVal, path, sanitisedBlobURL);
     }
-  });
+  }

Line range hint 457-476: Simplify computed expressions by using literal keys.

-  executeActionRequest.paramProperties[`k${index}`] = {
+  executeActionRequest.paramProperties.k${index} = {
     datatype: dataType,
   };

Line range hint 503-503: Simplify computed expressions by using literal keys.

-  executeActionRequest.paramProperties[`k${i}`] = {
+  executeActionRequest.paramProperties.k${i} = {
     datatype: { array: [arrDatatype[0]] },
   };

Line range hint 509-517: Consider replacing forEach with for...of for better performance.

-  bindingBlob?.forEach((item) => formData.append(item.name, item.value));
+  if (bindingBlob) {
+    for (const item of bindingBlob) {
+      formData.append(item.name, item.value);
+    }
+  }

Line range hint 727-727: Simplify computed expressions by using literal keys.

-  executeActionRequest.paramProperties[`k${i}`].blobIdentifiers = blobMap;
+  executeActionRequest.paramProperties.k${i}.blobIdentifiers = blobMap;

Line range hint 1047-1262: Avoid redundant double-negation for boolean coercion.

-  if (!!pluginAction.pluginId) {
+  if (pluginAction.pluginId) {
app/client/src/workers/common/DataTreeEvaluator/index.ts (4)

Line range hint 469-482: Consider replacing forEach with for...of to improve performance and readability.

- Object.keys(unEvalJSCollection).forEach((update) => {
+ for (const update of Object.keys(unEvalJSCollection)) {

Line range hint 471-471: Remove redundant double-negation for cleaner and more readable code.

- if (!!unevalTree[update]) {
+ if (unevalTree[update]) {

Line range hint 1271-1276: Avoid using return inside finally blocks as it can lead to unexpected behavior by overriding try and catch blocks.


Line range hint 1567-1567: Use optional chaining to make the code more concise and safe.

- if (fullPropertyPath && evalErrors.length) {
+ if (fullPropertyPath?.length && evalErrors.length) {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8ca496e57a11a5249e71f3dd2938dc748842bc66 and f6be7a61dfd23f4abc4a8fecd0ff319c879c2170.

Files selected for processing (8)
  • app/client/src/UITelemetry/generateTraces.ts (4 hunks)
  • app/client/src/UITelemetry/generateWebWorkerTraces.ts (5 hunks)
  • app/client/src/ce/workers/common/types.ts (2 hunks)
  • app/client/src/sagas/ActionExecution/PluginActionSaga.ts (1 hunks)
  • app/client/src/utils/WorkerUtil.ts (6 hunks)
  • app/client/src/workers/Evaluation/handlers/evalTree.ts (2 hunks)
  • app/client/src/workers/Evaluation/types.ts (2 hunks)
  • app/client/src/workers/common/DataTreeEvaluator/index.ts (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • app/client/src/UITelemetry/generateTraces.ts
  • app/client/src/ce/workers/common/types.ts
  • app/client/src/workers/Evaluation/types.ts
Additional context used
Biome
app/client/src/UITelemetry/generateWebWorkerTraces.ts

[error] 49-55: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

app/client/src/utils/WorkerUtil.ts

[error] 181-181: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.

app/client/src/workers/Evaluation/handlers/evalTree.ts

[error] 50-50: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 89-89: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 314-314: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.

app/client/src/sagas/ActionExecution/PluginActionSaga.ts

[error] 310-314: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 348-359: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 457-457: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 459-459: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 460-460: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 461-461: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 473-473: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 474-474: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 475-475: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 476-476: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 503-503: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 509-509: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 515-517: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 727-727: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 1047-1047: Avoid redundant double-negation. (lint/complexity/noExtraBooleanCast)

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation


[error] 1136-1136: Avoid redundant double-negation. (lint/complexity/noExtraBooleanCast)

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation


[error] 1241-1241: Avoid redundant double-negation. (lint/complexity/noExtraBooleanCast)

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation


[error] 1262-1262: Avoid redundant double-negation. (lint/complexity/noExtraBooleanCast)

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation


[error] 1451-1451: Avoid redundant double-negation. (lint/complexity/noExtraBooleanCast)

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

app/client/src/workers/common/DataTreeEvaluator/index.ts

[error] 469-482: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 471-471: Avoid redundant double-negation. (lint/complexity/noExtraBooleanCast)

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation


[error] 472-480: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 785-787: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 932-938: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 947-953: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 971-978: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 987-995: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 1271-1276: Unsafe usage of 'return'. (lint/correctness/noUnsafeFinally)

'return' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.


[error] 1567-1567: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.


[error] 1668-1681: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 1672-1673: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.

Additional comments not posted (2)
app/client/src/workers/common/DataTreeEvaluator/index.ts (2)

140-140: Ensure the new import of SpanAttributes is utilized effectively in the file.


493-493: The addition of webworkerTelemetry and affectedJSObjects parameters to setupUpdateTree method enhances telemetry and provides better handling of affected JavaScript objects. Ensure that all calls to this method across the codebase are updated to pass these new parameters.

Verification successful

The search results indicate multiple instances of setupUpdateTree across various files. To ensure that all calls to this method are updated to include the new parameters webworkerTelemetry and affectedJSObjects, we need to inspect these instances.

Let's generate a script to extract the lines where setupUpdateTree is called, so we can verify if the new parameters are being passed.


The extracted lines show multiple instances of setupUpdateTree being called. However, to verify if the new parameters webworkerTelemetry and affectedJSObjects are being passed, we need to inspect these calls more closely.

Let's generate a script to extract the full lines where setupUpdateTree is called, so we can verify if the new parameters are included.


The output shows multiple instances of setupUpdateTree calls, but it doesn't provide the full context needed to verify if the new parameters are being passed. To ensure all calls are updated correctly, we need to extract the surrounding lines for each instance.

Let's generate a script to extract a few lines before and after each setupUpdateTree call to get the full context.


The extracted lines provide sufficient context to verify that the setupUpdateTree method calls have been updated to include the new parameters webworkerTelemetry and affectedJSObjects.

Here are the key observations:

  • The setupUpdateTree method calls in index.ts and evalTree.ts include the webworkerTelemetry parameter.
  • The test files (test.ts, evaluation.test.ts) also show calls to setupUpdateTree with the new parameters.

Based on this information, it appears that the necessary updates have been made to include the new parameters in the setupUpdateTree method calls.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all function calls to `setupUpdateTree` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python $'setupUpdateTree'

Length of output: 65



Script:

#!/bin/bash
# Description: Verify all function calls to `setupUpdateTree` match the new signature.

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new signature.
rg --type typescript 'setupUpdateTree'

Length of output: 73



Script:

#!/bin/bash
# Description: Verify all function calls to `setupUpdateTree` match the new signature.

# Test: Search for the function usage in all files. Expect: Only occurrences of the new signature.
rg 'setupUpdateTree'

Length of output: 4758



Script:

#!/bin/bash
# Description: Extract lines where `setupUpdateTree` is called to verify the new parameters.

# Extract lines with `setupUpdateTree` calls
rg 'setupUpdateTree' -A 1 -B 1

Length of output: 11035



Script:

#!/bin/bash
# Description: Extract full lines where `setupUpdateTree` is called to verify the new parameters.

# Extract full lines with `setupUpdateTree` calls
rg 'setupUpdateTree' -o -N

Length of output: 3144



Script:

#!/bin/bash
# Description: Extract surrounding lines where `setupUpdateTree` is called to verify the new parameters.

# Extract surrounding lines with `setupUpdateTree` calls
rg 'setupUpdateTree' -A 3 -B 3

Length of output: 21968

@rajatagrawal rajatagrawal added the ok-to-test Required label for CI label Jun 5, 2024
@rajatagrawal rajatagrawal self-assigned this Jun 5, 2024
Comment on lines +61 to +63
return Object.keys(spanData)
.filter((key) => !key.startsWith("__"))
.reduce<Record<string, WebworkerSpanData>>((obj, key) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

What are we performing this filter operation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Webworker is sending sub span evaluation data and attributes for the root span in the same object. The attributes start with __. This piece of code returns sub span evaluation data to be processed as spans

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay got it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please approve the PR if the changes look good ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure

@vsvamsi1
Copy link
Contributor

vsvamsi1 commented Jun 7, 2024

LGTM

@vsvamsi1 vsvamsi1 self-requested a review June 7, 2024 13:06
@rajatagrawal rajatagrawal merged commit cf18829 into release Jun 7, 2024
45 checks passed
@rajatagrawal rajatagrawal deleted the chore/add-first-load-telemetry-to-evaluations branch June 7, 2024 13:08
Copy link

sentry-io bot commented Jun 10, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot convert undefined or null to object Function.entries(<anonymous>) View Issue
  • ‼️ TypeError: Cannot convert undefined or null to object Function.entries(<anonymous>) View Issue
  • ‼️ TypeError: Cannot convert undefined or null to object Function.entries(<anonymous>) View Issue
  • ‼️ TypeError: Cannot convert undefined or null to object Function.entries(<anonymous>) View Issue
  • ‼️ TypeError: Cannot read properties of null (reading 'webworkerTelemetry') call(utils/WorkerUtil) View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants