diff --git a/docker-compose.common.yml b/docker-compose.common.yml index bec91fb87..39092867f 100644 --- a/docker-compose.common.yml +++ b/docker-compose.common.yml @@ -7,7 +7,8 @@ services: - NEXTAUTH_URL=http://localhost:3000 - NEXT_PUBLIC_API_URL=http://localhost:8080 - POSTHOG_KEY=phc_muk9qE3TfZsX3SZ9XxX52kCGJBclrjhkP9JxAQcm1PZ - - POSTHOG_HOST=https://app.posthog.com + - POSTHOG_HOST=https://ingest.keephq.dev + - NEXT_PUBLIC_SENTRY_DSN=https://0d4d59e3105ffe8afa27dcb95a222009@o4505515398922240.ingest.us.sentry.io/4508258058764288 - PUSHER_HOST=localhost - PUSHER_PORT=6001 - PUSHER_APP_KEY=keepappkey diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 2d2da6fcb..40e727b48 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -5,6 +5,7 @@ services: service: keep-frontend-common environment: - API_URL=http://keep-backend-dev:8080 + - SENTRY_DISABLED=true build: dockerfile: docker/Dockerfile.dev.ui volumes: diff --git a/docker/Dockerfile.ui b/docker/Dockerfile.ui index 549506c3e..6b0d4210a 100644 --- a/docker/Dockerfile.ui +++ b/docker/Dockerfile.ui @@ -65,10 +65,11 @@ EXPOSE 3000 ENV PORT 3000 ENV POSTHOG_KEY=phc_muk9qE3TfZsX3SZ9XxX52kCGJBclrjhkP9JxAQcm1PZ -ENV POSTHOG_HOST=https://app.posthog.com +ENV POSTHOG_HOST=https://ingest.keephq.dev ENV PUSHER_HOST=localhost ENV PUSHER_PORT=6001 ENV PUSHER_APP_KEY=keepappkey +ENV NEXT_PUBLIC_SENTRY_DSN=https://0d4d59e3105ffe8afa27dcb95a222009@o4505515398922240.ingest.us.sentry.io/4508258058764288 ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/docs/deployment/configuration.mdx b/docs/deployment/configuration.mdx index b88f09c9a..eaa04d439 100644 --- a/docs/deployment/configuration.mdx +++ b/docs/deployment/configuration.mdx @@ -147,6 +147,15 @@ Posthog configuration controls Keep's integration with the Posthog analytics pla | **POSTHOG_API_KEY** | API key for PostHog analytics | No | "phc_muk9qE3TfZsX3SZ9XxX52kCGJBclrjhkP9JxAQcm1PZ" | Valid PostHog API key | | **POSTHOG_DISABLED** | Disables PostHog integration | No | "false" | "true" or "false" | +### Sentry + +Sentry configuration controls Keep's integration with Sentry for error monitoring and reporting. These settings are important for maintaining the stability and reliability of your Keep instance. + + +| Env var | Purpose | Required | Default Value | Valid options | +|:-------------------:|:-------:|:----------:|:-------------:|:-------------:| +| **SENTRY_DISABLED** | Disables Sentry integration | No | "false" | "true" or "false" | + ### Ngrok Ngrok configuration enables secure tunneling to your Keep instance. These settings are particularly useful for development or when you need to expose your local Keep instance to the internet securely. diff --git a/keep-ui/.gitignore b/keep-ui/.gitignore index 6eca4f651..c5284b935 100644 --- a/keep-ui/.gitignore +++ b/keep-ui/.gitignore @@ -43,3 +43,6 @@ jspm_packages app/topology/mock-topology-data.tsx .vercel + +# Sentry Config File +.env.sentry-build-plugin diff --git a/keep-ui/app/error.tsx b/keep-ui/app/error.tsx index 406c4fe5b..44eec59a9 100644 --- a/keep-ui/app/error.tsx +++ b/keep-ui/app/error.tsx @@ -9,8 +9,9 @@ import "./error.css"; import { useEffect } from "react"; import { Title, Subtitle } from "@tremor/react"; import { Button, Text } from "@tremor/react"; -import { signOut } from "next-auth/react"; import { KeepApiError } from "@/shared/lib/KeepApiError"; +import * as Sentry from "@sentry/nextjs"; +import { useSignOut } from "@/shared/lib/useSignOut"; export default function ErrorComponent({ error, @@ -19,8 +20,10 @@ export default function ErrorComponent({ error: Error | KeepApiError; reset: () => void; }) { + const signOut = useSignOut(); + useEffect(() => { - console.error(error); + Sentry.captureException(error); }, [error]); return ( @@ -48,7 +51,7 @@ export default function ErrorComponent({ {error instanceof KeepApiError && error.statusCode === 401 ? (