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

Realtime tracking of javascript bugs and errors #68

Closed
Raruto opened this issue Jul 15, 2022 · 3 comments · Fixed by #313
Closed

Realtime tracking of javascript bugs and errors #68

Raruto opened this issue Jul 15, 2022 · 3 comments · Fixed by #313
Assignees
Labels
tests Edit or add tests
Milestone

Comments

@Raruto
Copy link
Collaborator

Raruto commented Jul 15, 2022

At least for the public demo application it might be worth introducing a tracking script that can promptly report javascript errors to the development team, for example: sentry.io.

latter it could be added to customer applications but first it would be necessary to create a more compliant privacy and cookie policy.

@wlorenzetti
Copy link
Member

@Raruto this thing could be nice. G3W-ADMIN had previously used for Django and Python Sentry https://github.com/g3w-suite/g3w-admin/blob/07ba465011bb0ef95393b4d31255996fbec55e11/g3w-admin/base/settings/__init__.py#L39, now it could be time to reactivate it and update it to the latest version of sentry-sdk. We already have an account.

@wlorenzetti
Copy link
Member

At least for the demo version .. for customers we will see, perhaps for those who are hosted by us.

@Raruto Raruto added feature New feature or request help wanted Extra attention is needed labels Jul 26, 2022
@Raruto Raruto added this to the v3.7 milestone Jul 29, 2022
@Raruto Raruto added needs discussion This issue or pull requires further discussion by the dev team tests Edit or add tests and removed feature New feature or request help wanted Extra attention is needed labels Aug 5, 2022
Raruto added a commit that referenced this issue Aug 12, 2022
a partial refactor is actually needed (or at least suggested) before complete #68

based on #35
@Raruto Raruto self-assigned this Aug 18, 2022
@Raruto
Copy link
Collaborator Author

Raruto commented Jan 10, 2023

Sentry can be installed via various JS bundles, for example here is the official documentatiotn on How to setup Vue and Sentry integration.

But anyway (as per g3w-client v3.7) there seems to be some sort of incompatibility with the current code structure and the use of Sentry as a javascript module.

However, the fastest way to do some testing is to include sentry via cdn (ref: https://docs.sentry.io/platforms/javascript/install/)


g3w-admin/client/templates/client/index.html

<body class="hold-transition skin-{{ skin_class|default:'blue' }} fixed {% if sidebar_collapse %} sidebar-collapse {% endif %}" >

  <script src="https://browser.sentry-cdn.com/7.9.0/bundle.tracing.min.js" integrity="sha384-a80B6QRSQ+pPpoX+H79BVaE52KTvYkQDL+lD8+TajwMxswO+ywB3p99gWNraTNrt" crossorigin="anonymous"></script>
  <script>
    if (Sentry) {
      Sentry.init({
        dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
        // Alternatively, use `process.env.npm_package_version` for a dynamic release version if your build tool supports it.
        release: "g3w-client@3.5-dev",
        integrations: [new Sentry.BrowserTracing()],

        // Set tracesSampleRate to 1.0 to capture 100%
        // of transactions for performance monitoring.
        // We recommend adjusting this value in production
        tracesSampleRate: 1.0,
      });
    }
  </script>

  <div id="app">
    <app></app>
  </div>

...

  <script>
    myUndefinedFunction(); // intentionally trigger a javascript error, login into your https://sentry.io/ account for viewing the trace log
  </script>

...

@Raruto Raruto modified the milestones: v3.7, v3.9 Jan 11, 2023
@Raruto Raruto modified the milestones: v3.9, v3.8 Jan 25, 2023
@Raruto Raruto removed the needs discussion This issue or pull requires further discussion by the dev team label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Edit or add tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants