Skip to content

Commit 71d255c

Browse files
committed
add sentry
1 parent 1a3d3ea commit 71d255c

File tree

8 files changed

+94
-8
lines changed

8 files changed

+94
-8
lines changed

.github/workflows/deploy-frontend.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
image_name="${REGISTRY}:release-${sha}"
5858
fi
5959
echo "image_name=$image_name" >> $GITHUB_OUTPUT
60-
60+
6161
build-and-push-image:
6262
needs: [prepair]
6363
runs-on: ubuntu-latest
@@ -98,8 +98,9 @@ jobs:
9898
VITE_VARA_ARCHIVE_NODE_ADDRESSES=${{ secrets.VITE_VARA_ARCHIVE_NODE_ADDRESSES }}
9999
VITE_ETH_BEACON_NODE_ADDRESSES=${{ secrets.VITE_ETH_BEACON_NODE_ADDRESSES }}
100100
VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES=${{ secrets.VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES }}
101+
VITE_SENTRY_DSN=${{ secrets.VITE_SENTRY_DSN }}
101102
VITE_GTM_ID=${{ secrets.VITE_GTM_ID }}
102-
103+
103104
deploy-to-k8s:
104105
needs: [prepair, build-and-push-image]
105106
runs-on: ubuntu-latest
@@ -114,7 +115,7 @@ jobs:
114115
uses: kodermax/kubectl-aws-eks@main
115116
with:
116117
args: -n ${{ env.KUBE_NAMESPACE }} rollout restart deployment/${{ needs.prepair.outputs.deployment_name }}
117-
118+
118119
- name: Check deployment status
119120
uses: kodermax/kubectl-aws-eks@main
120121
with:

js/frontend/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ VITE_VARA_ARCHIVE_NODE_ADDRESSES=
2929
VITE_ETH_BEACON_NODE_ADDRESSES=
3030
VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES=
3131

32-
# analytics
32+
# error tracking and analytics
33+
VITE_SENTRY_DSN=
3334
VITE_GTM_ID=

js/frontend/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ARG VITE_VARA_NODE_ADDRESSES \
2929
VITE_VARA_ARCHIVE_NODE_ADDRESSES \
3030
VITE_ETH_BEACON_NODE_ADDRESSES \
3131
VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES \
32+
VITE_SENTRY_DSN \
3233
VITE_GTM_ID
3334

3435
ENV VITE_VARA_NODE_ADDRESSES=${VITE_VARA_NODE_ADDRESSES} \
@@ -46,6 +47,7 @@ ENV VITE_VARA_NODE_ADDRESSES=${VITE_VARA_NODE_ADDRESSES} \
4647
VITE_VARA_ARCHIVE_NODE_ADDRESSES=${VITE_VARA_ARCHIVE_NODE_ADDRESSES} \
4748
VITE_ETH_BEACON_NODE_ADDRESSES=${VITE_ETH_BEACON_NODE_ADDRESSES} \
4849
VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES=${VITE_ETH_MESSAGE_QUEUE_CONTRACT_ADDRESSES} \
50+
VITE_SENTRY_DSN=${VITE_SENTRY_DSN} \
4951
VITE_GTM_ID=${VITE_GTM_ID}
5052

5153

js/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@polkadot/react-identicon": "3.16.4",
2424
"@reown/appkit": "1.8.15",
2525
"@reown/appkit-adapter-wagmi": "1.8.15",
26+
"@sentry/react": "10.40.0",
2627
"@tanstack/react-query": "5.90.12",
2728
"gear-bridge-common": "workspace:*",
2829
"graphql": "16.12.0",

js/frontend/src/consts/env.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN as string | undefined;
12
const GTM_ID = import.meta.env.VITE_GTM_ID as string | undefined;
23

3-
export { GTM_ID };
4+
export { SENTRY_DSN, GTM_ID };

js/frontend/src/consts/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ERC20_ABI, WRAPPED_ETH_ABI } from './abi';
2-
import { GTM_ID } from './env';
2+
import { SENTRY_DSN, GTM_ID } from './env';
33
import { ROUTE } from './routing';
44
import { VftProgram, WrappedVaraProgram } from './sails';
55

6-
export { ERC20_ABI, WRAPPED_ETH_ABI, ROUTE, GTM_ID, VftProgram, WrappedVaraProgram };
6+
export { ERC20_ABI, WRAPPED_ETH_ABI, ROUTE, SENTRY_DSN, GTM_ID, VftProgram, WrappedVaraProgram };

js/frontend/src/main.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import '@gear-js/vara-ui/dist/style.css';
2+
import * as Sentry from '@sentry/react';
23
import React from 'react';
34
import ReactDOM from 'react-dom/client';
45
import TagManager from 'react-gtm-module';
@@ -7,11 +8,19 @@ import { Outlet, RouterProvider, createBrowserRouter } from 'react-router-dom';
78
import { useAccountsConnection } from '@/hooks';
89

910
import { App } from './app';
10-
import { ROUTE, GTM_ID } from './consts';
11+
import { ROUTE, GTM_ID, SENTRY_DSN } from './consts';
1112
import { NotFound, Home, Transactions, FAQ, TokenTracker, ConnectWallet, Transaction } from './pages';
1213

1314
import './index.scss';
1415

16+
if (SENTRY_DSN)
17+
Sentry.init({
18+
dsn: SENTRY_DSN,
19+
integrations: [Sentry.replayIntegration()],
20+
replaysSessionSampleRate: 0,
21+
replaysOnErrorSampleRate: 1.0,
22+
});
23+
1524
if (GTM_ID) TagManager.initialize({ gtmId: GTM_ID });
1625

1726
// eslint-disable-next-line react-refresh/only-export-components

yarn.lock

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5242,6 +5242,76 @@ __metadata:
52425242
languageName: node
52435243
linkType: hard
52445244

5245+
"@sentry-internal/browser-utils@npm:10.40.0":
5246+
version: 10.40.0
5247+
resolution: "@sentry-internal/browser-utils@npm:10.40.0"
5248+
dependencies:
5249+
"@sentry/core": "npm:10.40.0"
5250+
checksum: 10c0/9801776fad1c7e9690823588d978631dad4e66fd5e8eab934e9e508306e7d6d149982d6270e00687d62c96255dabb930871f841f7674ab273ead19c1b38bb700
5251+
languageName: node
5252+
linkType: hard
5253+
5254+
"@sentry-internal/feedback@npm:10.40.0":
5255+
version: 10.40.0
5256+
resolution: "@sentry-internal/feedback@npm:10.40.0"
5257+
dependencies:
5258+
"@sentry/core": "npm:10.40.0"
5259+
checksum: 10c0/8694d99adef186c6e93c9b48638391cefbf3a6414ef9ad5bd250740fbc69685b0fb6362734446ee5473b3f82177b4ae72c228ee9dc6f5b07bd423c8eaf8419db
5260+
languageName: node
5261+
linkType: hard
5262+
5263+
"@sentry-internal/replay-canvas@npm:10.40.0":
5264+
version: 10.40.0
5265+
resolution: "@sentry-internal/replay-canvas@npm:10.40.0"
5266+
dependencies:
5267+
"@sentry-internal/replay": "npm:10.40.0"
5268+
"@sentry/core": "npm:10.40.0"
5269+
checksum: 10c0/c1f359945eb1dfdbe37053b67a25cd2f241cd6370b24679bc32512e14af4dc3bd92c9663dbca5e66e206f7633dcb1bf521d989ef8f25e7faa998a3ee84ba1c46
5270+
languageName: node
5271+
linkType: hard
5272+
5273+
"@sentry-internal/replay@npm:10.40.0":
5274+
version: 10.40.0
5275+
resolution: "@sentry-internal/replay@npm:10.40.0"
5276+
dependencies:
5277+
"@sentry-internal/browser-utils": "npm:10.40.0"
5278+
"@sentry/core": "npm:10.40.0"
5279+
checksum: 10c0/ce7bf12b12360caabccfe60cc0bc6c96cef151a2897fb2d2fa645d845ff812457df72cd8d16bd167ae5ccdf9a8932905be435f2b473d7b0efa6c106837412fbf
5280+
languageName: node
5281+
linkType: hard
5282+
5283+
"@sentry/browser@npm:10.40.0":
5284+
version: 10.40.0
5285+
resolution: "@sentry/browser@npm:10.40.0"
5286+
dependencies:
5287+
"@sentry-internal/browser-utils": "npm:10.40.0"
5288+
"@sentry-internal/feedback": "npm:10.40.0"
5289+
"@sentry-internal/replay": "npm:10.40.0"
5290+
"@sentry-internal/replay-canvas": "npm:10.40.0"
5291+
"@sentry/core": "npm:10.40.0"
5292+
checksum: 10c0/4a383bf7d47640d0b5d14e39da3ebd35c88c93b048df13849eea22316f6ee44caf6221005fe87776eb9957219f50702e07f11213d405af1095acdab7fb62bbdb
5293+
languageName: node
5294+
linkType: hard
5295+
5296+
"@sentry/core@npm:10.40.0":
5297+
version: 10.40.0
5298+
resolution: "@sentry/core@npm:10.40.0"
5299+
checksum: 10c0/76dc283cda98ae854be63a1836ea77abaf2a3db88b592ae086982e89d2a9d163b5e92819cbf3005bffc459a56ca90b0f71cc908cce7c55e147606b111a4dbb8a
5300+
languageName: node
5301+
linkType: hard
5302+
5303+
"@sentry/react@npm:10.40.0":
5304+
version: 10.40.0
5305+
resolution: "@sentry/react@npm:10.40.0"
5306+
dependencies:
5307+
"@sentry/browser": "npm:10.40.0"
5308+
"@sentry/core": "npm:10.40.0"
5309+
peerDependencies:
5310+
react: ^16.14.0 || 17.x || 18.x || 19.x
5311+
checksum: 10c0/f7efc5b58d43ed96c37e0dcbfee9cc0d6cb75370d0e88d434a2cf4fdea51b8adffc9b6db8258339d7f5ba16920231ad44488933d9e15e8b8fb420aeacf83922e
5312+
languageName: node
5313+
linkType: hard
5314+
52455315
"@sigstore/bundle@npm:^2.3.2":
52465316
version: 2.3.2
52475317
resolution: "@sigstore/bundle@npm:2.3.2"
@@ -13013,6 +13083,7 @@ __metadata:
1301313083
"@polkadot/types": "npm:16.4.6"
1301413084
"@reown/appkit": "npm:1.8.15"
1301513085
"@reown/appkit-adapter-wagmi": "npm:1.8.15"
13086+
"@sentry/react": "npm:10.40.0"
1301613087
"@tanstack/react-query": "npm:5.90.12"
1301713088
"@types/react": "npm:19.2.7"
1301813089
"@types/react-dom": "npm:19.2.3"

0 commit comments

Comments
 (0)