feat: add sentry #879
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/sentry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
5c7efb9cc0
tof23a52e008
@ -33,1 +33,3 @@
//
// Enable error tracking with sentry. If this is set to true, will send anonymized data to
// our sentry instance to notify us of potential problems.
window.SENTRY_ENABLED = false
Since the API_URL is can be changed at runtime and the window.API_URL is basically the "poor mans store" for the url I thought that makes kind of sense for now.
In contrast Sentry shouldn't be something that can be changed at runtime.
Maybe we can use here: https://vitejs.dev/guide/env-and-mode.html#production-replacement
The problem with using vite's env variables is they are not changable without recompiling everything. I'd like self-hosters to be able to enable sentry without recompiling everything, hence the window variable. I think it is fine if you'll need to change it in the index.html file before it has an effect, much like the api url.
Having a déjà vu(e) again: I thought I ansered here already :D
Makes sense what you write! I guess is a specific need / usecase for Vikunja =)
@ -127,6 +129,24 @@ app.config.globalProperties.$message = {
success,
}
import * as Sentry from '@sentry/vue'
The imports should happen inside the conditional block.
Best would be to split them in an external package aswell.
This makes especially sence since some blockers might else block some main application chunk that includes sentry.
Not sure: can sentry be loaded async? Or is that against what they recommend?
They mention something about loading it async in their docs: https://docs.sentry.io/clients/javascript/install/
So I think it should be fine to extract this in a separate component and load that ansync on startup.
Extracted and now loading async.
Cool :) I think the link is from the legacy version. This seems to be the new: https://docs.sentry.io/platforms/javascript/install/lazy-load-sentry/
@ -130,0 +136,4 @@
Sentry.init({
app,
dsn: 'https://7e684483a06a4225b3e05cc47cae7a11@sentry.kolaente.de/2',
The
dsn
should be an env variable aswell.Thinking here of the Twelve-Factor App methodology.
Done!
94681f0280
tod1d8c8274c
@konrad: I added
SENTRY_DSN
to the window interface. The rest looks good 👍I've changed that sentry dsn since we now have sponsoring! 🥳
Probably a lot more reliable than what I'm able to host.
Ayyy, coool 🥳