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

263 Commits

Author SHA1 Message Date
Julian Bez
9576fab1e4
chore: Add Pyupgrade rules (#21714)
* Add Pyupgrade rules
* Set correct Python version
2024-04-25 08:22:28 +01:00
Michael Matloka
d7d03b5985
feat(insights): HogQL calculation of saved legacy insights v4 (#21781)
* Revert "revert(insights): HogQL calculation of saved legacy insights v3 (#21778)"

This reverts commit c0be1d1412.

* Move HogQL in insight serialization to its own flag
2024-04-24 13:39:43 +02:00
Marius Andra
c0be1d1412
revert(insights): HogQL calculation of saved legacy insights v3 (#21778)
Revert "fix(insights): HogQL calculation of saved legacy insights v3 (#21720)"

This reverts commit 3ffa9acd75.
2024-04-23 23:17:47 +02:00
Tom Owers
3a90d82940
fix(celery): Run celery locally as a single worker (#21772)
Run celery locally as a single worker
2024-04-23 23:15:35 +02:00
Michael Matloka
3ffa9acd75
fix(insights): HogQL calculation of saved legacy insights v3 (#21720)
* Revert "revert(insights): HogQL calculation of saved legacy insights v2 (#21718)"

This reverts commit 2f019a39ec.

* Fix `CACHE_ONLY` in place of `CALCULATION_ONLY_IF_STALE`

* Make `ExecutionMode` naming unmistakable

* Reset UI snapshots

* Account for #21707's `apply_dashboard_filters` change

* Make `QueryRunner` generic
2024-04-23 16:50:56 +02:00
Michael Matloka
233d3a9098
chore(deps): Remove unused Python requirements (#21580)
* chore(deps): Remove unused Python requirements

* Also remove `dnspython`

* Recompile txts

* Revert "Also remove `dnspython`"

This reverts commit 7eaf89979b774808cc0920c34a3a1cf1d75d2f14.

* Re-recompile txts

* Remove more deps based on `deptry`

* Restore `phonenumberslite`

* Restore `geoip2`

* Restore `python3-saml`

* Move `prance` and `openapi-spec-validator` to dev reqs

* Reorder `geoip2`

* Force HTTP 1.1 in downloading MMDB

Should fix CI failures caused by `curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)` (e.g. https://github.com/PostHog/posthog/actions/runs/8741861825/job/23988870688?pr=21580).
2024-04-22 22:52:47 +02:00
Michael Matloka
2f019a39ec
revert(insights): HogQL calculation of saved legacy insights v2 (#21718)
Revert "fix(insights): HogQL calculation of saved legacy insights v2 (#21595)"

This reverts commit 3e2d28f233.
2024-04-22 11:53:04 +02:00
Ben White
a8bcc672a8
feat: Swap ingestion endpoints to new .i.posthog.com ones (#20736) 2024-04-22 11:03:14 +02:00
Michael Matloka
3e2d28f233
fix(insights): HogQL calculation of saved legacy insights v2 (#21595)
* fix(insights): HogQL calculation of saved legacy insights v2

This reverts commit a6314c6bb7.

* Only use cached results in `process_query` for insight serializer

* Fix type of results

* Rename `RecalculationMode` to `ExecutionMode`

* Fix typing more

* Properly support dashboard filters

* Hacky fix for schema.py

* Don't test legacy `generate_insight_cache_key` with `query`

* Fix importing & typing

* Fix typo

* Update test_query_runner.py

* Account for property filter groups in dashboard filters

* Do return stale result in CACHE_ONLY case

* Fix `execute_hogql_query` espionage

Wow, this was a pain to figure out, only was an issue in CI, because the trigger was `TestCohort::test_creating_update_and_calculating_with_new_cohort_query` running prior to `TestInsight:: test_insight_refreshing_query` – had to use trial and error.

* Fix typing even more

* Don't require `pnpm` for `schema:build:python`

Matters in CI.

* Fix `schema:build:python`

* Fix sed usage

* Move `schema:build:python` to a bash script

* Validate cache properly

Clarifies the `cached_response.is_cached = True` situation.

* Fix Python formatting

* Update UI snapshots for `webkit` (2)

* Add test to ensure /query/ and /inisghts/ use the same cache

* Update mypy-baseline.txt

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-22 10:30:18 +02:00
Frank Hamand
3f9fd8aec7
feat: allow asgi/wsgi to be configurable by env var (#21635)
allow asgi/wsgi to be configurable by env var

This will let us roll out asgi separate across services as we had
issues with our recordings capture pods on asgi
2024-04-18 10:13:06 +01:00
David Newell
33d13aff4d
chore: remove ingestion experiment (#21583) 2024-04-17 15:12:59 +01:00
Marius Andra
99de66f434
feat(hogql): in cohort joins with version as well (#21552) 2024-04-16 17:51:23 +02:00
Julian Bez
84a098ce64
feat(celery): Add prefetch multiplier to flags (#21399)
Since the env var doesn't make it to the subprocess
2024-04-08 12:22:06 +00:00
Paul D'Ambra
c4cbad4642
chore: make exception autocapture available to CDN (#21225) 2024-04-08 11:33:24 +01:00
James Greenhill
4d75323ac3
chore: tune up the hobby deploy testing (#21142)
* chore: tune up the hobby deploy testing

* quick fix

* put everything in the class

* include release tag in name

* split this out into stages for GA

* test throwing ci off

* fix

* test destroy

* check env

* exit if things don't work out

* debug

* somewhat important to create the dns record here hah

* record name as well

* maybe?

* update user_data

* set dns ttl to 30 sec

* silly dns mistake

* correct DNS error
2024-03-26 09:54:22 -07:00
Frank Hamand
7148e2c884
feat: Allow setting --max-tasks-per-child on celery worker (#21163)
Allow setting --max-tasks-per-child on celery worker

This is so we can try to stop worker memory usage growing over time
2024-03-26 16:34:20 +00:00
PostHog Bot
3d73992761
chore(deps): Update posthog-js to 1.112.1 (#20782) 2024-03-11 07:48:55 -04:00
Ben White
bcbe300c22
feat: Replay ingestion with EFS (#20487) 2024-02-26 09:43:27 +01:00
David Newell
4f6d9c8673
feat: generate recording text embeddings (#20046)
* make migration

* general flow

* abstract shared methods

* generate input

* remove postgres migration

* generate embedding strings

* remove random file

* Update query snapshots

* Update query snapshots

* feat: create periodic replay embedding

* first sketch of table

* batch and flush embeddings

* add default to timestamp generation

* fetch recordings query

* save first embeddings to CH

* dump session metadata into tokens

* fix lint

* brain dump to help th future traveller

* prom timing instead

* fix input concatenation

* add an e :/

* obey mypy

* some time limits to reduce what we query

* a little fiddling to get it to run locally

* paging and counting

* Update query snapshots

* Update query snapshots

* move the AI stuff to EE for now

* Update query snapshots

* kick off the task with interval from settings

* push embedding generation onto its own queue

* on a different queue

* EE to the max

* doh

* fix

* fangling

* Remove clashes so we can merge this into the other PR

* Remove clashes so we can merge this into the other PR

* start wiring up Celery task

* hmmm

* it's a chord

* wire up celery simple version

* rename

* why is worker failing

* Update .run/Celery.run.xml

* update embedding input to remove duplicates

* ttl on the table

* Revert "update embedding input to remove duplicates"

This reverts commit 9a09d9c9f0.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Paul D'Ambra <paul@posthog.com>
2024-02-14 12:50:42 +00:00
Raquel Smith
51db8afbf1
feat: add separate celery queue for usage reports (#20048) 2024-01-31 10:42:40 +00:00
Julian Bez
6f0233608e
fix: Fix starting local celery worker queues (#19837) 2024-01-18 17:25:43 +00:00
Ben White
7f174faf40
feat: Celery tasks refactor (#19827) 2024-01-18 14:28:10 +01:00
James Greenhill
6b50aff12b
chore: enable gossip for flower and to squelch errors (#19823) 2024-01-18 08:01:02 +00:00
Michael Matloka
2ad53ef79e
refactor(product-analytics): lineGraphLogic.ts to tooltip-data.ts (#19815) 2024-01-17 20:28:10 +00:00
Julian Bez
5254cc7eab
feat: Route some trial tasks to different queues (#19810) 2024-01-17 15:50:51 +00:00
Julian Bez
95fec19aaf
feat(celery): Prepare to run on multiple queues (#19157)
* Add Celery queues env file with default queues

Reasoning:
We need to configure Celery workers in several places to consume
from a specific set of queues.

* Define some queues
2024-01-17 11:54:12 +00:00
Julian Bez
9df89c0ebc
feat(api): Add Pydantic schemas in OpenAPI annotations (#19747)
Trying again #19408 with fixes
2024-01-15 09:19:10 +00:00
Julian Bez
cbc0ba83f5
revert: "feat(api): Add Pydantic schemas in OpenAPI annotations" (#19739)
Due to issue POSTHOG-P7X
2024-01-12 14:09:40 +00:00
Julian Bez
456af51cfd
feat(api): Add Pydantic schemas in OpenAPI annotations (#19408)
* Update schema to use discriminators and add Pydantic parser
2024-01-12 12:01:13 +00:00
Julian Bez
7cabe21ae3
chore: Upgrade pydantic, mypy, and others (#19660)
* Upgrade pydantic and all related
* Upgrade mypy
* Add mypy-baseline

To update baseline when you fix something (only then!) use:

    [mypy cmd] | mypy-baseline sync
2024-01-10 08:32:55 +00:00
Michael Matloka
5c51230ea4
chore(frontend): Real Tailwind + Autoprefixer (#19051)
* chore(frontend): Real Tailwind + Autoprefixer

* Align some non-standard utility class usage with Tailwind

* Start using container queries

* Update tailwind.config.js

* Move PostCSS packages into prod dependencies

* Add EE

* Add larger spacings for properties other than width

* Fix spacing backward compat

* Add max-w-1/2

* Remove Tailwind normalization

* Ensure JIT analysis works

* Actually we don't need a container query for this

* Clean up more

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update production.Dockerfile

* Extend `fontSize` instead of replacing

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Fix production build

* Add clarification comment

* Update trends.cy.ts

* Fix `scale` usage

* Fix minor styling issues

* Upgrade to Tailwind 3.4

* Actually use `cssnano`

* Don't use `cssnano` in dev

* Solve annoying Tailwind logs

* Add comment explaining plugins being defined twice

* Fix side panel icon rotation

* Reset snapshots

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update query snapshots

* Fix dockerfile

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Fix up flag wrap

* Update UI snapshots for `chromium` (2)

* Fix

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben White <ben@posthog.com>
2024-01-08 13:26:12 +01:00
James Greenhill
5c9baf6c72
fix: basic retry logic for booting up the application and waiting for unit (#19259)
* chore: basic retry logic for booting up the application and waiting for unit

* finally block for close
2023-12-11 14:46:14 -05:00
danielxnj
b0a9ce2818
chore: hobby deployment on PR (#18733)
* Check docker before installing it
2023-11-29 18:16:15 -05:00
Frank Hamand
c0b5061520
feat: Use single entrypoint for both images but detect which to run (#18883)
Make docker-server binary fixed between unit/gunicorn images

We want it to be a full drop-in replacement
2023-11-27 10:06:22 +00:00
Brett Hoerner
bc553938e3
chore(batch-exports): add some Prometheus metrics for batch exports (#18467)
* chore(batch-exports): add some Prometheus metrics for batch exports

* make metrics port an option/setting

* get destination from workflow_type
2023-11-09 09:22:25 -07:00
Frank Hamand
773e20d771
feat: Add prometheus metrics to nginx unit (#18387)
* Add prometheus metrics to nginx unit

* Run multiprocess prom collector in unit

* Refactor unit metrics to use prom client properly

* Ruff
2023-11-07 15:12:03 +00:00
James Greenhill
61cf6d8bd1
chore: set RESTART_MODE to list for needrestart to prevent halt (#18285) 2023-10-30 16:24:00 -07:00
James Greenhill
dc30182fff
chore: ensure DEBIAN_FRONTEND=noninteractive for hobby deploy (#18284) 2023-10-30 16:12:35 -07:00
Frank Hamand
9939786d63
feat: Add env var to skip migration checks (#17915)
Add env var to skip migration checks

This will allow us to skip the checks in kubernetes pods that use
initContainers but without effecting existing deploys or docker-compose
2023-10-11 15:51:43 +01:00
Ben White
301ab02749
chore: Update install script (#17851)
Fixed script
2023-10-11 13:41:01 +02:00
Frank Hamand
7a14421e78
feat: Set keepalive to 60 on gunicorn (#17897)
Set keepalive to 60 on gunicorn

The default is 2 seconds, the default for ALBs is 30 seconds

This can cause a race condition where gunicorn closes the connection
as the ALB sends a request, resulting in a 502.
2023-10-11 08:54:48 +01:00
Frank Hamand
c660212989
Revert "feat: Add kafka rack aware injection on docker-server" (#17710)
Revert "feat: Add kafka rack aware injection on docker-server (#17541)"

This reverts commit 789bc23c91.
2023-10-02 10:21:00 +00:00
Neil Kakkar
c3e99858d5
feat(surveys): Add UI for enabling/disabling surveys popup (#17602) 2023-09-26 13:35:54 +01:00
Frank Hamand
3ef42ddd38
feat: Add docker image that uses nginx unit instead of gunicorn (#17573)
* Add docker image that uses nginx unit instead of gunicorn

🦄🔫

* Add unit build to CI

* Fix duplicate id

* try 3.11

* Only build for amd64

need python3.11 for unit image on arm
2023-09-21 16:50:19 +01:00
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