0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
Go to file
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
.devcontainer
.github chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
.husky
.run
.storybook
.vscode chore: remove ingestion experiment (#21583) 2024-04-17 15:12:59 +01:00
bin fix(insights): HogQL calculation of saved legacy insights v2 (#21595) 2024-04-22 10:30:18 +02:00
cdp
cypress feat(experiments): support moving experiment start date (#21362) 2024-04-18 12:08:08 +00:00
docker
ee chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
eslint-rules
frontend fix(insights): HogQL calculation of saved legacy insights v2 (#21595) 2024-04-22 10:30:18 +02:00
hogql_parser fix(hogql): Only expose HogQL exceptions relevant to users (#21329) 2024-04-05 11:39:20 +00:00
hogvm
openapi
patches fix: nested css selector splitting (#21427) 2024-04-09 11:25:52 +01:00
playwright/e2e-vrt
plugin-server chore(plugin-server): use uuidv5 for person uuids, based on distinct_id (#21547) 2024-04-17 13:06:53 -06:00
plugin-transpiler
posthog fix(insights): HogQL calculation of saved legacy insights v2 (#21595) 2024-04-22 10:30:18 +02:00
share
staticfiles
.all-contributorsrc
.dockerignore feat: allow asgi/wsgi to be configurable by env var (#21635) 2024-04-18 10:13:06 +01:00
.eslintignore
.eslintrc.js feat(cohorts): Allow adding property filters to events in cohorts (#21375) 2024-04-15 13:08:17 +01:00
.gitattributes
.gitignore
.kearc
.nvmrc
.prettierignore
.prettierrc
.stylelintignore
.stylelintrc.js
.test_durations feat(ci): split out temporal, make tests faster (#21636) 2024-04-18 16:25:33 +01:00
babel.config.js
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
cypress.e2e.config.ts
depot.json
docker-compose.base.yml fix: Restart temporal container on failure (#21615) 2024-04-17 16:34:20 +02:00
docker-compose.dev-full.yml
docker-compose.dev.yml fix: Wait for healthy db when starting temporal (#21610) 2024-04-17 14:55:01 +02:00
docker-compose.hobby.yml chore: remove ingestion experiment (#21583) 2024-04-17 15:12:59 +01:00
docker-compose.playwright.yml
Dockerfile
Dockerfile.cloud
Dockerfile.playwright
gunicorn.config.py
jest.config.ts
jest.setup.ts
jest.setupAfterEnv.ts
latest_migrations.manifest feat: Add Plugin Private Access control to model (#21680) 2024-04-19 16:55:12 +02:00
LICENSE
manage.py chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
mypy-baseline.txt fix(insights): HogQL calculation of saved legacy insights v2 (#21595) 2024-04-22 10:30:18 +02:00
mypy.ini
package.json fix(insights): HogQL calculation of saved legacy insights v2 (#21595) 2024-04-22 10:30:18 +02:00
playwright.config.ts
pnpm-lock.yaml chore: make skip inactivity more subtle (#21660) 2024-04-19 09:16:43 +01:00
postcss.config.js
Procfile
production.Dockerfile feat: allow asgi/wsgi to be configurable by env var (#21635) 2024-04-18 10:13:06 +01:00
pyproject.toml chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
pytest.ini
README.md
requirements-dev.in chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
requirements-dev.txt chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
requirements.in chore(deps): Upgrade to Django 4.2 (#18653) 2024-04-16 10:53:32 +01:00
requirements.txt chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
SECURITY.md
tailwind.config.js
test-runner-jest-environment.js
test-runner-jest.config.js
tsconfig.dev.json
tsconfig.json
unit.json.tpl fix: Reduce nginx unit request limit to 7.5k (#21649) 2024-04-18 14:50:41 +01:00
webpack.config.js

posthoglogo

PRs Welcome Docker Pulls GitHub commit activity GitHub closed issues

Docs - Community - Roadmap - Changelog - Bug reports

PostHog Demonstration See PostHog in action

PostHog is an all-in-one, open source platform for building better products

  • Specify events manually, or use autocapture to get started quickly
  • Analyze data with ready-made visualizations, or do it yourself with SQL
  • Gather insights by capturing session replays, console logs, and network monitoring
  • Improve your product with A/B testing that automatically analyzes performance
  • Safely roll out features to select users or cohorts with feature flags
  • Send out fully customizable surveys to specific cohorts of users
  • Connect to external services and manage data flows with PostHog CDP

PostHog is available with hosting in the EU or US and is fully SOC 2 compliant. It's free to get started and comes with a generous monthly free tier:

  • 1 million product analytics events
  • 5k session replays
  • 1 million feature flag requests
  • 250 survey responses

We're constantly adding new features, with web analytics and data warehouse now in beta!

Table of Contents

Get started for free

The fastest and most reliable way to get started with PostHog is signing up for free to PostHog Cloud or PostHog Cloud EU. Your first 1 million events (and 5k replays) are free every month, after which you pay based on usage.

Open-source hobby deploy (Advanced)

You can deploy a hobby instance in one line on Linux with Docker (recommended 4GB memory):

 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)" 

Open source deployments should scale to approximately 100k events per month, after which we recommend migrating to a PostHog Cloud instance. See our docs for more info and limitations. Please note that we do not provide customer support for open source deployments.

Docs

ui-demo

Want to find out more? Request a demo!

PostHog brings all the tools and data you need to build better products.

Analytics and optimization tools

  • Event-based analytics: Capture your product's usage automatically, or customize it to your needs
  • User and group tracking: Understand the people and groups behind the events and track properties about them
  • Data visualizations: Create and share graphs, funnels, paths, retention, and dashboards
  • SQL access: Use SQL to get a deeper understanding of your users, breakdown information and create completely tailored visualizations
  • Session replays: Watch videos of your users' behavior, with fine-grained filters and privacy controls, as well as network monitoring and captured console logs
  • Heatmaps: See where users click and get a visual representation of their behaviour with the PostHog Toolbar
  • Feature flags: Test and manage the rollout of new features to specific users and groups, or deploy flags as kill-switches
  • A/B and multivariate experimentation: run simple or complex changes as experiments and get automatic significance calculations
  • Correlation analysis: Discover what events and properties correlate with success and failure
  • Surveys: Collect qualitative feedback from your users using fully customizable surveys

Data and infrastructure tools

Read a full list of PostHog features.

Contributing

We <3 contributions big and small. In priority order (although everything is appreciated) with the most helpful first:

Philosophy

Our mission is to increase the number of successful products in the world. To do that, we build product and data tools that help you understand user behavior without losing control of your data.

In our view, third-party analytics tools do not work in a world of cookie deprecation, GDPR, HIPAA, CCPA, and many other four-letter acronyms. PostHog is the alternative to sending all of your customers' personal information and usage data to third-parties.

PostHog gives you every tool you need to understand user behavior, develop and test improvements, and release changes to make your product more successful.

PostHog operates in public as much as possible. We detail how we work and our learning on building and running a fast-growing, product-focused startup in our handbook.

Open-source vs. paid

This repo is available under the MIT expat license, except for the ee directory (which has it's license here) if applicable.

Need absolutely 💯% FOSS? Check out our posthog-foss repository, which is purged of all proprietary code and features.

To learn more, book a demo or see our pricing page.

Were hiring!

Come help us make PostHog even better. We're growing fast and would love for you to join us.

Contributors 🦸