feat: Add support for self-hosted Sentry instances with configurable URL (#2887)
This commit is contained in:
parent
694de75052
commit
c004bc8932
1 changed files with 8 additions and 1 deletions
|
|
@ -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{}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue