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: heatmap storage and API #21623

Merged
merged 19 commits into from
Apr 23, 2024
Merged

feat: heatmap storage and API #21623

merged 19 commits into from
Apr 23, 2024

Conversation

pauldambra
Copy link
Member

Splitting parts out of #21487 which was a good spike PR but needs breaking up now

This adds

  • the CH table
  • the HogQL wiring
  • an API reading heatmaps from the table using HogQL

@pauldambra pauldambra requested a review from fuziontech as a code owner April 17, 2024 18:48
@pauldambra pauldambra requested a review from benjackwhite April 17, 2024 19:33
Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

A few things - @pauldambra let me know if you want me to implement the changes suggested

@pauldambra
Copy link
Member Author

🤣 we both did it...

good test of how consistent a change would be if we both did it 🤣

@pauldambra
Copy link
Member Author

paging @fuziontech 😊

plz can we do these things to the clickhouse

Copy link
Member

@fuziontech fuziontech left a comment

Choose a reason for hiding this comment

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

Thanks for the reminder here @pauldambra 🙏 I needed the bump from last week so I appreciate that. This looks great - only one request to add a few kafka virtual columns, but that's totally optional.

image

pointer_target_fixed Bool,
current_url VARCHAR,
type LowCardinality(String),
_timestamp DateTime
Copy link
Member

Choose a reason for hiding this comment

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

something else that would be lovely to add here are the following virtual columns:
_offset
_partition

We've really wished to have these on tables in the past - would be super cool to start adding them here.

-- * width
-- we'll almost never query this by session id
-- so from least to most cardinality that's
ORDER BY (type, team_id, toDate(timestamp), current_url, viewport_width)
Copy link
Member

Choose a reason for hiding this comment

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

love it, this is perfect. Well done 🙏

pointer_target_fixed,
current_url,
type,
_timestamp
Copy link
Member

Choose a reason for hiding this comment

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

same thing here:
something else that would be lovely to add here are the following virtual columns:
_offset
_partition

We've really wished to have these on tables in the past - would be super cool to start adding them here.

f"TRUNCATE TABLE IF EXISTS {HEATMAPS_DATA_TABLE()} ON CLUSTER '{settings.CLICKHOUSE_CLUSTER}'"
)

INSERT_SINGLE_HEATMAP_EVENT = """
Copy link
Member

Choose a reason for hiding this comment

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

This is a scary bit of text - as long as it's only ever used for testing we are good!

@pauldambra
Copy link
Member Author

@benjackwhite I have confirmed the migration and ingestion with these latest changes locally (well, I was on partition 0 but the offset was populating)

am in and out all morning but feel free to merge without waiting for me - or I'll do it this afternoon

@pauldambra
Copy link
Member Author

  • primed kafka setup on master
  • then switched to this branch and migrated
  • and could see the heatmap
Screenshot 2024-04-23 at 11 14 12

@pauldambra pauldambra merged commit a3c1c21 into master Apr 23, 2024
98 checks passed
@pauldambra pauldambra deleted the feat/heatmaps-storage-and-api branch April 23, 2024 10:41
Copy link

sentry-io bot commented Apr 24, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ *CHQueryErrorCannotCompileRegexp: DB::Exception: OptimizedRegularExpression: cannot compile re2: , error: no argument for repetiti... /api/heatmap/ View Issue
  • ‼️ EOFError: Unexpected EOF while reading bytes /api/heatmap/ View Issue

Did you find this useful? React with a 👍 or 👎

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