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: Heatmaps ingestion #21629

Merged
merged 3 commits into from
Apr 23, 2024
Merged

feat: Heatmaps ingestion #21629

merged 3 commits into from
Apr 23, 2024

Conversation

benjackwhite
Copy link
Contributor

@benjackwhite benjackwhite commented Apr 18, 2024

Problem

Ingestion part of #21487

Related API PR #21623
Related JS PR PostHog/posthog-js#1131

Changes

  • Adds a new step for parsing the special $heatmaps_data property
  • Wrapped in try catch to make sure it doesn't affect overall event ingestion if it fails
  • Converts to new kafka events and returns them as delayed acks
  • One outstanding question about what to do if it errors

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

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

How did you test this code?

@benjackwhite benjackwhite requested review from bretthoerner, pauldambra and a team and removed request for bretthoerner April 18, 2024 07:49
@benjackwhite benjackwhite marked this pull request as ready for review April 18, 2024 07:50
@benjackwhite benjackwhite mentioned this pull request Apr 18, 2024
9 tasks
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

didn't run it but LGTM

Copy link
Contributor

@bretthoerner bretthoerner left a comment

Choose a reason for hiding this comment

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

Makes sense to me, the fact that it's in a try/catch and uses the existing ack system should mean it's safe. 👍

One thing I'm curious about: is this part of a JS SDK change that we'll just flip on for all autocapture events or something? The test heatmap data looks kind of large, is that representative? Can they be larger? Is there a limit or any protection in the SDK? I'm mostly wondering about data volume changes flowing through capture and multiple Kafka topics and whether we need to consider that all.

I don't have anything particular to worry about, it just got my spidey sense tingling.

@benjackwhite
Copy link
Contributor Author

benjackwhite commented Apr 23, 2024

Makes sense to me, the fact that it's in a try/catch and uses the existing ack system should mean it's safe. 👍

One thing I'm curious about: is this part of a JS SDK change that we'll just flip on for all autocapture events or something? The test heatmap data looks kind of large, is that representative? Can they be larger? Is there a limit or any protection in the SDK? I'm mostly wondering about data volume changes flowing through capture and multiple Kafka topics and whether we need to consider that all.

I don't have anything particular to worry about, it just got my spidey sense tingling.

maybe possibly. We have it as a JS change and it could indeed end up being a half decent amount of data. It is however client side flagged currently so we will be testing it just for our team for starters so we can get a better sense of how the data flow goes.

I think I'll add a server-side setting for it as well so that we can control it remotely to give us a little more reaction if we do end up seeing worrying sizes.

@benjackwhite benjackwhite merged commit 6183f88 into master Apr 23, 2024
98 checks passed
@benjackwhite benjackwhite deleted the feat/heatmaps-ingestion branch April 23, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants