-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feat: Added analytics for pulse failure #37781
Conversation
WalkthroughThe changes in this pull request involve the addition of new string literals to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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
🧹 Outside diff range and nitpick comments (2)
app/client/src/usagePulse/utils.ts (2)
43-48
: Consider including error details in analyticsWhile the analytics capture identifies the failure occurrence, adding error details would help with debugging.
} else { // add analytics for failed usage pulse AnalyticsUtil.logEvent("MALFORMED_USAGE_PULSE", { anonymousUserId, instanceId, + error: res.statusText, + status: res.status }); }
Line range hint
12-17
: Technical Debt: Consider addressing TODOs and type safety
- The function could return a Promise for better control flow
- The
url
parameter should have a specific type instead ofany
Would you like me to propose a typed implementation that returns a Promise?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
app/client/src/ce/utils/analyticsUtilTypes.ts
(1 hunks)app/client/src/usagePulse/utils.ts
(3 hunks)
🔇 Additional comments (4)
app/client/src/usagePulse/utils.ts (2)
9-9
: LGTM: Import addition is clean and well-placed
20-22
: LGTM: Variable initialization is well-placed
The variables are correctly initialized before usage and maintain proper scope.
✅ Verification successful
Variables are correctly initialized and used
Based on the search results, the variables instanceId
and anonymousUserId
are properly initialized and used in the fetch request's payload. They are not duplicated in the existing payload structure and are essential for the analytics tracking functionality.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Verify that these identifiers aren't already available in the payload
ast-grep --pattern 'payload: Record<string, unknown>' -A 10
Length of output: 61
Script:
#!/bin/bash
# Search for usage of instanceId and anonymousUserId in the file
rg -A 5 "instanceId|anonymousUserId" "app/client/src/usagePulse/utils.ts"
# Look for the function definition containing these variables
ast-grep --pattern 'function $_($$$) {
$$$
const instanceId = getInstanceId($$$)
const anonymousUserId = AnalyticsUtil.getAnonymousId()
$$$
}'
Length of output: 786
Script:
#!/bin/bash
# Check the payload construction to verify if these IDs are already included
ast-grep --pattern 'function getPayload($$$) {
$$$
}'
Length of output: 57
app/client/src/ce/utils/analyticsUtilTypes.ts (2)
355-355
: LGTM: MALFORMED_USAGE_PULSE event addition
The new analytics event aligns with the PR objective of tracking pulse failures.
354-354
: Verify the relevance of CANVAS_HOVER event
The addition of "CANVAS_HOVER" event appears unrelated to the PR's objective of adding pulse failure analytics.
/build-deploy-preview skip-test=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12049255639. |
Deploy-Preview-URL: https://ce-37781.dp.appsmith.com |
Description
Tip
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).
Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.
Fixes https://github.com/appsmithorg/appsmith-ee/issues/5606
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/12049087739
Commit: 18929d4
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Wed, 27 Nov 2024 11:51:54 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
fetchWithRetry
function, capturing additional context during failures.Bug Fixes