feat: Add support for self-hosted Sentry instances with configurable URL (#2887)

This commit is contained in:
vagelim 2024-12-19 02:02:24 -05:00 committed by GitHub
parent 694de75052
commit c004bc8932
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,7 @@ type sentryConfig struct {
OrganizationSlug string `json:"organization_slug"`
ProjectSlug string `json:"project_slug"`
Token string `json:"token"`
URL string `json:"url"`
}
type SentryEvent struct {
@ -46,8 +47,14 @@ func (s *sentryClient) FetchSessionData(credentials interface{}, sessionID uint6
if val, ok := strCfg["token"].(string); ok {
cfg.Token = val
}
if val, ok := strCfg["url"].(string); ok {
cfg.URL = val
}
requestUrl := fmt.Sprintf("https://sentry.io/api/0/projects/%s/%s/issues/", cfg.OrganizationSlug, cfg.ProjectSlug)
}
if cfg.URL == "" {
cfg.URL = "https://sentry.io" // Default to hosted Sentry if not specified
}
requestUrl := fmt.Sprintf("%s/api/0/projects/%s/%s/issues/", cfg.URL, cfg.OrganizationSlug, cfg.ProjectSlug)
testCallLimit := 1
params := url.Values{}