Implement error logging (sentry)

1
0
-1

Hello,

right now i'm trying to implement sentry (error tracking) into my Bonita living application.
You basically have to add a html script tag on every page which is executed as early as possible.
( see https://docs.sentry.io/platforms/javascript/)

Sentry has 2 options to do this:
1) use npm/yarn
2) include the html script tag directly into the site while using a CDN and let the browser handle the download. But this has potential for errors (for example my adblocker blocks requests to download the sentry sdk when i just add a html script tag into the header)

My tried solutions:
Now i dont have that much experience in npm/yarn and node, but I created a custom Theme (myCustomTheme) in Bonita Studio (Community Edition 2021.1).Then changed my application to use this Theme. Then went into the theme directory and executed:

./node/npm install --save @sentry/browser @sentry/tracing

This installed the sentry packages into my Theme. you can now see the libraries under node_modules and in the package.json file:

"devDependencies": {
"autoprefixer": "10.0.1",
"bootstrap-sass": "3.4.1",
"node-sass": "4.14.1",
"postcss-cli": "8.0.0",
"postcss": "8.1.1",
"@sentry/browser": "^6.2.5",
"@sentry/tracing": "^6.2.5"
},
"dependencies": {}

Now i have found 2 problems:

  1. I dont find a solution to add this, already via npm installed, sentry packages to the header of each site of my custom template
  2. I fear that if i find a solution to problem 1 and the script will be loaded into each site there will still be the problem that there are some forms in my living application which are loaded via an iframe. This iframe has an own context and has maybe no sentry script loaded inside

I hope you can help me with this.
Thank you in regard!

No answers yet.
Notifications