0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
Commit Graph

63 Commits

Author SHA1 Message Date
Oliver Browne
24d497ee7b
feat: get property definitions out of plugin-server (#24843) 2024-09-09 11:15:49 +03:00
Ben White
16870d63fc
feat: Plugin server services refactor - take 2 (#24737) 2024-09-03 11:00:50 +02:00
Ben White
3f56346512
chore: Reverts "Plugin server services refactor (#24638)" (#24733) 2024-09-02 08:43:52 +00:00
Ben White
4684a2bc0d
chore: Plugin server services refactor (#24638) 2024-09-02 09:56:13 +02:00
Oliver Browne
9186a5bea8
fix: partial revert of #23669 (#24190) 2024-08-05 17:01:06 +03:00
Oliver Browne
5cd1bed543
chore: update cached team data when we notice the first event (#23669) 2024-07-12 18:57:10 +03:00
Tiina Turban
9734894bc2
feat: Remove groups properties and created from each event (#22962) 2024-07-10 13:07:58 +02:00
Brett Hoerner
0134bc2400
fix(plugin-server): use tx for create person step of merge (#23372) 2024-07-01 13:23:10 -06:00
Brett Hoerner
70549f834d
fix(plugin-server): write out less overrides on behalf of personless … (#23204)
* fix(plugin-server): write out less overrides on behalf of personless mode

* don't skip writing overrides (so we can backfill posthog_personlessdistinctid)

* swap ugly double-array params for array of objects

* bigint id for PersonlessDistinctId

* add LRU cache for posthog_personlessdistinctid inserts

* fix tests

* overzealous search and replace
2024-07-01 12:10:07 -06:00
Tiina Turban
f3c46473d2
feat: Reduce useless person updates (#22919) 2024-06-13 10:54:24 +02:00
Brett Hoerner
2e0406a551
chore(plugin-server): change captureIngestionWarning to not await acks (#22850)
* chore(plugin-server): change captureIngestionWarning to not await acks

* chore(plugin-server): move person kafka ack awaits to the batch-level… (#22772)

chore(plugin-server): move person kafka ack awaits to the batch-level await
2024-06-10 09:39:51 -06:00
Marius Andra
4f50326aec
fix(taxonomy): don't convert numeric strings to numbers (#19774) 2024-01-22 17:58:43 +01:00
Paul D'Ambra
d39e2c5c5e
fix: activity detection for rrweb data (#19621)
* fix: activity detection for rrweb data

* move tests out of process event - they don't need any of the setup there

* Add tests

* fix test name

* fix test name

* fix
2024-01-08 09:01:40 +00:00
Paul D'Ambra
fbb93232c4
feat: ingest with snapshot source (#19260)
* feat: ingest with snapshot source

* add replay events ingester tests

* fix test data insertion

* add test

* Update query snapshots

* fix test

* fix test

* fix test

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-15 12:21:23 +00:00
David Murphy
747597e093
perf: move UUID validation up in pipeline (#18317)
* Move UUID validation from `process` step to `prepare` step

* Move uuid validation all the way up to `populateTeamData`

* Update tests to use `processEvent` instead of `eventsProcessor.processEvent` since we moved the logic

* Add temporary vscode config to just run relavent tests

* Tests are fixed; was looking for an event that won't be produced

* Remove temp vscode debug config

* nit: remove added newline

* Fix another test that wasn't using a proper UUID

* Move UUID validation from `process` step to `prepare` step

* Move uuid validation all the way up to `populateTeamData`

* Update tests to use `processEvent` instead of `eventsProcessor.processEvent` since we moved the logic

* Add temporary vscode config to just run relavent tests

* Tests are fixed; was looking for an event that won't be produced

* Remove temp vscode debug config

* nit: remove added newline

* Fix another test that wasn't using a proper UUID

* Add missing import after git stupidity
2023-11-07 19:39:38 +00:00
David Newell
5e0eb334ce
fix: account for negative timestamps from rrweb (#17849) 2023-10-11 13:44:54 +01:00
Tiina Turban
bf8dcd7517
chore: Keep ip only within properties (#17674) 2023-10-05 21:00:58 +02:00
Paul D'Ambra
e1a55b9cb3
fix: we can receive strings that ClickHouse can't receive (#17792)
* fix: we can receive strings that ClickHouse can't receive

* let's not throw when gathering console logs

* don't accept arbitrary length content

* alright... a little longer content

* fix
2023-10-04 14:30:00 -07:00
Paul D'Ambra
7f6be4815b
fix: event is sometimes null (#17784) 2023-10-04 16:15:16 +00:00
Paul D'Ambra
fca26fd412
fix: safe string even safer (#17771) 2023-10-04 13:28:23 +00:00
Tiina Turban
ecd47719e3
chore: Ignore {} unset value instead of DLQ the event (#17633) 2023-09-27 18:08:24 +02:00
Paul D'Ambra
68a4e185bd
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>
2023-09-14 14:31:14 +01:00
Ben White
05079fa1a7
feat: Save app properties and others to Person from events (#17393) 2023-09-14 12:57:54 +02:00
Paul D'Ambra
da40d4c6cc
fix: force TS numbers to be ints (#17348)
* fix: force TS numbers to be ints

* fix

* fix

* fix
2023-09-12 20:31:10 +01:00
Xavier Vello
1b6628055d
feat(plugin-server): allow to use several PG connection pools (#17001)
Co-authored-by: Tiina Turban <tiina303@gmail.com>
2023-08-24 11:09:10 +02:00
Ben White
d8df34f4ab
feat: Replay events consumer (#16642) 2023-07-20 14:41:25 +00:00
Paul D'Ambra
8a29cc679f
feat: estimate size of session on ingestion (#16241)
* migration to add the new column

* and populate it

* fix

* Update query snapshots

* test assertions

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-27 08:12:42 +01:00
Paul D'Ambra
bdc346de41
feat: summarise console logs too (#15954)
We collect console logs in session recordings but you can't filter to find recordings that have them.

Worse, when we move to storing recordings in blob storage it would be impossible to filter for them.

Changes
adds new columns to the session replay summary table that will let us add counts of levels log, warn, and error from console logs collected with recordings
alters the recordings-ingestion consumer to count those three levels of log
2023-06-14 15:26:34 +01:00
Paul D'Ambra
4509f98628
feat: remove summary config guard (#15572)
* feat: remove summary config guard

* fix
2023-05-17 09:14:48 +01:00
Paul D'Ambra
067d73cb4f
feat: write recording summary events (#15245)
Problem
see #15200 (comment)

When we store session recording events we materialize a lot of information using the snapshot data column.

We'll soon not be storing the snapshot data so won't be able to use that to materialize that information, so we need to capture it earlier in the pipeline. Since this is only used for searching for/summarizing recordings we don't need to store every event.

Changes
We'll push a summary event to a new kafka topic during ingestion. ClickHouse can ingest from that topic into an aggregating merge tree table. So that we store (in theory, although not in practice) only one row per session.

add config to turn this on and off by team in plugin server
add code behind that to write session recording summary events to a new topic in kafka
add ClickHouse tables to ingest and aggregate those summary events
2023-05-09 14:41:16 +00:00
Harry Waye
997b3ff9dd
fix(plugin-server): only set ssl config when defined (#15071)
* Revert "Revert "perf(recordings): use node-librdkafka for ingester production" (#15069)"

This reverts commit ac5e084f48.

* fix(plugin-server): only set ssl config when defined

Hopefully this means it will use the global CA bundle.

* hack: enable debug logs

* honor KAFKAJS_LOG_LEVEL envvar

* add SegfaultHandler

* disable ssl verification

* debug -> info

* only log brokers

* Revert "add SegfaultHandler"

This reverts commit b22f40b802.

---------

Co-authored-by: Xavier Vello <xavier@posthog.com>
2023-04-13 16:52:51 +01:00
Xavier Vello
ac5e084f48
Revert "perf(recordings): use node-librdkafka for ingester production" (#15069)
Revert "perf(recordings): use node-librdkafka for ingester production (#15041)"

This reverts commit 7f852ab618.
2023-04-13 11:23:22 +01:00
Xavier Vello
7f852ab618
perf(recordings): use node-librdkafka for ingester production (#15041) 2023-04-13 11:55:16 +02:00
Xavier Vello
adc0acc4bc
chore(recordings): revert: use node-librdkafka for ingester production (#15032)
Revert "chore(recordings): use node-librdkafka for ingester production (#14460)"

This reverts commit c34979853e.
2023-04-11 17:10:49 +00:00
Harry Waye
c34979853e
chore(recordings): use node-librdkafka for ingester production (#14460)
Previously we've been using the KafkaJS Producer with a wrapper around
it to handle batching. There are a number of issues with the batching
implementation e.g. not having a way to provide guarantees on delivery
and rather than fix that, we can simply use the librdkafka Producer
which is a lot more mature and battle-tested.
2023-04-11 16:44:39 +01:00
Xavier Vello
2a5f6d3691
fix(tests): make getEventsByPerson output stable to avoid flakes (#15009) 2023-04-07 12:00:11 +00:00
Tiina Turban
0163b63dad
fix: Remove sentry noise for missing group_type (#14825) 2023-03-20 16:16:54 +01:00
Tiina Turban
f065757ae7
revert "chore: person props last-op/ts clean-up" (#14741)
Revert "chore: person props last-op/ts clean-up (#14316)"

This reverts commit 4bf7ddd8e9.
2023-03-14 16:36:44 +00:00
Tiina Turban
4bf7ddd8e9
chore: person props last-op/ts clean-up (#14316) 2023-03-14 16:35:53 +01:00
Tiina Turban
d35239c658
feat: Add merge_dangerously event (#14625) 2023-03-08 14:37:48 +01:00
Raquel Smith
bc9b449ae5
fix: set msclkid on person like gclid (#14386)
* set msclkid on person like gclid

* fix typos (thx copilot)
2023-02-24 19:35:35 +00:00
Tiina Turban
5f24e281b1
fix: groupidentify to always update props and ignore timestamps (#14240) 2023-02-21 17:07:47 +01:00
Harry Waye
ce777f7efa
fix: make sort order deterministic in property definitions manager test (#14266)
* fix: make sort order deterministic in property definitions manager test

I'd added an order in a previous PR, but its a UUID.

* fix sql statements
2023-02-16 12:10:53 +00:00
Harry Waye
da482a3cba
refactor(recordings): remove session code from event pipeline (#13919)
* refactor(recordings): remove session code from event pipeline

We have moved session recrodings to a separate topic and consumer. There
may be session recordings in the old topic, but we divert these to the
new logic for processing them.

* refactor to just send to the new topic!

* fix import

* remove empty line

* fix no team_id test

* implement recordings opt in

* remove old $snapshot unit tests

* remove performance tests

* Update plugin-server/functional_tests/session-recordings.test.ts

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* Update plugin-server/functional_tests/session-recordings.test.ts

Co-authored-by: Tiina Turban <tiina303@gmail.com>

* add back $snapshot format test

* Add comment re functional test assumptions

Co-authored-by: Tiina Turban <tiina303@gmail.com>
2023-01-27 12:36:45 +00:00
Karl-Aksel Puulmann
8930d9e460
feat: capture person/group property definitions (2/2) (#13816)
* feat: ingest person and group property definitions 2/2

* Update test
2023-01-20 15:42:00 +02:00
Karl-Aksel Puulmann
15b6ade4a0
feat: capture person/group property definitions (1/2) (#13809)
* migration for person/group property support in property definitions table

* Use database default

* Validate correct constraint

* Ingest person and group type property definitions

* Exclude person/group type definitions from API

* Update property definitions test

* Ignore $groups

* Add new unique index which accounts for type and group_type_index

* Run new code only in test

* Ignore errors from propertyDefinitionsManager which may occur due to migrations

* Update constraint name

* Update test describe

* ON CONFLICT based on the index expression

* Add a -- not-null-ignore

* Combine migrations

* Remove some test code temporarily

* fixup latest_migrations
2023-01-20 14:47:32 +02:00
Ben White
cb7e7d5e5e
feat: Added performance API (#13452) 2023-01-06 09:51:51 +01:00
Tiina Turban
a051f37a7a
feat(plugin-server): track person creation event uuid (#13102) 2022-12-05 20:11:23 +01:00
Yakko Majuri
aa89545a66
fix(ingestion): do not create or update person from $snapshot events (#13048)
* fix(ingestion): do not create or update person from  events

* fix tests
2022-12-01 10:37:53 -03:00
Tiina Turban
41c983cc93
chore: throw when we ran out of wait time waiting for CH ingestion (#12126) 2022-11-09 15:26:52 +01:00