Skip to content

Commit

Permalink
fix: sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin authored and andelf committed Mar 18, 2022
1 parent e162971 commit 8454ec1
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 304 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"@excalidraw/excalidraw": "0.10.0",
"@kanru/rage-wasm": "0.2.1",
"@logseq/react-tweet-embed": "1.3.1-1",
"@sentry/browser": "6.4.1",
"@sentry/electron": "2.5.1",
"@sentry/react": "^6.18.2",
"@sentry/tracing": "^6.18.2",
"@tabler/icons": "1.54.0",
"@tippyjs/react": "4.2.5",
"chokidar": "3.5.1",
Expand Down
4 changes: 3 additions & 1 deletion resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"update-electron-app": "2.0.1",
"extract-zip": "2.0.1",
"diff-match-patch": "1.0.5",
"https-proxy-agent": "5.0.0"
"https-proxy-agent": "5.0.0",
"@sentry/electron": "2.5.1",
"posthog-js": "1.10.2"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.57",
Expand Down
13 changes: 7 additions & 6 deletions src/main/frontend/modules/instrumentation/sentry.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
(:require [frontend.version :refer [version]]
[frontend.util :as util]
[frontend.config :as cfg]
["@sentry/browser" :as Sentry]
["@sentry/electron" :as Sentry-electron]
["@sentry/react" :as Sentry]
["@sentry/tracing" :refer [BrowserTracing]]
["posthog-js" :as posthog]))

(def config
{:dsn "https://[email protected]/5311485"
:release (util/format "logseq@%s" version)
:environment (if cfg/dev? "development" "production")
:integrations [(new posthog/SentryIntegration posthog "logseq" 5311485)]
:platform (if (util/electron?) "electron" "web")
:integrations [(new posthog/SentryIntegration posthog "logseq" 5311485)
(new BrowserTracing)]
:debug cfg/dev?
:tracesSampleRate 1.0})

(defn init []
(let [config (clj->js config)
init-fn (if (util/electron?) Sentry-electron/init Sentry/init)]
(init-fn config)))
(let [config (clj->js config)]
(Sentry/init config)))
Loading

0 comments on commit 8454ec1

Please sign in to comment.