0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
Commit Graph

8541 Commits

Author SHA1 Message Date
James Greenhill
8e5d1da3aa
feat: Add GeoIP2 capability to Django app (for feature flags) (#10890)
* feat: add libmaxminddb0 as dependency. C library will speed things up significantly

* pin libmaxminddb to 1.5 for whats available from APK

* get geolite2 db during build

* add settings for geoip2 django contrib library

* black formatting

* consistently use share director

* isort fixes

* remove GeoLite2-City.mmdb from git and add script to ./bin/start to download it if file does not exist

* remove GeoLite2-City.mmdb from git

* add doc for share directory expaining why it exists

* relative path for curl in build

* shared vs share consistency

* Update snapshots

* brotli decompress

* ..everywhere

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: neilkakkar <neilkakkar@users.noreply.github.com>
2022-07-25 17:20:11 -07:00
Harry Waye
ed49d1338b
fix(person): ensure person api params url encoded (#10954)
* fix(person): ensure person api params url encoded

When calling /api/persons/ we were passing in ?distinct_id=asdf as the
query string. If that distinct_id contained e.g. a + sign then it
wouldn't load the person.

Instead we parse through `toParams` which calls `encodeURIComponent`.

* add test
2022-07-25 16:34:09 +01:00
Harry Waye
328534b9fd
chore(codespaces): add env vars for running codespaces dev (#10923)
* chore(codespaces): add env vars for running codespaces dev

These will be used by vscode and any terminals spawned

* Use default python interpreter

* chore(codespaces): add env vars for running codespaces dev

These will be used by vscode and any terminals spawned

* Use default python interpreter

* add kafka to hosts

* fix hosts

* add to hosts on docker run

* keep python path

* wip
2022-07-25 15:21:00 +01:00
Rafal Mierzwiak
99f1e4ed84
chore(deps): add missing packages (#10924)
* chore(deps): add monaco-editor

To address warning:

  @monaco-editor/react@4.1.3 has unmet peer dependency monaco-editor@^0.23.0

* chore(deps): add require-from-string

To address warning:

  @storybook/react@6.5.9 has unmet peer dependency require-from-string@^2.0.2

* chore(deps): add testing-library/dom

To address warning:

  @testing-library/user-event@13.5.0 has unmet peer dependency @testing-library/dom@>=7.21.4

* Update typing

Co-authored-by: Michael Matloka <dev@twixes.com>
2022-07-25 16:04:11 +02:00
Karl-Aksel Puulmann
612d62610e
perf(plugin-server): speed up getPluginConfigRows (#10952)
This is currently one of our slowest queries. The query itself is fine
but the amount of data returned is causing issues.

`error` column constitutes >80% of data stored in the column - by
removing it in the query we should see significant speedups.

pganalyze page: https://app.pganalyze.com/databases/-675880137/queries/5301003665?t=7d
2022-07-25 16:27:18 +03:00
Karl-Aksel Puulmann
b2b5aba160
chore(plugin-server): add metrics for storage.set/storage.get (#10943)
storage.set is one of our slowest operations, so being able to have
metrics on what plugins/teams are causing load helps us make good
decisions
2022-07-25 16:21:20 +03:00
Karl-Aksel Puulmann
e00b458dd8
fix(plugin-server): don't query source column for posthog_plugin (#10949)
This column is quite large and unused. Large columns slow down queries
due to extra data being sent back and forth.
2022-07-25 16:00:22 +03:00
posthog-contributions-bot[bot]
2e280a352d
chore(contributors): 🤖 - Add gitstart as a contributor 🎉 (#10950) 2022-07-25 14:29:13 +02:00
GitStart
43c4787cb7
fix(apps): Change "Managed by PostHog" tag to "Global" (#10946)
* Feature Request: Remove/Change 'Managed by PostHog' tag on apps

* Only show "Global" for orgs that can install own plugins

* Use correct file

* Only show "Global" for orgs that can install own plugins

Co-authored-by: GitStart <gitstart@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2022-07-25 14:07:06 +02:00
Karl-Aksel Puulmann
6c521a26f0
chore(plugins): track when plugins get reloaded (#10945)
Currently, plugins are reloaded when new plugins are installed, removed,
etc (even when new teams join). This causes plugin-servers to reload all
plugin code.

This PR adds tracking for that behavior (via logs) so we can see if
incidents related to loading plugin data are correlated with not only
deploys but this.
2022-07-25 10:12:36 +00:00
Paul D'Ambra
21c026d3e8
chore: report dashboard age in viewed dashboard event (#10940) 2022-07-25 09:37:17 +01:00
Paul D'Ambra
a76c59341f
feat: remove csv export flag (#10939)
* remove csv export flag

* act on todo

* Address some errors

* fix test
2022-07-25 09:36:59 +01:00
Paul D'Ambra
7094a44e8d
feat: export from insight cards (#10938) 2022-07-25 09:35:14 +01:00
Paul D'Ambra
0c4e64e7bf
chore: log ages of tiles as the cache update sees them (#10937) 2022-07-22 20:34:14 +01:00
Rick Marron
06570c5454
fix(recordings): add ON CLUSTER to recordings TTL statement (#10934) 2022-07-22 09:29:19 -07:00
Tiina Turban
b46933c1c0
chore: remove job queue env that matches default (#10930) 2022-07-22 15:00:22 +02:00
Paul D'Ambra
041137ac43
chore: go over the top with capturing error info when update fails (#10931) 2022-07-22 12:11:48 +01:00
Harry Waye
d7998cef30
Revert "chore(dev): use network mode host for docker-compose services (#10917)" (#10926)
This reverts commit 225a41db72.
2022-07-22 10:25:59 +01:00
Rick Marron
e223e7ec37
fix(recordings): decrease activity threshold (#10920)
* fix(recordings): decrease activity threshold

* try 10 sec
2022-07-21 11:38:56 -07:00
Tiina Turban
8245c102f9
chore: nuke unused NEW_PERSON_PROPERTIES_UPDATE_ENABLED_TEAMS (#10919) 2022-07-21 20:17:39 +02:00
Yakko Majuri
a8687f896e
fix: don't pull unnecessary plugin data in the plugin server (#10909)
* fix: don't pull unnecessary plugin data in the plugin server

* fix tests

* fix test 2

Co-authored-by: Tiina Turban <tiina303@gmail.com>
2022-07-21 16:47:55 +00:00
posthog-contributions-bot[bot]
8b3c62ba62
chore(contributors): 🤖 - Add rafalmierzwiak as a contributor 🎉 (#10905)
* docs: update README.md

* docs: update .all-contributorsrc

Co-authored-by: posthog-contributions-bot[bot] <80958034+posthog-contributions-bot[bot]@users.noreply.github.com>
2022-07-21 15:49:11 +00:00
Harry Waye
225a41db72
chore(dev): use network mode host for docker-compose services (#10917)
* chore(dev): use network mode host for docker-compose services

This removes the need to add kafka to /etc/hosts.

As far as I can tell this should be fine for peoples local dev except
they will be required to reset and re-migrate ClickHouse tables as they
will be trying to pull from `kafka` instead of `localhost`.

* remove ports from redis

* Update a few more references
2022-07-21 15:29:31 +01:00
Paul D'Ambra
36dc7a2d5e
fix: update cache keys in sync and async paths (#10910)
* fix: update cache keys in sync and async paths

* also update out-of-date shared insights

* refactor move method

* refactor for clarity

* update mock patch reference

* Update snapshots

* chore: log each insight as the cache processes it

Co-authored-by: pauldambra <pauldambra@users.noreply.github.com>
2022-07-21 14:56:00 +01:00
Harry Waye
aefc3ab0f2
fix(persons): make sure "uuid" returned in person response (#10911)
* fix(persons): make sure "uuid" returned in person response

We reference this in a few places but it was omitted from the response
by https://github.com/PostHog/posthog/pull/10868/files

This simply adds it back in.

Relates to the issue mentioned in Slack
[here](https://posthogusers.slack.com/archives/C01GLBKHKQT/p1658349671498709)

* only add to persons serializer, avoid changes to groups

* Update snapshots

* add uuid to group response test

Co-authored-by: hazzadous <hazzadous@users.noreply.github.com>
2022-07-21 13:41:59 +00:00
Harry Waye
40616f0d7c
chore(dev): clean up background jobs on EXIT and prop. exit code (#10916)
We were for instance calling trap at a point where it wouldn't get
called, and giving special status to some processes to run in the
foreground.

Instead we:

 1. wait for any process exit
 2. use it's exit code for the calling process
 3. kill background processes on EXIT
2022-07-21 13:32:38 +00:00
Paul D'Ambra
1cb2e3224a
feat: when refreshing tiles ignore any that were refreshed in the last 3 minutes (#10895) 2022-07-20 16:56:13 +01:00
Paul D'Ambra
14deb2d7a5
feat: show link to dashboard in success toast when creating (#10902)
* feat: show link to dashboard in success toast when creating

* a button for my horse
2022-07-20 16:43:51 +01:00
James Greenhill
2a6417a586
chore: Reduce surface area for attack on default hobby deploys (#10891)
* chore: Reduce surface area for attack on default hobby deploys

* typo fix
2022-07-20 08:43:21 -07:00
Paul D'Ambra
f8a661c5fe
fix: have only way to create new dashboards (#10841)
* chore: remove the multi dashboard insight flag

* rename modal now flag is removed

* hook the add to dashboard modal and the new dashboard modal together, allowing user to choose whether to load the dashboard on success

* set show on success to false from insight add to dashboard modal

* wire up description

* use checkbox in form, not switch

* use buttons not checkbox
2022-07-20 15:48:31 +01:00
Neil Kakkar
2844833382
fix(universal-search): Bring back persons search (#10900) 2022-07-20 14:43:33 +01:00
PostHog bot
fa46d7781d
chore(deps): Update plugin-scaffold to 1.3.2 (#10901) 2022-07-20 15:39:46 +02:00
Harry Waye
e7a9b7de79
fix(autocapture): ensure $elements passed to onEvent (#10880)
* fix(autocapture): ensure `$elements` passed to `onEvent`

Before calling `onEvent` the plugin does, amoung other things, a delete
on `event.properties` of the `$elements` associated with `$autocapture`.
This means that for instance the S3 plugin doesn't include this data in
it's dump.

We could also include other data like `elements_chain` that we also
store in `ClickHouse` but I've gone for just including `elements` for
now as `elements_chain` is derived from `elements` anyhow.

* revert .env changes, I'll do that separately

* run prettier

* update to scaffold 1.3.0

* fix lint

* chore: update scaffold to 1.3.1

* update scaffold
2022-07-20 14:33:32 +01:00
Neil Kakkar
a0c4747c3d
fix(person-querying): Use the right person property (#10898) 2022-07-20 14:26:36 +01:00
Neil Kakkar
6c04bfad04
fix(experiments): Show experiment feature flags in list (#10654) 2022-07-20 12:59:26 +00:00
Neil Kakkar
2b370c2d1a
fix(data-management): Allow property type updates (#10897) 2022-07-20 13:55:25 +01:00
Yakko Majuri
4bce5dfa8a
feat: (bring back) buffer 3.0 again (#10896)
* Revert "Revert "feat: (bring back) buffer 3.0  (#10874)" (#10883)"

This reverts commit e203bc7cfa.

* reduce graphile load
2022-07-20 12:16:13 +00:00
Neil Kakkar
9b3f48d10a
feat(feature-flags): Allow property overrides for feature flags (#10872) 2022-07-20 13:10:55 +01:00
timgl
d0ae76d6f1
perf(Persons): Use clickhouse for person endpoint (#10868)
* perf(Persons): Use clickhouse for person endpoint

* update api

* Use uuids everywhere

* fix cohort id

* Update snapshots

* Update snapshots

* fix api

* fix order by

* Update snapshots

* Update snapshots

* fix api

* fix api

* Update snapshots

* fix ordering

* Update snapshots

* Update snapshots

* fix nits

* Update snapshots

Co-authored-by: timgl <timgl@users.noreply.github.com>
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2022-07-20 12:07:01 +00:00
Eric Duong
23e6c33bf3
fix(funnel-breakdown): bad link (#10750)
* fix-10691

* remove log

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2022-07-20 10:54:39 +00:00
Tiina Turban
d0343368b8
fix: don't spam sentry with coordinator not aware errors (#10703) 2022-07-20 11:36:52 +02:00
Guido Iaquinti
d010c76585
chore(load_data_from_request): make sure it's a dict (#10878) 2022-07-20 09:56:30 +02:00
Paul D'Ambra
47fd0b2f3d
chore: gauge tiles with no hash to statsd (#10885)
* chore: gauge tiles with no hash to statsd

* but not every thirty seconds, that would be silly

* remove unused variable

* no need to read settings way at the top of the file
2022-07-20 08:09:47 +01:00
posthog-contributions-bot[bot]
1abdb19c60
chore(contributors): 🤖 - Add klink as a contributor 🎉 (#10888) 2022-07-20 01:10:27 +02:00
James Greenhill
033dc8d07f
fix: Return a 400 when decide gets a request missing distinct_id (#10887)
* fix: Return a 400 when decide gets a request missing distinct_id

* small cleanup, use var instead of grabbing out of dict
2022-07-19 22:56:13 +00:00
Paul D'Ambra
a6bfbf76dd
chore: emit to statsd count of tiles with None for filters hash as they are updated (#10884) 2022-07-19 21:14:27 +02:00
Yakko Majuri
e203bc7cfa
Revert "feat: (bring back) buffer 3.0 (#10874)" (#10883)
This reverts commit 3e772b8614.
2022-07-19 17:50:06 +00:00
Yakko Majuri
e8e28e5d0b
fix: move back to docker builds for production deployment job only (#10881) 2022-07-19 10:21:44 -07:00
Yakko Majuri
3e772b8614
feat: (bring back) buffer 3.0 (#10874)
* Revert "Revert "feat: buffer 3.0 (graphile) (#10735)" (#10802)"

This reverts commit ca8c4d0271.

* add metrics and error tracking
2022-07-19 16:34:07 +00:00
Yakko Majuri
47fc0052ce
chore: bump graphile-worker to v0.13.0 (#10876) 2022-07-19 15:26:52 +00:00