From cbc7f634d07d7ff167af8134441ef4426de594a6 Mon Sep 17 00:00:00 2001 From: Conor Brady Date: Mon, 29 Apr 2024 14:12:12 -0700 Subject: [PATCH] Set up sentry hook (#3569) --- .github/workflows/deployment.yml | 2 +- api/app/.env.example | 3 +- api/app/main.py | 12 ++ api/poetry.lock | 63 ++++++-- api/pyproject.toml | 1 + openshift/scripts/oc_deploy_to_production.sh | 2 +- openshift/templates/deploy.dc.yaml | 11 +- web/.env.example | 2 + web/package.json | 1 + web/src/components/FeedbackButton.tsx | 20 +++ web/src/index.tsx | 15 ++ web/src/types/window.d.ts | 2 + web/src/utils/env.ts | 12 +- web/yarn.lock | 143 +++++++++++++++---- 14 files changed, 239 insertions(+), 50 deletions(-) create mode 100644 web/src/components/FeedbackButton.tsx diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 12d1e657c..480df3e55 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -124,7 +124,7 @@ jobs: shell: bash run: | oc login "${{ secrets.OPENSHIFT_CLUSTER }}" --token="${{ secrets.OC4_DEV_TOKEN }}" - MODULE_NAME=api SECOND_LEVEL_DOMAIN="apps.silver.devops.gov.bc.ca" VANITY_DOMAIN="${SUFFIX}-dev-psu.apps.silver.devops.gov.bc.ca" USE_WFWX="True" bash openshift/scripts/oc_deploy.sh ${SUFFIX} apply + MODULE_NAME=api SECOND_LEVEL_DOMAIN="apps.silver.devops.gov.bc.ca" VANITY_DOMAIN="${SUFFIX}-dev-psu.apps.silver.devops.gov.bc.ca" USE_WFWX="True" ENVIRONMENT="development" bash openshift/scripts/oc_deploy.sh ${SUFFIX} apply ## TODO: re-enable once crunchy is deployed: https://app.zenhub.com/workspaces/bcws---agile-psu-5e321393e038fba5bbe203b8/issues/gh/bcgov/wps/2340 - name: Hourly actuals cronjob diff --git a/api/app/.env.example b/api/app/.env.example index 5f796dfe7..033213cd3 100644 --- a/api/app/.env.example +++ b/api/app/.env.example @@ -58,4 +58,5 @@ OBJECT_STORE_SERVER=object_store_server OBJECT_STORE_USER_ID=object_store_user OBJECT_STORE_SECRET=object_store_secret OBJECT_STORE_BUCKET=object_store_bucket -DEM_NAME=dem_mosaic_250_max.tif \ No newline at end of file +DEM_NAME=dem_mosaic_250_max.tif +SENTRY_DSN=some_dsn \ No newline at end of file diff --git a/api/app/main.py b/api/app/main.py index b744de6be..da2a11ebc 100644 --- a/api/app/main.py +++ b/api/app/main.py @@ -7,6 +7,7 @@ from urllib.request import Request from fastapi import FastAPI, Depends, Response from fastapi.middleware.cors import CORSMiddleware +import sentry_sdk from starlette.applications import Starlette from app import schemas, configure_logging from app.percentile import get_precalculated_percentiles @@ -59,6 +60,17 @@ programs or information, even if the Government of British Columbia has been specifically advised of the possibility of such damages.''' +sentry_sdk.init( + dsn=config.get("SENTRY_DSN"), + environment=config.get('ENVIRONMENT'), + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for performance monitoring. + traces_sample_rate=1.0, + # Set profiles_sample_rate to 1.0 to profile 100% + # of sampled transactions. + # We recommend adjusting this value in production. + profiles_sample_rate=1.0, +) # This is the api app. api = FastAPI( diff --git a/api/poetry.lock b/api/poetry.lock index d034ef9e3..d5557ef28 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "affine" @@ -3904,7 +3904,6 @@ files = [ {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, @@ -3912,16 +3911,8 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, @@ -3938,7 +3929,6 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -3946,7 +3936,6 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, @@ -4518,6 +4507,54 @@ nativelib = ["pyobjc-framework-Cocoa", "pywin32"] objc = ["pyobjc-framework-Cocoa"] win32 = ["pywin32"] +[[package]] +name = "sentry-sdk" +version = "2.0.1" +description = "Python client for Sentry (https://sentry.io)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "sentry_sdk-2.0.1-py2.py3-none-any.whl", hash = "sha256:b54c54a2160f509cf2757260d0cf3885b608c6192c2555a3857e3a4d0f84bdb3"}, + {file = "sentry_sdk-2.0.1.tar.gz", hash = "sha256:c278e0f523f6f0ee69dc43ad26dcdb1202dffe5ac326ae31472e012d941bee21"}, +] + +[package.dependencies] +certifi = "*" +fastapi = {version = ">=0.79.0", optional = true, markers = "extra == \"fastapi\""} +urllib3 = ">=1.26.11" + +[package.extras] +aiohttp = ["aiohttp (>=3.5)"] +arq = ["arq (>=0.23)"] +asyncpg = ["asyncpg (>=0.23)"] +beam = ["apache-beam (>=2.12)"] +bottle = ["bottle (>=0.12.13)"] +celery = ["celery (>=3)"] +celery-redbeat = ["celery-redbeat (>=2)"] +chalice = ["chalice (>=1.16.0)"] +clickhouse-driver = ["clickhouse-driver (>=0.2.0)"] +django = ["django (>=1.8)"] +falcon = ["falcon (>=1.4)"] +fastapi = ["fastapi (>=0.79.0)"] +flask = ["blinker (>=1.1)", "flask (>=0.11)", "markupsafe"] +grpcio = ["grpcio (>=1.21.1)"] +httpx = ["httpx (>=0.16.0)"] +huey = ["huey (>=2)"] +loguru = ["loguru (>=0.5)"] +openai = ["openai (>=1.0.0)", "tiktoken (>=0.3.0)"] +opentelemetry = ["opentelemetry-distro (>=0.35b0)"] +opentelemetry-experimental = ["opentelemetry-distro (>=0.40b0,<1.0)", "opentelemetry-instrumentation-aiohttp-client (>=0.40b0,<1.0)", "opentelemetry-instrumentation-django (>=0.40b0,<1.0)", "opentelemetry-instrumentation-fastapi (>=0.40b0,<1.0)", "opentelemetry-instrumentation-flask (>=0.40b0,<1.0)", "opentelemetry-instrumentation-requests (>=0.40b0,<1.0)", "opentelemetry-instrumentation-sqlite3 (>=0.40b0,<1.0)", "opentelemetry-instrumentation-urllib (>=0.40b0,<1.0)"] +pure-eval = ["asttokens", "executing", "pure-eval"] +pymongo = ["pymongo (>=3.1)"] +pyspark = ["pyspark (>=2.4.4)"] +quart = ["blinker (>=1.1)", "quart (>=0.16.1)"] +rq = ["rq (>=0.6)"] +sanic = ["sanic (>=0.8)"] +sqlalchemy = ["sqlalchemy (>=1.2)"] +starlette = ["starlette (>=0.19.1)"] +starlite = ["starlite (>=1.48)"] +tornado = ["tornado (>=5)"] + [[package]] name = "setuptools" version = "69.5.1" @@ -5290,4 +5327,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.10.4,<3.11" -content-hash = "c68aedeac35f4c0b57ded663c0ead7ac3caa3e9fd20eb161ee68cd3462cba3eb" +content-hash = "7fb8f3bbe67056ec49f8b832c02b35be1a017e34dc88e8c6afc0445944ec2e86" diff --git a/api/pyproject.toml b/api/pyproject.toml index fb412a6a5..ca7d5f551 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -43,6 +43,7 @@ scikit-learn = "^1.1.3" httpx = "^0.27.0" orjson = "^3.9.0" greenlet = "^3.0.0" +sentry-sdk = {extras = ["fastapi"], version = "^2.0.1"} [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" diff --git a/openshift/scripts/oc_deploy_to_production.sh b/openshift/scripts/oc_deploy_to_production.sh index 362b1103e..a470ac184 100755 --- a/openshift/scripts/oc_deploy_to_production.sh +++ b/openshift/scripts/oc_deploy_to_production.sh @@ -43,7 +43,7 @@ PROJ_TARGET=${PROJ_TARGET} BUCKET=lwzrin CPU_REQUEST=75m CPU_LIMIT=2000m MEMORY_ echo Provision NATS PROJ_TARGET=${PROJ_TARGET} bash $(dirname ${0})/oc_provision_nats.sh prod ${RUN_TYPE} echo Deploy API -MODULE_NAME=api GUNICORN_WORKERS=8 CPU_REQUEST=100m CPU_LIMIT=500m MEMORY_REQUEST=3Gi MEMORY_LIMIT=6Gi REPLICAS=3 PROJ_TARGET=${PROJ_TARGET} VANITY_DOMAIN=psu.nrs.gov.bc.ca SECOND_LEVEL_DOMAIN=apps.silver.devops.gov.bc.ca USE_WFWX="True" bash $(dirname ${0})/oc_deploy.sh prod ${RUN_TYPE} +MODULE_NAME=api GUNICORN_WORKERS=8 CPU_REQUEST=100m CPU_LIMIT=500m MEMORY_REQUEST=3Gi MEMORY_LIMIT=6Gi REPLICAS=3 PROJ_TARGET=${PROJ_TARGET} VANITY_DOMAIN=psu.nrs.gov.bc.ca SECOND_LEVEL_DOMAIN=apps.silver.devops.gov.bc.ca USE_WFWX="True" ENVIRONMENT="production" bash $(dirname ${0})/oc_deploy.sh prod ${RUN_TYPE} echo Env Canada Subscriber PROJ_TARGET=${PROJ_TARGET} bash $(dirname ${0})/oc_provision_ec_gdps_cronjob.sh prod ${RUN_TYPE} PROJ_TARGET=${PROJ_TARGET} bash $(dirname ${0})/oc_provision_ec_hrdps_cronjob.sh prod ${RUN_TYPE} diff --git a/openshift/templates/deploy.dc.yaml b/openshift/templates/deploy.dc.yaml index bbea6c200..864c8f41c 100644 --- a/openshift/templates/deploy.dc.yaml +++ b/openshift/templates/deploy.dc.yaml @@ -67,7 +67,7 @@ parameters: required: True value: apps.silver.devops.gov.bc.ca - name: ENVIRONMENT - description: Can be used to modify route (e.g. when deploying to test) + description: Used for specifying which environment sentry is running in value: "" - name: USE_WFWX value: "False" @@ -377,6 +377,11 @@ objects: secretKeyRef: name: ${GLOBAL_NAME} key: sfms-secret + - name: SENTRY_DSN + valueFrom: + secretKeyRef: + name: ${GLOBAL_NAME} + key: sentry-dsn - name: NATS_STREAM_PREFIX value: ${APP_NAME}-${SUFFIX} - name: NATS_SERVER @@ -460,7 +465,7 @@ objects: haproxy.router.openshift.io/balance: roundrobin haproxy.router.openshift.io/disable_cookies: "true" spec: - host: ${APP_NAME}-${SUFFIX}${ENVIRONMENT}.${SECOND_LEVEL_DOMAIN} + host: ${APP_NAME}-${SUFFIX}.${SECOND_LEVEL_DOMAIN} path: "/api" port: targetPort: 8080-tcp @@ -485,7 +490,7 @@ objects: haproxy.router.openshift.io/balance: roundrobin haproxy.router.openshift.io/disable_cookies: "true" spec: - host: ${APP_NAME}-${SUFFIX}${ENVIRONMENT}.${SECOND_LEVEL_DOMAIN} + host: ${APP_NAME}-${SUFFIX}.${SECOND_LEVEL_DOMAIN} port: targetPort: 3000-tcp to: diff --git a/web/.env.example b/web/.env.example index 22792e2f7..9b0049b39 100644 --- a/web/.env.example +++ b/web/.env.example @@ -9,3 +9,5 @@ REACT_APP_WF1_AUTH_URL=https://wf1/auth REACT_APP_MS_TEAMS_SPRINT_REVIEW_URL=http://localhost:3000 REACT_APP_MIRO_SPRINT_REVIEW_BOARD_URL=http://localhost:3000 REACT_APP_PMTILES_BUCKET=https://My_S3_Bucket +REACT_APP_SENTRY_DSN=123 +REACT_APP_SENTRY_ENV=development \ No newline at end of file diff --git a/web/package.json b/web/package.json index 6ff6413b2..0a46d3aba 100644 --- a/web/package.json +++ b/web/package.json @@ -20,6 +20,7 @@ "@mui/x-data-grid-pro": "^6.0.0", "@mui/x-date-pickers": "^7.0.0", "@reduxjs/toolkit": "^1.8.0", + "@sentry/react": "^7.112.1", "@types/esri-leaflet": "^3.0.0", "@types/leaflet": "^1.7.0", "@types/lodash": "^4.14.173", diff --git a/web/src/components/FeedbackButton.tsx b/web/src/components/FeedbackButton.tsx new file mode 100644 index 000000000..ee86fc5fd --- /dev/null +++ b/web/src/components/FeedbackButton.tsx @@ -0,0 +1,20 @@ +import React from 'react' +import { Button } from '@mui/material' +import CampaignIcon from '@mui/icons-material/Campaign' +import { feedbackIntegration } from '@sentry/react' + +const FeedbackButton = ({ color }: { color: 'primary' | 'inherit' }) => { + const feedback = feedbackIntegration({ colorScheme: 'system' }) + + if (!feedback) { + return null + } + + return ( + + ) +} + +export default React.memo(FeedbackButton) diff --git a/web/src/index.tsx b/web/src/index.tsx index e574d5956..5877c92b8 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -2,12 +2,27 @@ import React from 'react' import * as ReactDOMClient from 'react-dom/client' import { Provider } from 'react-redux' import App from 'app/App' +import { SENTRY_DSN, SENTRY_ENV, API_BASE_URL } from 'utils/env' import 'index.css' import store from 'app/store' import * as serviceWorker from 'serviceWorker' +import * as Sentry from '@sentry/react' const render = () => { + Sentry.init({ + dsn: SENTRY_DSN, + environment: SENTRY_ENV, + integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()], + // Performance Monitoring + tracesSampleRate: 1.0, // Capture 100% of the transactions + // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [API_BASE_URL], + // Session Replay + replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. + replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + }) + // eslint-disable-next-line @typescript-eslint/no-var-requires const container = document.getElementById('root') // Null check to keep TypeScript happy diff --git a/web/src/types/window.d.ts b/web/src/types/window.d.ts index 9f0194069..49885b964 100644 --- a/web/src/types/window.d.ts +++ b/web/src/types/window.d.ts @@ -12,6 +12,8 @@ interface Window { REACT_APP_MIRO_SPRINT_REVIEW_BOARD_URL: string REACT_APP_PMTILES_BUCKET: string REACT_APP_MUI_LICENSE_KEY: string + REACT_APP_SENTRY_DSN: string + REACT_APP_SENTRY_ENV: string } Cypress: {} | undefined } diff --git a/web/src/utils/env.ts b/web/src/utils/env.ts index 45f81b878..576b9066a 100644 --- a/web/src/utils/env.ts +++ b/web/src/utils/env.ts @@ -11,7 +11,9 @@ let ENV = { MS_TEAMS_SPRINT_REVIEW_URL: process.env.REACT_APP_MS_TEAMS_SPRINT_REVIEW_URL as string, MIRO_SPRINT_REVIEW_BOARD_URL: process.env.REACT_APP_MIRO_SPRINT_REVIEW_BOARD_URL as string, PMTILES_BUCKET: process.env.REACT_APP_PMTILES_BUCKET as string, - MUI_LICENSE: process.env.REACT_APP_MUI_LICENSE_KEY as string + MUI_LICENSE: process.env.REACT_APP_MUI_LICENSE_KEY as string, + SENTRY_DSN: process.env.REACT_APP_SENTRY_DSN as string, + SENTRY_ENV: process.env.REACT_APP_SENTRY_ENV as string } // If the app is built using 'npm run build' @@ -31,7 +33,9 @@ if (process.env.NODE_ENV === 'production') { MS_TEAMS_SPRINT_REVIEW_URL: window.env.REACT_APP_MS_TEAMS_SPRINT_REVIEW_URL, MIRO_SPRINT_REVIEW_BOARD_URL: window.env.REACT_APP_MIRO_SPRINT_REVIEW_BOARD_URL, PMTILES_BUCKET: window.env.REACT_APP_PMTILES_BUCKET, - MUI_LICENSE: window.env.REACT_APP_MUI_LICENSE_KEY + MUI_LICENSE: window.env.REACT_APP_MUI_LICENSE_KEY, + SENTRY_DSN: window.env.REACT_APP_SENTRY_DSN, + SENTRY_ENV: window.env.REACT_APP_SENTRY_ENV } } @@ -48,5 +52,7 @@ export const { MIRO_SPRINT_REVIEW_BOARD_URL, WF1_AUTH_URL, PMTILES_BUCKET, - MUI_LICENSE + MUI_LICENSE, + SENTRY_DSN, + SENTRY_ENV } = ENV diff --git a/web/yarn.lock b/web/yarn.lock index 0f1d166e2..d8fba52c7 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -2138,6 +2138,99 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.2.tgz#053f1540703faa81dea2966b768ee5581c66aeda" integrity sha512-hw437iINopmQuxWPSUEvqE56NCPsiU8N4AYtfHmJFckclktzK9YQJieD3XkDCDH4OjL+C7zgPUh73R/nrcHrqw== +"@sentry-internal/feedback@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.112.1.tgz#011077f1eaaadd1ab9be4886c47f161b89a50b86" + integrity sha512-ejE4eRXLqv5emxVWudBkRQCv5Q7s21thei7gqSxGLBXe8AUrCjTiD0qA1ToJAKcleIyRRf/TQvGb/T7U6vwAAw== + dependencies: + "@sentry/core" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + +"@sentry-internal/replay-canvas@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.112.1.tgz#0d3b59ca05a40ea3596784a7ec813a2b0a8ca52c" + integrity sha512-+xDd/LEiJZGk4PQKs4xcAWKJFzFKpuNF64DFW/JWuJ5FDnKB+t7w198nQyAZKGjupN7LixLb49Z8O2Gda7fHQQ== + dependencies: + "@sentry/core" "7.112.1" + "@sentry/replay" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + +"@sentry-internal/tracing@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.112.1.tgz#10d53452f39cf087bc6ebb86fd95f10d634200bc" + integrity sha512-pZVIOB6+t4HlgU3mCRtIbvo//t8uQY9tnBjbJJ2nEv8nTu8A7/dZ5ebrLOWStV3bNp/+uCqLuLuuimJeNNn6vQ== + dependencies: + "@sentry/core" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + +"@sentry/browser@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.112.1.tgz#88f2046a026de773d19d58b9febf410bd9139b13" + integrity sha512-NRTo3mJbhiCd9GEFEWL8SplFJhTCPjiAlOhjUw8MnJb7pkxWm2xhC7PVi6SUE8hF/g1rrEwgUr9SX5v8+xwK6g== + dependencies: + "@sentry-internal/feedback" "7.112.1" + "@sentry-internal/replay-canvas" "7.112.1" + "@sentry-internal/tracing" "7.112.1" + "@sentry/core" "7.112.1" + "@sentry/integrations" "7.112.1" + "@sentry/replay" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + +"@sentry/core@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.112.1.tgz#0b97e6fc41aa30889efeb1d4bb5b8be5728543b0" + integrity sha512-ZhOxt4sZVLqHurWqIY1ExWYZ20ViFTbqgW2GdJGHz4XwJhBln0ZVpHD+tKXy3GBEY+2Ee4qoqHi6tDrFgPvJqw== + dependencies: + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + +"@sentry/integrations@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.112.1.tgz#3334955adf93437c94ce6f7eb5518a031f8fc250" + integrity sha512-jIgXT+ahUS7zmhDMAzsgQHCNA6ZwZAp0Bwjoz0tcuGzNcv7mOCnjHz5YooJVQgXuREV653RmEuGGTklrpn6S2w== + dependencies: + "@sentry/core" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + localforage "^1.8.1" + +"@sentry/react@^7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.112.1.tgz#b2fcc6c0967dc038190878c36ab0b0d16895c368" + integrity sha512-q0fDW3omq/NPaL7yRqWA1USxGtEAcdFZOngIMsr9Bc4fJBGXDO+xLwPWjo1MIVvdDBJJYL/9Z56ppqTb3kiGXw== + dependencies: + "@sentry/browser" "7.112.1" + "@sentry/core" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + hoist-non-react-statics "^3.3.2" + +"@sentry/replay@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.112.1.tgz#a38c7b5c5c658ec4e957326e0fcdecc7fe5352df" + integrity sha512-4lobxfgmbB2C7ZHk1inWt9IRIvlQa2Sczau5ngE4Qd4mZSKIgIYGtIJC52uOuGvBcP8gHiIbA7ACihkd7834Ew== + dependencies: + "@sentry-internal/tracing" "7.112.1" + "@sentry/core" "7.112.1" + "@sentry/types" "7.112.1" + "@sentry/utils" "7.112.1" + +"@sentry/types@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.112.1.tgz#0a66b2e9f072181e7ec1a3cbf64e89e13aa561a4" + integrity sha512-5dLIxWZfCXH5kExrsWc+R6loMr3RR6OQuonVNL3Fa8Dw37Q7aExCrjRmocOHeQKhHwNBd3QhYm7phjnbxS6Oaw== + +"@sentry/utils@7.112.1": + version "7.112.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.112.1.tgz#518210c78384837109e4264fefcc3d166e665569" + integrity sha512-/AMGDD6OMvT2cpfL5KuDC10oTS8yOt7BAPomXJNS/xn1TRcEEEZ1TWbYZiGT5ijggQEL1OXSojpeQU8XEW8dcQ== + dependencies: + "@sentry/types" "7.112.1" + "@sideway/address@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" @@ -6725,6 +6818,11 @@ ignore@^5.2.0, ignore@^5.3.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== + immer@^9.0.21, immer@^9.0.7: version "9.0.21" resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.21.tgz#1e025ea31a40f24fb064f1fef23e931496330176" @@ -8024,6 +8122,13 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== + dependencies: + immediate "~3.0.5" + lilconfig@^2.0.3, lilconfig@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" @@ -8072,6 +8177,13 @@ loader-utils@^3.2.0: resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz#4fb104b599daafd82ef3e1a41fb9265f87e1f576" integrity sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw== +localforage@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -10787,16 +10899,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -10883,14 +10986,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -12085,7 +12181,7 @@ workbox-window@6.6.1: "@types/trusted-types" "^2.0.2" workbox-core "6.6.1" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -12103,15 +12199,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"