From c004bc89322e7af8be4726a1b99492cf8852f94d Mon Sep 17 00:00:00 2001 From: vagelim Date: Thu, 19 Dec 2024 02:02:24 -0500 Subject: [PATCH] feat: Add support for self-hosted Sentry instances with configurable URL (#2887) --- backend/pkg/integrations/clients/sentry.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/pkg/integrations/clients/sentry.go b/backend/pkg/integrations/clients/sentry.go index fdc6218c2..b70d88ad8 100644 --- a/backend/pkg/integrations/clients/sentry.go +++ b/backend/pkg/integrations/clients/sentry.go @@ -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{}