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

Feat/UI error observability #6169

Merged
merged 9 commits into from
Feb 9, 2024
Merged

Conversation

FredrikOseberg
Copy link
Contributor

@FredrikOseberg FredrikOseberg commented Feb 8, 2024

This PR adds an endpoint to Unleash that accepts an error message and option error stack and logs it as an error. This allows us to leverage errors in logs observability to catch UI errors consistently.

Considered a test, but this endpoint only accepts and logs input, so I'm not sure how useful it would be.

Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 9, 2024 0:07am
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 9, 2024 0:07am

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

<QueryParamProvider adapter={ReactRouter6Adapter}>
<ThemeProvider>
<AnnouncerProvider>
<ErrorBoundary
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This error boundary is higher up than the one in App.tsx and is identical

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):


window.global ||= window;

ReactDOM.render(
<UIProviderContainer>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move this into a component to use a hook to get the recordError call to leverage automatic basepath

@@ -51,66 +49,64 @@ export const App = () => {
}, [authDetails, user]);

return (
<ErrorBoundary FallbackComponent={LayoutError}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have this ErrorBoundary further up in the tree, removed it from here.

}
/>
))}
<SWRProvider>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Result of removing the outermost component layer, nothing really changed here except removing the error boundary

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

Copy link
Contributor

@gardleopard gardleopard left a comment

Choose a reason for hiding this comment

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

  1. LGTM

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

Comment on lines +167 to +171

this.app.use(
'/record-ui-error',
new UiObservabilityController(config, services).router,
);

Choose a reason for hiding this comment

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

❌ Getting worse: Large Method
AdminApi.constructor increases from 121 to 125 lines of code, threshold = 70

Why does this problem occur?

Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function. Read more.

To ignore this warning click here.

@FredrikOseberg FredrikOseberg deleted the feat/ui-error-observability branch February 9, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants