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: added sentry alert for dashboard when query_range not called #6791

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

SagarRajput-7
Copy link
Contributor

@SagarRajput-7 SagarRajput-7 commented Jan 9, 2025

Summary

Related Issues / PR's

Screenshots

image

Affected Areas and Manually Tested Areas


Important

Adds Sentry alert for uncalled query_range in dashboards and manages state with dashboardQueryRangeCalled.

  • Behavior:
    • Adds Sentry alert in GraphLayout to notify if query_range is not called within 2 minutes when widgets are present.
    • Sets dashboardQueryRangeCalled to true in GridCardGraph on query error or settlement.
  • State Management:
    • Adds dashboardQueryRangeCalled and setDashboardQueryRangeCalled to DashboardProvider context and IDashboardContext in types.ts.
  • Misc:
    • Imports Sentry in GridCardLayout.tsx.

This description was created by Ellipsis for 2a04da4. It will automatically update as commits are pushed.

@SagarRajput-7 SagarRajput-7 requested a review from YounixM as a code owner January 9, 2025 18:53
Copy link

github-actions bot commented Jan 9, 2025

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added the chore label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 in 4 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 both onError and onSettled callbacks. This is redundant since both are executed sequentially on error. Consider calling it once after useGetQueryRange.
  • 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:
    Setting setDashboardQueryRangeCalled(false) on mount might be redundant if the initial state is already false. Consider removing it to avoid unnecessary re-renders.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The useEffect hook in GraphLayout is setting setDashboardQueryRangeCalled(false) on mount. This might not be necessary if the state is already initialized to false in the provider. It could lead to unnecessary re-renders.
3. frontend/src/providers/Dashboard/Dashboard.tsx:92
  • Draft comment:
    Ensure setDashboardQueryRangeCalled is used consistently to track query range calls. It should be set to true 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 the component/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.

@SagarRajput-7 SagarRajput-7 merged commit d6bfd95 into main Jan 9, 2025
15 of 16 checks passed
@SagarRajput-7 SagarRajput-7 deleted the dahboard-sentry-alert branch January 9, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants