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

Feature: Error tracking #2862

Merged
merged 7 commits into from
Oct 2, 2023
Merged

Feature: Error tracking #2862

merged 7 commits into from
Oct 2, 2023

Conversation

Pezmc
Copy link
Contributor

@Pezmc Pezmc commented Oct 2, 2023

Description

This PR implements tracking of errors and reporting of them to a third party tool https://sentry.io/, which was selected based on conversations with other developers and a brief review of the products in the market (including BugSnag, Rollbar, and Bugfender) including their costs.

This is an experiment while we have a free trial, and may be removed later. Error tracking is only enabled if config.telemetry.frontend.sentry or config.telemetry.backend.sentry are configured, following the precedent for PostHog.

This PR includes:

  • Client side error tracking
  • Server side error tracking
  • Build time tracking and sourcemap uploads

As a follow up:

  • config.telemetry.frontend.sentry and config.telemetry.backend.sentry will need to be configured on staging (and then production)
  • The env vars in .env need to be configured as part of our build pipeline

Related Issue(s)

OKRs for engineering team

Checklist

  • I have read the contribution guidelines
  • [-] Suitable unit/system level tests have been added and they pass - N/A
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml - Needs to be completed
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

@Pezmc Pezmc requested a review from knolleary October 2, 2023 11:01
function getPath (file) {
return path.resolve(__dirname, '..', file)
}

module.exports = {
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 is much easier to see the changes (it's now wrapped in a function) using ?w=1

init,
vueRouterInstrumentation

} from '@sentry/vue'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, this would be loaded async so it's not required if sentry is not enabled (so there's no bundle size impact), unfortunately, Sentry needs to init before Vue for the hooks to work properly.

If we keep sentry around, we can look into including the SDK as part of the injected code in forge/routes/ui/index.js

docs/admin/telemetry.md Outdated Show resolved Hide resolved
@knolleary knolleary merged commit 3784d6a into main Oct 2, 2023
4 checks passed
@knolleary knolleary deleted the chore-sentry-reporting branch October 2, 2023 14:57
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