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.

785 B
Raw Blame
import { droppedBloatPropertyCounter } from '~/ingestion/common/metrics'

// Persistence cache keys that leak from older posthog-js versions into event
// payloads. The SDK stopped sending these in posthog-js#3392; this server-side
// strip covers in-flight and pinned clients. `ph_product_tours` alone embeds
// full tour definitions up to 247 KB per event.
export const BLOAT_PROPERTIES: ReadonlySet<string> = new Set([
    'ph_product_tours',
    '$product_tours_activated',
    '$override_feature_flag_payloads',
])

export function stripBloatProperties(properties: Record<string, any>): void {
    for (const key of BLOAT_PROPERTIES) {
        if (key in properties) {
            delete properties[key]
            droppedBloatPropertyCounter.labels(key).inc()
        }
    }
}