From 163290bcf08eacaf8d62330b8fff92cf0701eab5 Mon Sep 17 00:00:00 2001 From: Brendan Allan <14191578+Brendonovich@users.noreply.github.com> Date: Fri, 1 May 2026 11:56:31 +0800 Subject: desktop: sentry integration (#15300) Co-authored-by: Jay V --- packages/desktop-electron/src/renderer/index.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'packages/desktop-electron/src') diff --git a/packages/desktop-electron/src/renderer/index.tsx b/packages/desktop-electron/src/renderer/index.tsx index 91ea1ae07..52dd6bef8 100644 --- a/packages/desktop-electron/src/renderer/index.tsx +++ b/packages/desktop-electron/src/renderer/index.tsx @@ -14,6 +14,7 @@ import { ServerConnection, useCommand, } from "@opencode-ai/app" +import * as Sentry from "@sentry/solid" import type { AsyncStorage } from "@solid-primitives/storage" import { MemoryRouter } from "@solidjs/router" import { createEffect, createResource, onCleanup, onMount, Show } from "solid-js" @@ -29,6 +30,25 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) { throw new Error(t("error.dev.rootNotFound")) } +if (import.meta.env.VITE_SENTRY_DSN) { + Sentry.init({ + dsn: import.meta.env.VITE_SENTRY_DSN, + environment: import.meta.env.VITE_SENTRY_ENVIRONMENT ?? import.meta.env.MODE, + release: import.meta.env.VITE_SENTRY_RELEASE ?? `desktop-electron@${pkg.version}`, + initialScope: { + tags: { + platform: "desktop-electron", + }, + }, + integrations: (integrations) => { + return integrations.filter( + (i) => + i.name !== "Breadcrumbs" && !(import.meta.env.OPENCODE_CHANNEL === "prod" && i.name === "GlobalHandlers"), + ) + }, + }) +} + void initI18n() const deepLinkEvent = "opencode:deep-link" -- cgit v1.2.3