From 1164d62d535f8160f7390dca40b591877ec3fbc0 Mon Sep 17 00:00:00 2001 From: Matheus Marsiglio Date: Fri, 29 Nov 2024 19:36:42 -0300 Subject: [PATCH] chore(sentry) add sentry to webapp --- .github/workflows/release.yml | 10 + Makefile | 3 + package-lock.json | 6 + webapp/package-lock.json | 299 ++++++++++++++++--------- webapp/package.json | 3 +- webapp/shadow-cljs.edn | 2 +- webapp/src/webapp/app.cljs | 11 + webapp/src/webapp/config.cljs | 3 + webapp/src/webapp/env.cljs | 2 + webapp/src/webapp/guardrails/main.cljs | 1 - 10 files changed, 234 insertions(+), 106 deletions(-) create mode 100644 package-lock.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0dd4a3d5..c19c3458 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,6 +55,9 @@ jobs: - name: Set Git Tag run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Set webapp version + run: export WEBAPP_VERSION=$(awk -F"'" '{printf "%s", $2}' webapp/src/webapp/version.js) + - name: amd64 env: GIT_TAG: ${{ env.GIT_TAG }} @@ -560,3 +563,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GIT_TAG: ${{ env.GIT_TAG }} + + - name: Publish Sentry Sourcemaps + uses: matbour/setup-sentry-cli@v2 + env: + WEBAPP_VERSION: ${{ env.WEBAPP_VERSION }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + run: make publish-sentry-sourcemaps diff --git a/Makefile b/Makefile index f536431a..a2fa5a03 100644 --- a/Makefile +++ b/Makefile @@ -118,4 +118,7 @@ release-aws-cf-templates: aws s3 cp --region ap-southeast-2 ${DIST_FOLDER}/hoopdev-platform.template.yaml s3://hoopdev-platform-cf-ap-southeast-2/${VERSION}/hoopdev-platform.template.yaml aws s3 cp --region ap-southeast-2 ${DIST_FOLDER}/hoopdev-platform.template.yaml s3://hoopdev-platform-cf-ap-southeast-2/latest/hoopdev-platform.template.yaml +publish-sentry-sourcemaps: + sentry-cli sourcemaps upload --release=${WEBAPP_VERSION} /webapp/resources/public/js/app.js.map + .PHONY: run-dev run-dev-postgres test-enterprise test-oss test generate-openapi-docs build build-dev-client build-webapp build-helm-chart build-gateway-bundle extract-webapp publish release release-aws-cf-templates swag-fmt diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..0c99d249 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "hoop", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 2fbebeec..533672f1 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -1,12 +1,12 @@ { "name": "webapp", - "version": "1.32.1", + "version": "1.32.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "webapp", - "version": "1.32.1", + "version": "1.32.2", "dependencies": { "@codemirror/commands": "^6.3.2", "@codemirror/lang-javascript": "^6.2.1", @@ -21,8 +21,7 @@ "@radix-ui/react-icons": "^1.3.0", "@radix-ui/themes": "^3.1.3", "@segment/analytics-next": "^1.64.0", - "@sentry/browser": "7.12.0", - "@sentry/tracing": "7.12.0", + "@sentry/browser": "8.41.0", "@uiw/codemirror-theme-dracula": "^4.21.21", "@uiw/codemirror-theme-github": "^4.21.21", "@uiw/codemirror-theme-nord": "^4.21.21", @@ -2520,79 +2519,141 @@ "tsub": "dist/index.js" } }, - "node_modules/@sentry/browser": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.12.0.tgz", - "integrity": "sha512-VoqZj3wJm5aUIDG+7LjeSHIw9/pujrUlA1QMu2YOY3LaP6UQsAAsOSo52brnaQQcwBrRySksaaaTxg6obJwInw==", + "node_modules/@sentry-internal/browser-utils": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.41.0.tgz", + "integrity": "sha512-nU7Bn3jEUmf1QXRUT3j2ewUBlFJpe9vnAnjqpeVPDWTsVI52BwVNcJHuE37PrGs66OZ1ZkGMfKnQk43oCAa+oQ==", + "license": "MIT", "dependencies": { - "@sentry/core": "7.12.0", - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/core": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.12.0.tgz", - "integrity": "sha512-ERkeB/XdThvdSVZH4XysMPyWRG653HDq0AkJh8SgapExCZbwgj1lutCIpT1LIbZ8lUhRx5P+ua9OR2qj+vo5RA==", + "node_modules/@sentry-internal/browser-utils/node_modules/@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", + "license": "MIT", + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry-internal/feedback": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.41.0.tgz", + "integrity": "sha512-bw+BrSNw8abOnu/IpD8YSbYubXkkT8jyNS7TM4e4UPZMuXcbtia7/r5d7kAiUfKv/sV5PNMlZLOk+EYJeLTANg==", + "license": "MIT", "dependencies": { - "@sentry/hub": "7.12.0", - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" + } + }, + "node_modules/@sentry-internal/feedback/node_modules/@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", + "license": "MIT", + "engines": { + "node": ">=14.18" } }, - "node_modules/@sentry/hub": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-7.12.0.tgz", - "integrity": "sha512-UgpC9WiHQAfcoEIIgeIopp3jeabllK6beLl5vA4ei6ay2TDMjA4NqUpzGq/GWVG0ewnblvHkqmjwAls2AEMtWg==", + "node_modules/@sentry-internal/replay": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.41.0.tgz", + "integrity": "sha512-ByXEY7JI95y4Qr9fS3d28l9uuVU5Qa0HgL+xDmYElNx7CXz3Q9hFN6ibgUeC3h8BO5pDULxWNgAppl7FRY8N5w==", + "license": "MIT", "dependencies": { - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry-internal/browser-utils": "8.41.0", + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/tracing": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.12.0.tgz", - "integrity": "sha512-TK30G/g15KplKOPncu61XvNLjaI+Kbe64UBTSTANMkidlEjiZ8N0P8L9AqUG+rUIk7YbIu11DS6edGY/LK0WEQ==", + "node_modules/@sentry-internal/replay-canvas": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.41.0.tgz", + "integrity": "sha512-lpgOBHWr1ZNxidD72A2pfoUMjIpwonOPYoQZWAHr86Oa3eIVQOyfklZlHW+gKPFl2/IEl9Lbtcke0JiDp3dkIQ==", + "license": "MIT", "dependencies": { - "@sentry/hub": "7.12.0", - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry-internal/replay": "8.41.0", + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.12.0.tgz", - "integrity": "sha512-ldcuRzEx2ccZvaJjTSemWj+7TiWCV5A/vV7fEtZeoETFI+SiVbmqI5whdH7ZVVfhRNFf25Ib+TfTeaM9PM7A1A==", + "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=14.18" + } + }, + "node_modules/@sentry-internal/replay/node_modules/@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", + "license": "MIT", + "engines": { + "node": ">=14.18" } }, - "node_modules/@sentry/utils": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.12.0.tgz", - "integrity": "sha512-GVB8E0V3RJHQClvi0gsRRJvDXP5c7M5ByYAvspJDczOOxNF8LTjTYVkBXAUdR9kcs+nya1q1YVsKvde2WGORTA==", + "node_modules/@sentry/browser": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.41.0.tgz", + "integrity": "sha512-FfAU55eYwW2lG4M3dEw2472RvHrD5YWSfHCZvuRf/4skX38kFvKghZQ+epL+CVHTzvIRHOrbj8qQK6YLTGl9ew==", + "license": "MIT", "dependencies": { - "@sentry/types": "7.12.0", - "tslib": "^1.9.3" + "@sentry-internal/browser-utils": "8.41.0", + "@sentry-internal/feedback": "8.41.0", + "@sentry-internal/replay": "8.41.0", + "@sentry-internal/replay-canvas": "8.41.0", + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" + } + }, + "node_modules/@sentry/browser/node_modules/@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", + "license": "MIT", + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/core": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.41.0.tgz", + "integrity": "sha512-3v7u3t4LozCA5SpZY4yqUN2U3jSrkXNoLgz6L2SUUiydyCuSwXZIFEwpLJfgQyidpNDifeQbBI5E1O910XkPsA==", + "license": "MIT", + "dependencies": { + "@sentry/types": "8.41.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/core/node_modules/@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", + "license": "MIT", + "engines": { + "node": ">=14.18" } }, "node_modules/@socket.io/component-emitter": { @@ -11938,11 +11999,6 @@ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -14074,61 +14130,105 @@ "tiny-hashes": "^1.0.1" } }, - "@sentry/browser": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.12.0.tgz", - "integrity": "sha512-VoqZj3wJm5aUIDG+7LjeSHIw9/pujrUlA1QMu2YOY3LaP6UQsAAsOSo52brnaQQcwBrRySksaaaTxg6obJwInw==", + "@sentry-internal/browser-utils": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.41.0.tgz", + "integrity": "sha512-nU7Bn3jEUmf1QXRUT3j2ewUBlFJpe9vnAnjqpeVPDWTsVI52BwVNcJHuE37PrGs66OZ1ZkGMfKnQk43oCAa+oQ==", "requires": { - "@sentry/core": "7.12.0", - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" + }, + "dependencies": { + "@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==" + } } }, - "@sentry/core": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.12.0.tgz", - "integrity": "sha512-ERkeB/XdThvdSVZH4XysMPyWRG653HDq0AkJh8SgapExCZbwgj1lutCIpT1LIbZ8lUhRx5P+ua9OR2qj+vo5RA==", + "@sentry-internal/feedback": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.41.0.tgz", + "integrity": "sha512-bw+BrSNw8abOnu/IpD8YSbYubXkkT8jyNS7TM4e4UPZMuXcbtia7/r5d7kAiUfKv/sV5PNMlZLOk+EYJeLTANg==", "requires": { - "@sentry/hub": "7.12.0", - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" + }, + "dependencies": { + "@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==" + } } }, - "@sentry/hub": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-7.12.0.tgz", - "integrity": "sha512-UgpC9WiHQAfcoEIIgeIopp3jeabllK6beLl5vA4ei6ay2TDMjA4NqUpzGq/GWVG0ewnblvHkqmjwAls2AEMtWg==", + "@sentry-internal/replay": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.41.0.tgz", + "integrity": "sha512-ByXEY7JI95y4Qr9fS3d28l9uuVU5Qa0HgL+xDmYElNx7CXz3Q9hFN6ibgUeC3h8BO5pDULxWNgAppl7FRY8N5w==", "requires": { - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry-internal/browser-utils": "8.41.0", + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" + }, + "dependencies": { + "@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==" + } } }, - "@sentry/tracing": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.12.0.tgz", - "integrity": "sha512-TK30G/g15KplKOPncu61XvNLjaI+Kbe64UBTSTANMkidlEjiZ8N0P8L9AqUG+rUIk7YbIu11DS6edGY/LK0WEQ==", + "@sentry-internal/replay-canvas": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.41.0.tgz", + "integrity": "sha512-lpgOBHWr1ZNxidD72A2pfoUMjIpwonOPYoQZWAHr86Oa3eIVQOyfklZlHW+gKPFl2/IEl9Lbtcke0JiDp3dkIQ==", "requires": { - "@sentry/hub": "7.12.0", - "@sentry/types": "7.12.0", - "@sentry/utils": "7.12.0", - "tslib": "^1.9.3" + "@sentry-internal/replay": "8.41.0", + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" + }, + "dependencies": { + "@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==" + } } }, - "@sentry/types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.12.0.tgz", - "integrity": "sha512-ldcuRzEx2ccZvaJjTSemWj+7TiWCV5A/vV7fEtZeoETFI+SiVbmqI5whdH7ZVVfhRNFf25Ib+TfTeaM9PM7A1A==" + "@sentry/browser": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.41.0.tgz", + "integrity": "sha512-FfAU55eYwW2lG4M3dEw2472RvHrD5YWSfHCZvuRf/4skX38kFvKghZQ+epL+CVHTzvIRHOrbj8qQK6YLTGl9ew==", + "requires": { + "@sentry-internal/browser-utils": "8.41.0", + "@sentry-internal/feedback": "8.41.0", + "@sentry-internal/replay": "8.41.0", + "@sentry-internal/replay-canvas": "8.41.0", + "@sentry/core": "8.41.0", + "@sentry/types": "8.41.0" + }, + "dependencies": { + "@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==" + } + } }, - "@sentry/utils": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.12.0.tgz", - "integrity": "sha512-GVB8E0V3RJHQClvi0gsRRJvDXP5c7M5ByYAvspJDczOOxNF8LTjTYVkBXAUdR9kcs+nya1q1YVsKvde2WGORTA==", + "@sentry/core": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.41.0.tgz", + "integrity": "sha512-3v7u3t4LozCA5SpZY4yqUN2U3jSrkXNoLgz6L2SUUiydyCuSwXZIFEwpLJfgQyidpNDifeQbBI5E1O910XkPsA==", "requires": { - "@sentry/types": "7.12.0", - "tslib": "^1.9.3" + "@sentry/types": "8.41.0" + }, + "dependencies": { + "@sentry/types": { + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", + "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==" + } } }, "@socket.io/component-emitter": { @@ -19893,11 +19993,6 @@ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", diff --git a/webapp/package.json b/webapp/package.json index 64cadd7e..79f8b85a 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -27,8 +27,7 @@ "@radix-ui/react-icons": "^1.3.0", "@radix-ui/themes": "^3.1.3", "@segment/analytics-next": "^1.64.0", - "@sentry/browser": "7.12.0", - "@sentry/tracing": "7.12.0", + "@sentry/browser": "8.41.0", "@uiw/codemirror-theme-dracula": "^4.21.21", "@uiw/codemirror-theme-github": "^4.21.21", "@uiw/codemirror-theme-nord": "^4.21.21", diff --git a/webapp/shadow-cljs.edn b/webapp/shadow-cljs.edn index e9a0e63f..e750b1d7 100644 --- a/webapp/shadow-cljs.edn +++ b/webapp/shadow-cljs.edn @@ -31,7 +31,7 @@ webapp.env/canny-id #shadow/env ["CANNY_ID" "650f50a3e71cb50a018f6e7b"] webapp.env/sentry-sample-rate #shadow/env ["SENTRY_SAMPLE_RATE" "1.0"] webapp.env/sentry-dsn #shadow/env ["SENTRY_DSN" - "https://b2bf390e5cd94bfc83c0005312d796fd@o919346.ingest.sentry.io/6707471"] + "https://38e03773be6b0d77219d6678a90ed6a5@o4504559799566336.ingest.us.sentry.io/4508377639092224"] webapp.env/api-endpoint #shadow/env ["GATEWAY_URL" "http://localhost:8009/api"] webapp.env/hoop-app-url #shadow/env ["HOOP_APP_URL" diff --git a/webapp/src/webapp/app.cljs b/webapp/src/webapp/app.cljs index 49e68a62..e45e77f4 100644 --- a/webapp/src/webapp/app.cljs +++ b/webapp/src/webapp/app.cljs @@ -1,6 +1,7 @@ (ns webapp.app (:require ["@radix-ui/themes" :refer [Theme]] ["gsap/all" :refer [Draggable gsap]] + ["@sentry/browser" :as Sentry] [bidi.bidi :as bidi] [clojure.string :as cs] [re-frame.core :as rf] @@ -313,11 +314,21 @@ :class "text-xs text-blue-500"} "Go to homepage"]]]) +(defn sentry-monitor [] + (let [sentry-dsn config/sentry-dsn + sentry-sample-rate config/sentry-sample-rate] + (when (and sentry-dsn sentry-sample-rate) + (.init Sentry #js {:dsn sentry-dsn + :release config/app-version + :sampleRate sentry-sample-rate + :integrations #js [(.browserTracingIntegration Sentry)]})))) + (defn main-panel [] (let [active-panel (rf/subscribe [::subs/active-panel]) gateway-public-info (rf/subscribe [:gateway->public-info])] (rf/dispatch [:gateway->get-public-info]) (.registerPlugin gsap Draggable) + (sentry-monitor) (fn [] (when (not (-> @gateway-public-info :loading)) [:> Theme {:radius "large" :panelBackground "solid"} diff --git a/webapp/src/webapp/config.cljs b/webapp/src/webapp/config.cljs index d6fedca1..50533987 100644 --- a/webapp/src/webapp/config.cljs +++ b/webapp/src/webapp/config.cljs @@ -20,3 +20,6 @@ (def segment-write-key env/segment-write-key) (def canny-id env/canny-id) + +(def sentry-sample-rate env/sentry-sample-rate) +(def sentry-dsn env/sentry-dsn) diff --git a/webapp/src/webapp/env.cljs b/webapp/src/webapp/env.cljs index d4fa20b1..8b6a4705 100644 --- a/webapp/src/webapp/env.cljs +++ b/webapp/src/webapp/env.cljs @@ -3,6 +3,8 @@ (goog-define release-type "") (goog-define api-url "") (goog-define segment-write-key "") +(goog-define sentry-sample-rate "") +(goog-define sentry-dsn "") (goog-define hoop-app-url "") (goog-define webapp-url "") (goog-define canny-id "") diff --git a/webapp/src/webapp/guardrails/main.cljs b/webapp/src/webapp/guardrails/main.cljs index f81617af..93043d2e 100644 --- a/webapp/src/webapp/guardrails/main.cljs +++ b/webapp/src/webapp/guardrails/main.cljs @@ -48,4 +48,3 @@ :size "3" :on-click #(rf/dispatch [:navigate :edit-guardrail {} :guardrail-id (:id rules)])} "Configure"]]])])]))) -