-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: added sentry alert for dashboard when query_range not called #6791
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Reviewed everything up to 2a04da4 in 2 minutes and 11 seconds
More details
- Looked at
126
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/container/GridCardLayout/GridCard/index.tsx:206
- Draft comment:
setDashboardQueryRangeCalled(true);
is called in bothonError
andonSettled
callbacks. This is redundant since both are executed sequentially on error. Consider calling it once afteruseGetQueryRange
. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is technically correct - there is redundant code. However, calling setState twice with the same value in React is not a serious performance issue as React batches state updates. The code would be slightly cleaner with a single call, but this is a minor optimization at best. The comment doesn't point out any actual bugs or serious issues.
The redundant call could potentially indicate confusion about the React Query lifecycle hooks. Maybe there's a reason the author wanted explicit handling in both places?
While there could be a reason, the onSettled callback is specifically designed to handle both success and error cases, making the separate onError call redundant by definition.
While technically correct, this comment points out a very minor code cleanup that doesn't impact functionality. According to our rules about not making obvious or unimportant comments, this should be removed.
2. frontend/src/container/GridCardLayout/GridCardLayout.tsx:131
- Draft comment:
SettingsetDashboardQueryRangeCalled(false)
on mount might be redundant if the initial state is alreadyfalse
. Consider removing it to avoid unnecessary re-renders. - Reason this comment was not posted:
Confidence changes required:50%
TheuseEffect
hook inGraphLayout
is settingsetDashboardQueryRangeCalled(false)
on mount. This might not be necessary if the state is already initialized tofalse
in the provider. It could lead to unnecessary re-renders.
3. frontend/src/providers/Dashboard/Dashboard.tsx:92
- Draft comment:
EnsuresetDashboardQueryRangeCalled
is used consistently to track query range calls. It should be set totrue
when a query range is successfully called. - Reason this comment was not posted:
Comment did not seem useful.
4. frontend/src/container/GridCardLayout/GridCard/index.tsx:44
- Draft comment:
Avoid using thecomponent/index.tsx
file structure. It makes it difficult to debug and find components using global search tools. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_YSSM81xkQvg07FEz
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Summary
Related Issues / PR's
Screenshots
Affected Areas and Manually Tested Areas
Important
Adds Sentry alert for uncalled
query_range
in dashboards and manages state withdashboardQueryRangeCalled
.GraphLayout
to notify ifquery_range
is not called within 2 minutes when widgets are present.dashboardQueryRangeCalled
totrue
inGridCardGraph
on query error or settlement.dashboardQueryRangeCalled
andsetDashboardQueryRangeCalled
toDashboardProvider
context andIDashboardContext
intypes.ts
.GridCardLayout.tsx
.This description was created by for 2a04da4. It will automatically update as commits are pushed.