only capture non sign up secret events

This commit is contained in:
Maidul Islam
2023-08-31 20:58:07 -04:00
parent 37ae05fa2a
commit a7b3d12844
+4 -1
View File
@@ -583,7 +583,10 @@ export const getSecretsHelper = async ({
} }
} }
if (postHogClient) { const numberOfSignupSecrets = (secrets.filter((secret) => secret?.metadata?.source === "signup")).length;
const atLeastOneNonSignUpSecret = (secrets.length - numberOfSignupSecrets > 0)
if (postHogClient && atLeastOneNonSignUpSecret) {
const shouldCapture = authData.userAgent !== K8_USER_AGENT_NAME || shouldRecordK8Event; const shouldCapture = authData.userAgent !== K8_USER_AGENT_NAME || shouldRecordK8Event;
const approximateForNoneCapturedEvents = secrets.length * 10 const approximateForNoneCapturedEvents = secrets.length * 10