0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
Commit Graph

1507 Commits

Author SHA1 Message Date
Tim Glaser
c9fc4ac245
Fix clickhouse sessions (#1815) 2020-10-09 17:48:28 +03:00
Tim Glaser
a51942b556
Improve event properties display (#1825)
* Improve event properties display

* Improve event properties display

* Improve
2020-10-09 16:46:38 +02:00
Karl-Aksel Puulmann
8846e344e1
Only do session recording on permitted domains (#1830) 2020-10-09 17:45:33 +03:00
Karl-Aksel Puulmann
077fabc243
Get rid of caching in /decide endpoint (#1829)
The caching was causing `sessionRecording` to always be false => session
recording not to work.
2020-10-09 09:58:32 +02:00
Karl-Aksel Puulmann
78163a849b
Toggle for session recording (#1826)
* Fix userUpdateRequest type

* Add toggle (if feature turned on) for capturing sessions

* Make team.session_recording_opt_in editable
2020-10-08 17:50:39 +02:00
Yakko Majuri
bb1d44531f
Session Recording tests (#1827)
* added backend tests for sessions endpoint

* added cypress tests for person

* rerun tests

* updated backend tests

* Fix tests

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2020-10-08 18:25:52 +03:00
Marius Andra
2b71b3e752
Onboarding improvements (#1723) 2020-10-08 13:12:37 +02:00
Yakko Majuri
b9c3f0a4df
Added Session Recording (#1823)
* WIP

* wip sessions player

* improved types

* minor styling modal

* minor UI changes

* added sessions player behind feature flag

* added SessionsPlayerButton

* added sessions tab

* wip sessions in people

* do not display properties with underscore

* change delete approach

* wip

* hacky person sessions

* hide  property

* fix main sessions table

* get sessions for all ids

* update to  prop

* fix kea type error

* feature flagged person session table

* remove console.log

* make tab panes self-closing

* removed demo recording

Co-authored-by: Tim Glaser <tim@glsr.nl>
2020-10-08 12:37:33 +02:00
Karl-Aksel Puulmann
d4a00c9da2
Make session recording possible (#1821)
* Store rrweb.js under /static/recorder.js

This will be loaded by posthog.js and start the recording.

* Add new migration for Team.session_recording_opt_in

This will be used to figure out by posthog.js whether to capture session
data or not.

* Drop dead code

* refact: extract method

* Refactor decide endpoint to load team separately from calculating feature flags

This will be used for deciding whether to capture or not session
recordings

* Send `sessionRecording` key as part of decide endpoint

Will be used by posthog.js to turn recording on/off

* Make tests pass

* Make rrweb available
2020-10-08 11:09:35 +02:00
Marius Andra
e7a944ea96
Fix tsconfig.json lib property (#1818)
* fix tsconfig lib

* minor ts fix

Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>
2020-10-08 00:43:23 +02:00
James Greenhill
d27b8369b0
Update dockerfile for dev-ing (#1817) 2020-10-07 16:31:29 +02:00
Michael Matloka
34ad57c371
Fix status report period (#1810)
* Fix status report period

* Update tests and add a basic status_report one
2020-10-07 13:04:33 +02:00
Tim Glaser
0ced04cd4d
Fix email test (#1814) 2020-10-07 12:54:31 +02:00
Lee Yi Jie Joel
4a1f838048
Remove Trailing Spaces in Selector Box (#1621)
* Add beginnings of a test

* Remove trailing whitespaces

* Fix selector name

* Trigger pre-commit

Co-authored-by: Joel Lee <joel@Joels-MacBook-Pro.local>
2020-10-07 12:23:13 +02:00
Marius Andra
5729fb5f68
Toolbar Shadow Root Support (#1805)
* reset toolbar fonts (only things that leak through the shadow root)

* select elements from the shadow roots for "inspect"

* extract getParent

* select inside shadow roots for heatmap

* upgrade packages

* remove inline querySelectorDeep

* toolbar shadow dom trim

* improve toolbar no capture of itself

* improve a few things on the actions page

* also support actions

* use non-private query-selector-shadow-dom package
2020-10-07 10:17:28 +02:00
Tim Glaser
2cad2b16ec
[Clickhouse] fix event filtering (#1804) 2020-10-02 20:31:53 +02:00
Eric Duong
3a8982505a
Change session query to not collect events (#1802)
* use eventless query

* replace generateuuid
2020-10-02 14:05:43 -04:00
Tim Glaser
88c54896d0
Fix person querying (#1797)
* convert sessions table logic to TS

* convert rest of sessions to TS

* sessions table logic refactor, store date in the url

* add back/forward buttons

* load sessions based on the URL, not after mount --> avoids duplicate query if opening an url with a filter

* prevent multiple queries

* throw error if failed instead of returning an empty list

* date from filters

* rename offset to nextOffset

* initial limit/offset block

* indent sql

* support limit + offset

* load LIMIT+1 sessions in postgres, pop last and show load more sign. (was: show sign if exactly LIMIT fetched)

* based offset is always 0

* default limit to 50

* events in clickhouse sessions

* add elements to query results

* add person properties to sessions query response

* show seconds with two digits

* fix pagination, timestamp calculation and ordering on pages 2 and beyond

* mypy

* fix test

* add default time to fix test, fix some any(*) filter issues

* remove reverse

* WIP event list

* Events progress

* Finish off event listing, skip live actions for now

* Fix mypy

* Fix mypy again

* Try fixing mypy

* Fix assertnumqueries

* Fix tests

* Fix tests

* fix test

* Fix tests

* Fix tests

* Fix tests again

* Fix person querying

* Fix flake

* Fix person stuff

* Fix test

Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Eric <eeoneric@gmail.com>
2020-10-02 19:30:05 +02:00
Paolo D'Amico
e0de7795a0
Self-serve billing enrollment & management (#1721) 2020-10-02 16:20:24 +01:00
James Greenhill
b60b08f281
Add python version to posthog for automated deploys (#1795) 2020-10-02 08:54:20 +01:00
Tim Glaser
095dca9e97
Always limit events (#1794)
* Fix ambiguous timestamp ordering

* Always limit events
2020-10-01 18:13:32 +02:00
Tim Glaser
64a5ad7c9a
Fix ambiguous timestamp ordering (#1792) 2020-10-01 16:48:25 +02:00
Tim Glaser
73f327a13f
Fix dev docker build (#1791) 2020-10-01 16:24:43 +02:00
Yakko Majuri
059f3325b5
Create CODE_OF_CONDUCT.md (#1790) 2020-10-01 14:12:10 +00:00
Tim Glaser
92e8bbd283
[Clickhouse] Event list (#1787)
* convert sessions table logic to TS

* convert rest of sessions to TS

* sessions table logic refactor, store date in the url

* add back/forward buttons

* load sessions based on the URL, not after mount --> avoids duplicate query if opening an url with a filter

* prevent multiple queries

* throw error if failed instead of returning an empty list

* date from filters

* rename offset to nextOffset

* initial limit/offset block

* indent sql

* support limit + offset

* load LIMIT+1 sessions in postgres, pop last and show load more sign. (was: show sign if exactly LIMIT fetched)

* based offset is always 0

* default limit to 50

* events in clickhouse sessions

* add elements to query results

* add person properties to sessions query response

* show seconds with two digits

* fix pagination, timestamp calculation and ordering on pages 2 and beyond

* mypy

* fix test

* add default time to fix test, fix some any(*) filter issues

* remove reverse

* WIP event list

* Events progress

* Finish off event listing, skip live actions for now

* Fix mypy

* Fix mypy again

* Try fixing mypy

* Fix assertnumqueries

* Fix tests

* Fix tests

* fix test

* Fix tests

* Fix tests

* Fix tests again

Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Eric <eeoneric@gmail.com>
2020-10-01 15:47:35 +02:00
Yakko Majuri
b58ed0657a
made shared_dashboards endpoint exempt from x-frame-options header (#1789) 2020-10-01 13:05:17 +00:00
James Greenhill
46f72ba2c8
Search for cohorts that contain the given distinctIDs for feature flags (#1780)
* Search for cohorts that contain the given distinctIDs for feature flags

* remove unused file

* add tests

* finalize tests

* clean up unneeded imports

* fix garbage name
2020-10-01 05:41:40 -04:00
Marius Andra
80a699ef4e
Clickhouse Sessions + Frontend Sessions updates (#1754)
* convert sessions table logic to TS

* convert rest of sessions to TS

* sessions table logic refactor, store date in the url

* add back/forward buttons

* load sessions based on the URL, not after mount --> avoids duplicate query if opening an url with a filter

* prevent multiple queries

* throw error if failed instead of returning an empty list

* date from filters

* rename offset to nextOffset

* initial limit/offset block

* indent sql

* support limit + offset

* load LIMIT+1 sessions in postgres, pop last and show load more sign. (was: show sign if exactly LIMIT fetched)

* based offset is always 0

* default limit to 50

* events in clickhouse sessions

* add elements to query results

* add person properties to sessions query response

* show seconds with two digits

* fix pagination, timestamp calculation and ordering on pages 2 and beyond

* mypy

* fix test

* add default time to fix test, fix some any(*) filter issues

* remove reverse

* fix mypy error, indent SQL

* add pagination test for postgres

* Run insight API tests in Clickhouse

Co-authored-by: Eric <eeoneric@gmail.com>
2020-10-01 05:27:35 -04:00
Shashwat
d4459ab448
Changes to make person editable (resolves #89) (#1491)
* added editable table for person data

* update to setPerson, changes to make person editable

* Ran Prettier

* ran Eslint

* update user properties

* ran prettier

* don't allow person edit before change

* wakey wakey GitHub Actions

* fix to send person state to api.update

* Added antd's confirm modal to save/delete data , removed browser alert

* Delete Person Modal not in scope of current PR reverting delete moadal changes

* ran prettier

* Update Person.js

Remove unused import

* minor style change

* Fixed showing name which caused user with only is_demo true not show, save button now vsisble on all dimensions, is_demo is now editable

* minor style fixes

* Made Person's Number non-editable

* Disable input for PostHog internal varaiables

* added change to typecast to desired value

* added function description

* Handle diffrenet properties type.

* ran prettier

Co-authored-by: Yakko Majuri <yakko.majuri@gmail.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-30 17:22:55 +02:00
Eric Duong
83bf6056b6
change all to sync execute (#1776) 2020-09-30 11:18:35 -04:00
Eric Duong
b9e2aca322
[clickhouse] Fix rel time months (#1774)
* fix rel time months

* .
2020-09-30 10:49:04 -04:00
Paolo D'Amico
457ae83b80
Report all non-DRF exceptions to sentry (#1773)
* report all non-DRF exceptions to sentry

* update drf-exceptions-hog
2020-09-30 10:32:38 -04:00
James Greenhill
fad85a5f4e
Convert sync execute to use clickhouse connection pool (#1762)" (#1770) (#1771)
* Revert "Revert "Convert sync execute to use clickhouse connection pool (#1762)" (#1770)"

This reverts commit cbb8fb01a9.

* remove runtime requirement from posthog, that is convered in posthog-production

* Bump the max number of connections in the pool
2020-09-30 15:07:10 +01:00
James Greenhill
08f6879343
Bump posthoganalytics requirement for feature flag bugfixes (#1772) 2020-09-30 15:05:13 +01:00
James Greenhill
cbb8fb01a9
Revert "Convert sync execute to use clickhouse connection pool (#1762)" (#1770)
This reverts commit fedd2428aa.
2020-09-30 14:19:03 +01:00
James Greenhill
2db31e2cd7
Set heroku python runtime to python 3.8.6 (#1769)
* Set heroku python runtime to python 3.8.6

* Have tests run against python 3.8
2020-09-30 13:59:46 +01:00
Tim Glaser
ea7c156cc8
1684 allow ip override (#1744)
* Test commit

* Closes #1684 allow ip override in properties
2020-09-30 13:54:26 +02:00
Tim Glaser
8676de2a6e
Fix sessions team filtering (#1766)
* Fix sessions team filtering

* Improve str.format readability

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-30 13:42:31 +02:00
Yakko Majuri
3959b12610
change title of live actions table (#1756) 2020-09-30 12:04:39 +02:00
James Greenhill
fedd2428aa
Convert sync execute to use clickhouse connection pool (#1762)
* Convert sync execute to use clickhouse connection pool

* type fixes

* use pool for tests to feel safe
2020-09-29 19:26:58 +01:00
James Greenhill
389571df42
Test if any filters exist and if they do make sure there are properties to filter on for decide endpoint (#1759)
* Test if any filters exist and if they do make sure there are properties to filter on for decide endpoint

* nit fix
2020-09-29 12:06:52 -04:00
Marius Andra
37ccb7026f
Fix demo urls (#1757) 2020-09-29 12:06:21 -04:00
Eric Duong
e3e3501f2b
fix response (#1760) 2020-09-29 16:31:29 +01:00
James Greenhill
379518e285
"Clickhouse Features V2 (#1565)" (#1750)
* initial

* migration command

* migrations working

* add modelless views for clickhouse

* initial testing structure

* use test factory

* scaffold for all tests

* add insight and person api

* add basic readme

* add client

* change how migrations are run

* add base tables

* ingesting events

* restore delay

* remove print

* updated testing flow

* changed sessions tests

* update tests

* reorganized sql

* parametrize strings

* element list query

* change to seralizer

* add values endpoint

* retrieve with filter

* pruned code to prepare for staged merge

* working ingestion again

* tests for ee

* undo unneeded tests right now

* fix linting

* more typing errors

* fix tests

* add clickhouse image to workflow

* move to right job

* remove django_clickhouse

* return database url

* run super

* remove keepdb

* reordered calls

* fix type

* fractional seconds

* fix type error

* add checks

* remove retention sql

* fix tests

* add property storage and tests

* merge master

* fix tests

* fix tests

* .

* remove keepdb

* format python files

* update CI env vars

* Override defaults and insecure tests

* Update how ClickHouse database gets evaluated

* remove bootstrapping clickhouse database routine

* Don't initialize the clickhouse connection unless we say it's primary

* .

* fixed id generation

* remove dump

* black settings

* empty client

* add param

* move docker-compose for ch to ee dir

* Add _public_ key to repo for verifying self signed cert on server

* update ee compose file for ee dir

* fix a few issues with tls in migrations

* update migrations to be flexible about storage profile and engine

* black settings

* add elements prop tables

* add elements prop tables

* working filter

* refactored

* better url handling

* add mapping table

* add processing to worker task

* working cohort with actions

* add cohort property filtering

* add cohort property filtering

* reformat and add cohort processing

* prop clauses

* add util

* add more util

* add clickhouse modifier

* Clickhouse Sessions (#1623)

* sessions sql

* skeleton

* add endpoint

* better tests

* sessions list

* merge clickhouse-actions

* added session endpoint

* sessions sql working again

* add clickhouse modifier

* session avg with props working

* add dist

* tests working (no list)

* list working

* add formatting

* more formatting

* fix tests

* dummy commit

* fix types

* remove unnecessary improt

* ignore type when importing from ee in task

* fix test running

* Clickhouse Trends Base (#1609)

* initial working

* date param almost working

* fix date range and labels

* fixed monthly math

* handle compare

* change table

* using new event ingestion

* direct query actions working

* remove interface

* fix date range

* properties initial working

* handle operator

* handle operator

* move timestamp parse

* move more to util

* inital breaking down working

* working cohort breakdown

* some tests running

* fix sessions

* cohort tests

* action and interval test

* reorder cohort filtering

* rename retention test

* fix inits

* change multitenancy tests

* fix types

* fix optional types

* replace ch_client.execute with sync_execute

* replace ch_client.execute with sync_execute, part 2

* Clickhouse Stickiness + Process Event (#1654)

* generate clickhouse uuid script

* set CLICKHOUSE_SECURE=False by default if running in TEST or DEBUG

* convert person_id to UUID, make adding `person_id` optional, add distinct_ids already in the `create_person` function

* Fix test_process_event_ee.py, remove all calls to Person.objects.*

* add back util

* fix broken imports

* improve process_event test clickhouse queries

* Basic stickiness query

* Clickhouse Stickiness tests

* stickiness test [WIP, actions fail]

* generate clickhouse uuid script

* change default test runner if PRIMARY_DB=clickhouse

* fix stickiness test for actions

* fix merge bug

* remove _create_person stub; cohort person_id is UUID now

* fix typing

* Clickhouse trends process math (#1660)

* most of process math works

* all process math

* fix ordering issue

* unusued imports

* update property comparison for process_event_ee

* indentation wrong missing calls

* demo users and events (#1661)

* finish breakdown filtering tests and reformat label function

* add increment to demo_data

* update demo data populating

* Add people endpoint for ch (#1670)

* add people endpoint for ch

* stickiness people

* fix value padding

* add process math to breakdown and

* add limit

* fix tests

* condensed code

* converted test to factory

* add people tests

* add month handling

* add typing fix

* change people test handling

* fix tests

* Clickhouse funnels 2 (#1668)

* add elements to create_event

* WIP closes #1663 Add funnels to clickhouse

* Make funnels work

* Clean up

* Move filtering around

* Add mypy tests and fix

* Performance improvements

* fix person tests again

* add people for funnel endpoint

* fix prop numbering

Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Eric <eeoneric@gmail.com>

* merge master

* add retention

* update types

* more typing errors

* fix types

* bug with kafka payload, elements insert, and demo data

* Clickhouse Paths (#1657)

* paths clickhouse test (fails)

* add elements to create_event

* make this fail for clickhouse

* hardcoded query that returns good results for $pageviews, no filters yet

* clean up queries

* bound by time, fix 30min new session boundary

* support screen and custom events

* add properties filter

* paths url

* filter by path start

* better path start test

* even better path start test

* start from the first "path start" in a group

* test for person_id in paths

* partition by person_id for POSTGRES paths

* partition by person_id for Clickhouse paths

* clean up order in paths test

* clean up order in paths test

* join elements

* force element order on element group creation

* remove "order" when creating elements in tests and demo

* get list of elements for paths

* add limit to paths query

* use materialized view

* rename "element_hash" to "elements_hash" (no change in db)

* cull rows that are definitely unused

* simplify query

* New highly optimized paths clickhouse query

* start_point for $autocapture paths

* extract event property values from clickhouse

* prevent crash

* select one element sql

* get elements for event

* remove lodash

* remove host from $pageview path elements if same domain as incoming path

* show metadata based on loaded paths filter, not in flight filter

* fix order (all soures and targets in order, not all sources first, then all targets after) - makes for a better looking graph

* add test that makes the Postgres paths query fail

* fix postgres paths --> no fuzzy matching, breaks "starts with" for urls and gives too many incorrect start points

* create automatic /demo urls that match the real urls (no ending /)

* fix elements queries

* path element joins

* create persons via postgres in paths test

* change serializers back to id

* fix tests with uuid

* fix demo

* more bugs

* fix type

* change now to timezone aware

* [clickhouse] retention filters (#1725)

* implemented target entity and prop filtering

* add insight view override

* fix endpoint and filters

* include tests

* fix tests

* add period filtering

* .

* fix pg param name

* add filtering params to both queries in retention sql

* fix param again

* change to todatetime

* change tz to timezone

* add back timezone in model/event

* [clickhouse] feature flag endpoint requests (#1731)

* add feature flags to endpoints

* add flags to endpoints that check on request

* remove magic strings and fill in missing flags

* fix types

* add missing flag

* change from iso

* fix more timestamps and comparator

* change _people to get_people in actions view

* remove action and cohort populating

* change inheritance

* "Clickhouse Features V2 (#1565)"

This reverts commit 0b371d43ec.

* fix types

* change to super

* change to super x2

Co-authored-by: Eric <eeoneric@gmail.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Tim Glaser <tim.glaser@hiberly.com>
2020-09-29 15:17:26 +01:00
Tim Glaser
6cbe76f401
Bump posthog analytics version (#1751) 2020-09-29 15:51:55 +02:00
Michael Matloka
13e32aaff9
Replace uuid4 and uuid1_macless with UUIDT (#1726)
* Replace uuid1_macless with UUIDT

* Add machine_component

* Update comment

* Remove machine_component in favor of larger time_component

* Update UUIDT docstring
2020-09-29 15:39:18 +02:00
Marius Andra
bf326b3fde
fix toolbar fade container click block (#1753) 2020-09-29 12:37:26 +01:00
James Greenhill
0b371d43ec
Revert "Clickhouse Features (#1565)" (#1748)
This reverts commit 24713b923d.
2020-09-29 12:11:28 +01:00
Paolo D'Amico
b3532c598a
Weekly report email V1 (#1700) 2020-09-29 11:56:29 +01:00
Tim Glaser
d54ee5234e
Add personal api key (#1747)
* Test commit

* Add personal key

* Consistency
2020-09-29 11:52:07 +01:00