Skip to content
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

feat(capture): Add setting to be able to disable capture overflow entirely #21168

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

tkaemming
Copy link
Contributor

@tkaemming tkaemming commented Mar 26, 2024

Problem

We want to be able to skip random partitioning (i.e. overflow) entirely for capture and let plugin-server take the wheel here. See #20945 for more details, #20945 (comment) in particular.

Changes

  • Adds CAPTURE_ALLOW_RANDOM_PARTITIONING setting to support wholesale disabling of random partitioning (i.e. null key overflow routing) for analytics events.

Does this work well for both Cloud and self-hosted?

Yes, no impact -- defaults to existing behavior for now.

How did you test this code?

Updated existing test to cover the new setting in both states.

@tkaemming tkaemming marked this pull request as ready for review March 27, 2024 00:07
@tkaemming tkaemming requested a review from a team March 27, 2024 00:07
posthog/settings/ingestion.py Outdated Show resolved Hide resolved
or historical
not historical
and settings.CAPTURE_ALLOW_RANDOM_PARTITIONING
and (distinct_id.lower() in LIKELY_ANONYMOUS_IDS or is_randomly_partitioned(candidate_partition_key))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love me some parens, and also bringing kafka_partition_key down here.

Co-authored-by: Brett Hoerner <brett@posthog.com>
@tkaemming tkaemming merged commit d929ca9 into master Mar 28, 2024
76 checks passed
@tkaemming tkaemming deleted the disable-capture-overflow branch March 28, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants