-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: posthog path to ignore #1054
Conversation
Hey @marandaneto! 👋 |
src/extensions/replay/config.ts
Outdated
@@ -68,7 +68,7 @@ const removeAuthorizationHeader = (data: CapturedNetworkRequest): CapturedNetwor | |||
return data | |||
} | |||
|
|||
const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/vo/e/'] | |||
const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/v0/e/', '/i/vo/e/', '/decide/', '/static/recorder-v2.js'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was vo
a typo or a valid one in the past?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets also ignore the recorder? URL https://eu-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally a typo...
let's keep it to just ingestion paths for now... others can be useful when viewing our own site
src/extensions/replay/config.ts
Outdated
@@ -68,7 +68,7 @@ const removeAuthorizationHeader = (data: CapturedNetworkRequest): CapturedNetwor | |||
return data | |||
} | |||
|
|||
const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/vo/e/'] | |||
const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/v0/e/', '/i/vo/e/', '/decide/', '/static/recorder-v2.js'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other option is to ignore the whole domain rather than just the paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was wondering about that... once the dust has settled we should have ingestion domain and non-ingestion domains and then we can ignore the ingestion domain
Size Change: +112 B (0%) Total Size: 864 kB
ℹ️ View Unchanged
|
// 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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if someone else has /i/my-important-data
then we won't capture it but let's cross that bridge when we come to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had a typo in the code that ignored ingestion paths so we were recording
i/v0/e/
well, not any more