Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(sentry): point users at a personal token when connecting sentry (#115065)

Tom Owers2f2bb736e1fa
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py
index 73d74eba74f5..a9395ec06708 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/sentry.py
@@ -1289,7 +1289,7 @@ def validate_credentials(
if response.status_code == 403:
return (
False,
- "Sentry token is missing required scopes. Create a token with these scopes and reconnect: "
+ "Your Sentry token is missing required scopes. Create a personal token with these scopes, then reconnect: "
+ ", ".join(REQUIRED_SENTRY_SCOPES)
+ ".",
)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/source.py
index e81707fce55f..394869a0f358 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/source.py
@@ -72,8 +72,11 @@ class SentrySource(ResumableSource[SentrySourceConfig, SentryResumeConfig]):
caption=(
"Enter a Sentry auth token and your organization slug to sync Sentry organization, "
"project, issue, and monitor datasets.\n\n"
- "Create a token in Sentry and make sure it includes the scopes below if you want to "
- "sync all datasets:\n" + "\n".join(f"- `{scope}`" for scope in REQUIRED_SENTRY_SCOPES) + "\n"
+ "Create a personal token in your "
+ "[Sentry account settings](https://sentry.io/settings/account/api/auth-tokens/) and make sure "
+ "it includes the scopes below if you want to sync all datasets:\n"
+ + "\n".join(f"- `{scope}`" for scope in REQUIRED_SENTRY_SCOPES)
+ + "\n"
),
docsUrl="https://posthog.com/docs/cdp/sources/sentry",
fields=cast(
@@ -84,7 +87,7 @@ class SentrySource(ResumableSource[SentrySourceConfig, SentryResumeConfig]):
label="Auth token",
type=SourceFieldInputConfigType.PASSWORD,
required=True,
- placeholder="324587...",
+ placeholder="sntryu_...",
secret=True,
),
SourceFieldInputConfig(
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/tests/test_sentry.py b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/tests/test_sentry.py
index 550d86a12fb4..b11566a618e7 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/tests/test_sentry.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/sentry/tests/test_sentry.py
@@ -303,7 +303,7 @@ class TestSentryTransport:
assert not valid
assert error is not None
- assert error.startswith("Sentry token is missing required scopes")
+ assert error.startswith("Your Sentry token is missing required scopes. Create a personal token")
for scope in REQUIRED_SENTRY_SCOPES:
assert scope in error