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(settings): clarify debug-info session link is internal, not public (#60833)

posthog[bot]1a6c5ac474e3
diff --git a/frontend/src/lib/components/Support/supportLogic.test.ts b/frontend/src/lib/components/Support/supportLogic.test.ts
new file mode 100644
index 000000000000..f427b73d6a27
--- /dev/null
+++ b/frontend/src/lib/components/Support/supportLogic.test.ts
@@ -0,0 +1,34 @@
+import posthog from 'posthog-js'
+
+import { OrganizationBasicType, Region, TeamPublicType } from '~/types'
+
+import { getPublicSupportSnippet } from './supportLogic'
+
+describe('supportLogic snippet helpers', () => {
+ const mockedGetReplayUrl = posthog.get_session_replay_url as jest.Mock
+ const organization = { id: 'org-1', name: 'Test org' } as OrganizationBasicType
+ const team = { id: 42 } as TeamPublicType
+
+ beforeEach(() => {
+ mockedGetReplayUrl.mockReset()
+ })
+
+ it('rewrites the session line to the internal golink for staff triage', () => {
+ mockedGetReplayUrl.mockReturnValue(`${window.location.origin}/replay/abc?t=30`)
+ const snippet = getPublicSupportSnippet(Region.US, organization, team, false)
+ expect(snippet).toContain('Session: http://go/session/abc?t=30')
+ expect(snippet).not.toContain(`${window.location.origin}/replay/`)
+ })
+
+ it('omits the session line when there is no recording', () => {
+ mockedGetReplayUrl.mockReturnValue(undefined)
+ const snippet = getPublicSupportSnippet(Region.US, organization, team, false)
+ expect(snippet).not.toContain('Session:')
+ })
+
+ it('marks the admin line as internal', () => {
+ mockedGetReplayUrl.mockReturnValue(undefined)
+ const snippet = getPublicSupportSnippet(Region.US, organization, team, false)
+ expect(snippet).toContain('Admin (internal): http://go/adminOrg')
+ })
+})
diff --git a/frontend/src/lib/components/Support/supportLogic.ts b/frontend/src/lib/components/Support/supportLogic.ts
index f0c7b4fad34b..8365d5fcdad2 100644
--- a/frontend/src/lib/components/Support/supportLogic.ts
+++ b/frontend/src/lib/components/Support/supportLogic.ts
@@ -43,7 +43,7 @@ export function getPublicSupportSnippet(
return (
(includeCurrentLocation ? getCurrentLocationLink() : '') +
getSessionReplayLink() +
- `\nAdmin: http://go/adminOrg${cloudRegion}/${currentOrganization?.id} (project ID ${currentTeam?.id})`
+ `\nAdmin (internal): http://go/adminOrg${cloudRegion}/${currentOrganization?.id} (project ID ${currentTeam?.id})`
).trimStart()
}
@@ -52,11 +52,15 @@ function getCurrentLocationLink(): string {
return `\nLocation: ${cleanedCurrentUrl}`
}
+// The recording lives in PostHog's own telemetry project, which the reporting user is not a member
+// of, so this link is for PostHog staff triaging the ticket/issue — never the user. We rewrite to the
+// internal http://go/session/ golink to make that explicit.
function getSessionReplayLink(): string {
- const replayUrl = posthog
- .get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 })
- .replace(window.location.origin + '/replay/', 'http://go/session/')
- return `\nSession: ${replayUrl}`
+ const replayUrl = posthog.get_session_replay_url?.({ withTimestamp: true, timestampLookBack: 30 })
+ if (!replayUrl) {
+ return ''
+ }
+ return `\nSession: ${replayUrl.replace(window.location.origin + '/replay/', 'http://go/session/')}`
}
function getErrorTrackingLink(uuid?: string): string {
@@ -102,14 +106,14 @@ function getDjangoAdminLink(
return ''
}
const link = `https://${cloudRegion.toLowerCase()}.posthog.com/admin/posthog/user/${user.id}/change/`
- return `\nAdmin: ${link} (organization ID ${currentOrganization?.id}: ${currentOrganization?.name}, project ID ${currentTeam?.id}: ${currentTeam?.name})`
+ return `\nAdmin (internal): ${link} (organization ID ${currentOrganization?.id}: ${currentOrganization?.name}, project ID ${currentTeam?.id}: ${currentTeam?.name})`
}
function getBillingAdminLink(currentOrganization: OrganizationBasicType | null): string {
if (!currentOrganization) {
return ''
}
- return `\nBilling admin: http://go/billing/${currentOrganization.id}`
+ return `\nBilling admin (internal): http://go/billing/${currentOrganization.id}`
}
const SUPPORT_TICKET_KIND_TO_TITLE: Record<SupportTicketKind, string> = {
diff --git a/frontend/src/scenes/settings/environment/TeamSettings.tsx b/frontend/src/scenes/settings/environment/TeamSettings.tsx
index 09039baea74d..c33e109e0338 100644
--- a/frontend/src/scenes/settings/environment/TeamSettings.tsx
+++ b/frontend/src/scenes/settings/environment/TeamSettings.tsx
@@ -96,7 +96,11 @@ function DebugInfoPanel(): JSX.Element | null {
<h3 id="debug-info" className="min-w-[25rem]">
Debug information
</h3>
- <p>Include this snippet when creating an issue (feature request or bug report) on GitHub.</p>
+ <p>
+ Include this snippet when creating an issue (feature request or bug report) on GitHub. The session and
+ admin links inside it are internal references the PostHog team uses to look into your report — they only
+ resolve for PostHog staff.
+ </p>
{anyLoading ? (
<LemonSkeleton repeat={2} active={true} />
) : (