diff --git a/.env.example b/.env.example index ff34c3226..e8b8fb9c9 100644 --- a/.env.example +++ b/.env.example @@ -8,6 +8,9 @@ VITE_DICOM_WEB_NAME=ACME Hospital # Error reporting URL for sentry.io. VITE_SENTRY_DSN= +# Sentry environment label, such as production or development. Defaults to production. +VITE_SENTRY_ENVIRONMENT= + # VolView server remote URL VITE_REMOTE_SERVER_URL=http://localhost:4014 diff --git a/src/utils/errorReporting.ts b/src/utils/errorReporting.ts index 226b967e6..284efd757 100644 --- a/src/utils/errorReporting.ts +++ b/src/utils/errorReporting.ts @@ -4,7 +4,7 @@ import { useLocalStorage } from '@vueuse/core'; import { defineStore } from 'pinia'; import { App, ref, watch } from 'vue'; -const { VITE_SENTRY_DSN } = import.meta.env; +const { VITE_SENTRY_DSN, VITE_SENTRY_ENVIRONMENT } = import.meta.env; export const LOCAL_STORAGE_KEY = 'error-reporting-off'; @@ -16,6 +16,7 @@ export const init = (app: App) => { Sentry.init({ app, dsn: VITE_SENTRY_DSN, + environment: VITE_SENTRY_ENVIRONMENT || undefined, }); try {