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

219 Commits

Author SHA1 Message Date
Frank Hamand
69eb2e8fd3
Allow us to set gunicorn backlog (#17559) 2023-09-20 22:14:16 +01:00
Frank Hamand
789bc23c91
feat: Add kafka rack aware injection on docker-server (#17541)
Add kafka rack aware injection on docker-server

Currently we only inject this in plugin-server (aka reading from kafka)

Let's add it as well to docker-server (aka capture/writing to kafka)
2023-09-20 10:14:58 +01:00
Brett Hoerner
5b5d0d43a3
chore(plugin-server): make it easier to run multiple plugin-server instances locally (#17456)
* chore(plugin-server): allow customizing the HTTP server port

* chore(plugin-server): add NO_WATCH mode for development

* fix: http-server test
2023-09-15 08:55:46 -06:00
Ben White
bbb7ed9968
feat: Added recording of e2e test runs (#16046)
Marius nerd-sniped us to try this out. Recording of Cypress runs.

Co-authored-by: Paul D'Ambra <paul@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-10 15:59:30 +01:00
Ben White
8deaf4e8ea
feat: Swapped to use KAFKA_HOSTS everywhere (#16109)
* Swapped to use KAFKA_HOSTS everywhere

* Fixed up type of kafka config options and setup separate kafka hosts for blob consumer

* allow session recordings to have its own kafka security protocol

* remove slash commands from this pr

* syntax must be obeyed

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* fix

* Update query snapshots

* no empty strings in kafka hosts

* fix snapshot

* fix test

---------

Co-authored-by: Paul D'Ambra <paul@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-19 12:15:17 +01:00
Xavier Vello
f194a5b5a2
feat(ingestion): add KAFKA_CLIENT_RACK envvar for az locality (#15807) 2023-06-16 11:17:32 +02:00
Harry Waye
b761a34b23
ci: fix waiting for temporal to be up in backend tests (#16039)
* ci: fix waiting for temporal to be up in backend tests

I think it got merged before because we weren't running the backend
tests on these script changes so I've also added them to the list of
paths to watch for changes.

* increase timeout to 180 seconds
2023-06-14 06:07:49 +00:00
Harry Waye
352dc85956
ci: fix temporal port number 8088 -> 7233 (#16031)
I'm not sure what happened there, but for some reason it was fine with
8088 but I think the right one if 7233.
2023-06-13 16:57:25 +00:00
Harry Waye
6ec12d5376
ci: wait for temporal to be up before running backend tests (#16017)
* ci: wait for temporal to be up before running backend tests

If we don't wait, then there are some tests that fail because temporal
isn't up yet. These tests ideally shouldn't be using the real temporal
server, but rather the test server that is spun up when e.g. using
`temporalio.testing.WorkflowEnvironment` although for the sake of
getting tests to not be flaky, this is a good enough solution for now.
2023-06-13 14:23:52 +00:00
Neil Kakkar
db4d0a205d
feat(decide): Add proper analytics for decide requests (#15837) 2023-06-06 17:14:13 +01:00
Paul D'Ambra
0e1bc77216
chore: don't wait for e2e tests if only changing the plugin server (#15671)
If you only change the plugin server you spend a long time waiting for e2e CI to run.

It doesn't use the plugin server (I don't think)

So, don't run it...
2023-05-30 09:55:18 +01:00
Tomás Farías Santana
aa943d9349
fix: Unset debug in temporal start django worker (#15552) 2023-05-15 17:05:31 +00:00
Michael Matloka
08eab1f9c0
style: Fix "Posthog" capitalization (#15426)
* style: Fix "Posthog" capitalization

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-09 18:31:34 +02:00
Tomás Farías Santana
794c340e81
fix: Set hobby deployments to 'latest' by default (#14956) 2023-04-06 10:09:51 -07:00
Tomás Farías Santana
c30bdc4c82
fix: Checkout git tag corresponding to Docker image (#14909) 2023-03-29 17:07:34 +02:00
Tomás Farías Santana
6f39b68dd2
fix: Add missing script to start temporal worker (#14908) 2023-03-27 16:59:29 +02:00
James Greenhill
0223d7ab86
feat: Add Temporal to the dev and hobby stacks (#14658)
* feat: Add Temporal to the dev and hobby stacks

* disable elastic for hobby because of resources

* checkpoint

* update requirements

* worker is up, but without the sandbox

* ensure temporal does not depend on elastic

* Feedbacked

* pip-compile dev

* mypy fixes

* add a bit of colorful logging

* add django temporal worker to the mix

* checkpoint for dev-full docker

* Working on docker-full, but checkpointing for now

* add migration bits for full
2023-03-20 16:56:14 -06:00
Michael Matloka
42401f6664
test(login): Verify that Google login link is correct (#14668)
* test(login): Verify that Google login link is correct

* Revert `service_warning`
2023-03-10 10:15:42 +00:00
Ben White
c5c18f4e15
feat: Make recorder-v2 available (#14363) 2023-02-22 11:55:04 +00:00
Harry Waye
dfe389dfdc
chore: fix typing of int arguments in migrate_kafka_data.py (#14304)
* chore: fix typing of int arguments in migrate_kafka_data.py

I'd given defaults but didn't ensure the types were right.

* decrease linger
2023-02-17 19:24:57 +00:00
Harry Waye
c8bf85b3af
chore(kafka-migrate-data): add SSL options to migrate command (#14300)
Previously, the migrate command would fail if the Kafka cluster was
configured to use SSL. This commit adds and option to specify e.g `SSL`,
`PLAINTEXT`, `SASL_SSL` etc. as per
https://kafka.apache.org/25/javadoc/org/apache/kafka/common/security/auth/SecurityProtocol.html
2023-02-17 18:11:53 +00:00
Alex Gyujin Kim
76396d18c0
chore(recordings): bundle recorder.js in posthog-js (#14121) 2023-02-15 13:50:52 +01:00
Paul D'Ambra
7a7a274b07
chore: remove no-migrations from ./bin/tests (#14190) 2023-02-13 10:07:44 +00:00
Neil Kakkar
408a778f5e
chore(billing): Make local dev for enterprise less painful (#14023)
chore(billing): Make local dev less painful
2023-01-31 14:57:15 +00:00
Thomas Obermüller
4a30e78b22
chore: use pnpm to manage dependencies (closes #12635) (#13190)
* chore: use pnpm to manage dependencies

* Fix CI errors

* Don't report Docker image size for external PRs

* Fix pnpm-lock.yaml formatting

* Fix module versions

* Ignore pnpm-lock.yaml

* Upgrade Cypress action for pnpm support

* Set up node and pnpm before Cypress

* Fix typescript issues

* Include patches directory in Dockerfile

* Fix Jest tests in CI

* Update lockfile

* Update lockfile

* Clean up Dockerfile

* Update pnpm-lock.yaml to reflect current package.json files

* remove yarn-error.log from .gitignore

* formatting

* update data exploration readme

* type jest.config.ts

* fix @react-hook issues for jest

* fix react-syntax-highlighter issues for jest

* fix jest issues from query-selector-shadow-dom

* fix transform ignore patterns and undo previous fixes

* add missing storybook peer dependencies

* fix nullish coalescing operator for storybook

* reorder storybook plugins

* update editor-update-tsd warning to new npm script

* use legacy ssl for chromatic / node 18 compatibility

* use pnpm for visual regression testing workflow

* use node 16 for chromatic

* add @babel/plugin-proposal-nullish-coalescing-operator as direct dependency

* try fix for plugin-server

* cleanup

* fix comment and warning

* update more comments

* update playwright dockerfile

* update plugin source types

* conditional image size reporting

* revert react-native instructions

* less restrictive pnpm verions

* use ref component name in line with style guide

Co-authored-by: Jacob Gillespie <jacobwgillespie@gmail.com>
2022-12-12 10:28:06 +01:00
James Greenhill
647c3c408c
fix: Upgrade docker-compose when we upgrade the hobby stack (#13204) 2022-12-07 19:21:49 -08:00
James Greenhill
8a297770df
fix: Don't use tmpl ext for docker-compose base yml (#13202) 2022-12-08 02:45:23 +00:00
James Greenhill
c311af5630
fix: Have hobby upgrade script extend base docker-compose (#13168) 2022-12-06 20:02:11 +00:00
Michael Matloka
4a9ee98d40
fix(bin): Format hobby-ci.py and run black in CI for bin/*.py (#13090) 2022-12-02 14:52:12 +01:00
James Greenhill
9b45f3c5bc
fix: Hobby ci fixes so that the branch is actually tested (#13085)
* chore: test hobby ci

* tweak how hobby is tested

* fix was caddy related

* Fix up passing the branch

* send GITHUB_SHA

* ok ok use
2022-12-01 20:45:00 -08:00
James Greenhill
6c5503cef9
feat: Have a local docker-compose stack for developing 100% in docker (#13025)
* feat: Have a local docker-compose stack for developing 100% in docker

* lol found a docker-compose bug where you can't have volumes created in root dir

* scale -> deploy.replicas

* don't forget to add image for asyncmigrationscheck

* env vars to each component

* Rename local to dev-full
2022-11-30 09:49:17 -08:00
James Greenhill
295603563f
fix(settings): test account default hostname filter (#11592) (#13024)
* fix(test-account-filter): use 'event' type for filter

* fix(test-account-filter): sanitize filter for old bad data

* nope

* fix type

* fix test

Co-authored-by: Michael Matloka <dev@twixes.com>

Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2022-11-29 23:12:58 +00:00
James Greenhill
696028e800
feat: simplify the docker-compose setup so we do less version coordinations (#12998)
* feat: remove version from docker compose to support new spec

* feat: simplify the docker-compose setup so we do less version coordinations

* update hobby bin

* bump docker-compose version for hobby for extends compat

* move ci to ubuntu-latest

* Revert "move ci to ubuntu-latest"

This reverts commit a0462adfec.

* use docker compose for github ci

* correct comments on base
2022-11-29 20:50:42 +00:00
Karl-Aksel Puulmann
441e1e376b
chore(ci): Fix master branch tests (#12399)
* fix test_usage_report tests

buggy tests shipped in https://github.com/PostHog/posthog/pull/12383

* Ignore problematic lines
2022-10-24 14:33:33 +03:00
Michael Matloka
1b18e58019
style: Format hobby-ci.py (#12397) 2022-10-24 12:29:14 +02:00
James Greenhill
ddc7d44a1e
feat: hobby ci script to e2e test hobby deploy on DO (#12153)
* feat: hobby ci script to e2e test hobby deploy on DO

* checkpoint

* script in a decent spot

* fixes

* more fixes for script

* github action to run python

* Update env var for DO token

* hobby test name

* run on pull requests

* action fixes

* actions fixes

* actions fixes

* actions fixes

* support release testing as well

* actions fixes

* retry tweaks. GHA are a pain

* exit 0 for success and 1 for failure

* handle signals better

* fixes

* retry deletion

* Don't import packages that don't exist

* kwargs the args

* break out of retries

* done

* don't run on master pushes

* Use staging for lets encrypt

* feedback

* feedback timeout context

* feedbacks

* fix issue where response could be referenced before initialization
2022-10-22 02:47:13 +00:00
Marius Andra
85b240aa21
fix(funnels): increase GET request size limit to 16k (#12381) 2022-10-21 14:27:10 +02:00
Daniel
1d05f68deb
fix: Update description for hobby upgrade script (#12064)
* fix: Update description for hobby upgrade script

In the original warning's language (written by yours truly), I don't mention which version number nor which dates are relevant to the issue.

[x] Added a check to see if the containers exist or not (`docker volume ls | grep -Pzoq 'root_cl2ickhouse-data\n(.|\n)*root_postgres-data\n'`)
[x] Added the dates and version number now allows users to better understand if the warning is relevant to them.
[x] Minor improvements to the language and instructions

* feat: track warning states for better user prompts

Use state from pre-update volume presence check to show post-install warning about data loss in addition to pre-upgrade warning.

* Improve references to docker container names

Previously instructions erroneously included my particular instance's containing folder. Changed grep check and added 'wildcards' in the instructions to clarify that it might be named differently depending on the environment.
2022-10-11 18:55:36 +00:00
James Greenhill
9f7403cfbe
fix(hobby): if you are running from cloud_init this fixes a break in the boot (#12172) 2022-10-10 16:43:22 +00:00
Harry Waye
cd56870754
fix(hobby): don't start frontend in hobby deploy (#12118)
We are running yarn install and starting the frontend dev server for
hobby. This isn't necessary or desired as the image is prebuilt.

Note we also need to update the /compose/start as well, in the upgrade.
It could probably do with a refactor but I'm not going to do that now.
2022-10-06 09:25:57 -07:00
James Greenhill
3ba2221cfb
chore: make params for hobby passable at CLI level for testing (#12057) 2022-09-30 18:16:53 +00:00
James Greenhill
3029cfa9a8
fix: improve hobby deploy and reduce unneccessary logging (#11959)
* fix: improve hobby deploy and reduce unneccessary logging

* fix typo

* typo fix missing a /

* remove last enter
2022-09-23 16:42:09 -07:00
James Greenhill
924979ac1b
feat: simplify hobby deploy wizard (#11944)
* feat: simplify hobby deploy wizard

* remove env var that is not

* remove more unneeded env vars

* Add link to docs
2022-09-22 15:44:22 -07:00
James Greenhill
ce61f53814
fix: Have hobby wait for stack to be up through caddy (#11940)
buxfix: Have hobby wait for stack to be up through caddy
2022-09-22 13:50:06 -07:00
Harry Waye
9bf86629df
feat(async-migrations): add auto complete trivial migrations option (#11601)
* feat(async-migrations): add auto complete trivial migrations option

This change is to ensure that the `run_async_migrations --check` command
option is a light operation such that we can safely use this e.g. in an
init container to gate the starting of a K8s Pod.

Previous to this change, the command was also handling the
auto-completion of migrations that it deamed to not be required, via the
`is_required` migration function. Aside from this heaviness issue, it's
good to avoid having side effects from a check command.

One part of the code that I wasn't sure about is the version checking,
so any comments here would be much appreciated.

Note that `./bin/migrate` is the command we call from both ECS migration
task and the Helm chart migration job.

* update comment re versions

* wip

* wip

* wip

* update hobby

* rename to noop migrations
2022-09-01 14:43:09 +00:00
Harry Waye
3813795d22
chore(gunicorn): increase thread count for workers (#11507)
* chore(gunicorn): increase thread count for workers

We currently run with 2 worker processes each with 4 threads. It seems
occasionally we see spikes in the number of pending requests within a
worker in the 20-25 region. I suspect this is due to 4 slow requests
blocking the thread pool.

I'd suggest that the majority of work is going to be IO bound, thus it's
hopefully going to not peg the CPU. If it does then it should end up
triggering the HPA and hopefully resolve itself :fingerscrossed:

There is however gzip running on events, which could be intensive
(suggest we offload this to a downstream at some point). If lots of
large requests come in this could be an issue. Some profiling here
wouldn't go amiss.

Note these are the same settings between web and event ingestion
workload. At some point we may want to split.

I've added a Dashboard for gunicorn worker stats
[here](https://github.com/PostHog/charts-clickhouse/pull/559) which we
can monitor to see the effects.

Aside: if would be wise to be able to specify these settings from the
chart itself such that we do not have to consider chart/posthog version
combos, and allow tweaking according to the deployment.

* reduce to 8 threads
2022-08-26 10:36:40 +00:00
Marius Andra
7cf3f71215
feat(data-management): add custom events list (#11463)
* feat(data-management): add custom events list

* remove dead code

* fix test

* assert what matters

* this seems flakey, even locally, though the interface shows the right data locally... testing a timeout

* new script

* fix test

* remove frontend changes (PR incoming)

* describe meaning behind symbols
2022-08-25 11:00:34 +00:00
Harry Waye
5e0d8cb6dd
chore(plugin-server): do not use yarn to run prod plugin-server (#11434)
It looks like the plugin-server isn't shutting down cleanly, from
looking at the logs. They abruptly stop.

We have a trap to pick kill the yarn command on EXIT, however, yarn v1
doesn't propagate SIGTERM to subprocesses, hence node never recieves it.

Separately it looks like the shutdown ends up being called multiple
times which results in a force shutdown. I'm not entirely sure what is
going on here but I'll leave that to another PR.
2022-08-23 14:03:13 +00:00
Harry Waye
8d38003aeb
fix(gunicorn): ensure gunicorn processes signals appropriately (#11417)
Prior to this the containing script was recieving the TERM signal e.g.
from Kubernetes eviction. This was as a result terminating the root
process without waiting on gunicorn.

We solve this by avoiding spawning a new process and rather have
gunicorn replace the current process.
2022-08-22 16:14:43 +00:00
Ellie Huxtable
912e258e12
chore: Do not set statsd prefix (#11391)
Do not set statsd prefix
2022-08-19 11:29:55 +00:00