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

Heatmaps #8529

Open
ccschmitz opened this issue May 10, 2024 — with Linear · 2 comments
Open

Heatmaps #8529

ccschmitz opened this issue May 10, 2024 — with Linear · 2 comments

Comments

Copy link
Contributor

Would probably require storing click events in Clickhouse.

Copy link

linear bot commented May 10, 2024

HIG-4634 Heatmaps

Copy link

greptile-apps bot commented May 10, 2024

To implement heatmap functionality by storing click events in Clickhouse, follow these steps:

  1. Schema Design: Adapt the schema used in /backend/clickhouse/migrations/000024_create_logs_sampling_table.up.sql to include fields relevant to click events, such as PageURL, ElementSelector, ClientX, ClientY, and ViewportSize.
  2. Data Insertion: Use the insertion query pattern from /backend/clickhouse/README.md to create a new query for inserting click event data. Example:
    INSERT INTO click_events (Timestamp, ProjectId, PageURL, ElementSelector, ClientX, ClientY, ViewportSize) VALUES (now(), 1, '/home', '#submit', 100, 150, '1920x1080');
  3. Query for Heatmaps: Develop a query to aggregate click events by ElementSelector and PageURL, similar to the log keys aggregation in /backend/clickhouse/README.md. This will be used to generate heatmap data.
  4. Worker Integration: Utilize the event processing framework in /backend/worker/worker.go to batch process and write click events to Clickhouse. You might need to adapt processEventChunk to handle click event data.

These steps provide a high-level overview. Specific implementation details will depend on the existing codebase structure and data handling practices.

References

/backend/clickhouse/README.md
/backend/clickhouse/sessions.go
/backend/clickhouse/traces.go
/backend/clickhouse/errors.go
/backend/clickhouse/migrations/000024_create_logs_sampling_table.up.sql
/backend/worker/worker.go

Ask Greptile

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

No branches or pull requests

1 participant