-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sentry: allow specify a DSN for backend #17363
Conversation
@@ -60,12 +60,21 @@ func Init() { | |||
return | |||
} | |||
|
|||
if conf.Get().Log.Sentry == nil { | |||
sentryConfig := conf.Get().Log.Sentry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can Log
ever be nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, it's a pointer so it can; practically, unlikely (not sure though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I misunderstood your comment.
5 lines above, we checked Log
:
if conf.Get().Log == nil {
|
||
// Fallback to default DSN if the backend DSN is not specified separately | ||
if backendDSN == "" { | ||
backendDSN = sentryConfig.Dsn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: BackendDSN
and Dsn
have different cases fordsn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh... you're right, but Dsn
is code-generated (which I hope one day it could generate DSN, HTTP etc.). For native Go names, I prefer DSN
over Dsn
.
Codecov Report
@@ Coverage Diff @@
## main #17363 +/- ##
==========================================
- Coverage 51.88% 51.88% -0.01%
==========================================
Files 1713 1713
Lines 84963 84963
Branches 7588 7748 +160
==========================================
- Hits 44083 44080 -3
- Misses 36976 36977 +1
- Partials 3904 3906 +2
|
Adds a new site config option
"log": { "sentry": { "backendDSN": "<REDACTED>" } }
to set a separate Sentry DSN only for backend errors.Part of #16109