Skip to content

Commit

Permalink
just the ingestion paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Mar 5, 2024
1 parent e86ad1e commit f2bdc4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/__tests__/extensions/replay/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,14 @@ describe('config', () => {
],
[
{
name: 'https://app.posthog.com/i/vo/e/',
name: 'https://app.posthog.com/i/v0/e/',
},
undefined,
],
[
{
// even an imaginary future world of rust session replay capture
name: 'https://app.posthog.com/i/v0/s/',
},
undefined,
],
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/replay/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ const removeAuthorizationHeader = (data: CapturedNetworkRequest): CapturedNetwor
return data
}

const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/v0/e/', '/i/vo/e/', '/decide/', '/static/recorder-v2.js']
const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/']
// want to ignore posthog paths when capturing requests, or we can get trapped in a loop
// because calls to PostHog would be reported using a call to PostHog which would be reported....
const ignorePostHogPaths = (data: CapturedNetworkRequest): CapturedNetworkRequest | undefined => {
const url = convertToURL(data.name)
if (url && url.pathname && POSTHOG_PATHS_TO_IGNORE.includes(url.pathname)) {
if (url && url.pathname && POSTHOG_PATHS_TO_IGNORE.some((path) => url.pathname.startsWith(path))) {
return undefined
}
return data
Expand Down

0 comments on commit f2bdc4c

Please sign in to comment.