-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: count replay events in ClickHouse as we ingest them (#16994)
* feat: count replay events in ClickHouse as we ingest them * Add to hogql db schema * Update query snapshots * Update query snapshots * Update query snapshots * don't need it on kafka table * Update query snapshots * update desired columns * switch to counting events and messages * Update query snapshots * first pass addition of _timestamp * maybe like this * like this? * Update query snapshots * explicit message count * Update query snapshots * Update query snapshots * Update query snapshots * Update query snapshots * Update UI snapshots for `chromium` (2) * Update query snapshots * hogql db schema too * Update query snapshots * Update UI snapshots for `chromium` (2) * fix --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5906ea8
commit 68a4e18
Showing
11 changed files
with
159 additions
and
9 deletions.
There are no files selected for viewing
Binary file modified
BIN
-30.2 KB
(69%)
frontend/__snapshots__/scenes-app-recordings--recent-recordings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11.7 KB
(64%)
...-snapshots/Navigation-App-Page-With-Side-Bar-Hidden-Mobile-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7.54 KB
(79%)
...s-snapshots/Navigation-App-Page-With-Side-Bar-Shown-Mobile-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
posthog/clickhouse/migrations/0048_session_replay_events_count.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from posthog.clickhouse.client.migration_tools import run_sql_with_exceptions | ||
from posthog.models.session_replay_event.migrations_sql import ( | ||
DROP_SESSION_REPLAY_EVENTS_TABLE_MV_SQL, | ||
DROP_KAFKA_SESSION_REPLAY_EVENTS_TABLE_SQL, | ||
ADD_EVENT_COUNT_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL, | ||
ADD_EVENT_COUNT_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL, | ||
ADD_EVENT_COUNT_SESSION_REPLAY_EVENTS_TABLE_SQL, | ||
) | ||
from posthog.models.session_replay_event.sql import ( | ||
SESSION_REPLAY_EVENTS_TABLE_MV_SQL, | ||
KAFKA_SESSION_REPLAY_EVENTS_TABLE_SQL, | ||
) | ||
|
||
operations = [ | ||
# we have to drop materialized view first so that we're no longer pulling from kakfa | ||
# then we drop the kafka table | ||
run_sql_with_exceptions(DROP_SESSION_REPLAY_EVENTS_TABLE_MV_SQL()), | ||
run_sql_with_exceptions(DROP_KAFKA_SESSION_REPLAY_EVENTS_TABLE_SQL()), | ||
# now we can alter the target tables | ||
run_sql_with_exceptions(ADD_EVENT_COUNT_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL()), | ||
run_sql_with_exceptions(ADD_EVENT_COUNT_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL()), | ||
run_sql_with_exceptions(ADD_EVENT_COUNT_SESSION_REPLAY_EVENTS_TABLE_SQL()), | ||
# and then recreate the materialized views and kafka tables | ||
run_sql_with_exceptions(KAFKA_SESSION_REPLAY_EVENTS_TABLE_SQL()), | ||
run_sql_with_exceptions(SESSION_REPLAY_EVENTS_TABLE_MV_SQL()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters