0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
Go to file
2024-04-24 17:30:40 +02:00
.github/workflows Use Depot runners (#16) 2024-02-23 07:47:38 -07:00
bin refactor: Deploy the migration container too (#24) 2024-01-05 11:28:19 +01:00
capture capture: don't allow events submitted with an empty distinct_id (#25) 2024-04-24 17:30:40 +02:00
capture-server capture: make otel service name configurable, will use deploy name (#22) 2024-04-22 15:38:45 +02:00
common common: refactor health into its own lib crate (#23) 2024-04-24 17:30:11 +02:00
docker/echo-server
hook-api cleanup and upgrade deps (#20) 2024-04-15 16:20:52 +02:00
hook-common common: refactor health into its own lib crate (#23) 2024-04-24 17:30:11 +02:00
hook-janitor common: refactor health into its own lib crate (#23) 2024-04-24 17:30:11 +02:00
hook-worker common: refactor health into its own lib crate (#23) 2024-04-24 17:30:11 +02:00
migrations fix: Use a good index for dequeue (#61) 2024-02-02 14:45:41 +01:00
.dockerignore Merge rusty-hook repo into capture repo. 2024-02-06 10:07:16 -07:00
.env Switch to sqlx::test for per-test DBs and fixtures 2023-12-19 13:28:50 -07:00
.gitignore
Cargo.lock common: refactor health into its own lib crate (#23) 2024-04-24 17:30:11 +02:00
Cargo.toml common: refactor health into its own lib crate (#23) 2024-04-24 17:30:11 +02:00
depot.json Use Depot for build-push-action (#6) 2024-02-07 07:50:09 -07:00
docker-compose.yml Merge rusty-hook repo into capture repo. 2024-02-06 10:07:16 -07:00
Dockerfile Add ENV for BIN (#12) 2024-02-07 12:37:10 -07:00
Dockerfile.migrate refactor: Deploy the migration container too (#24) 2024-01-05 11:28:19 +01:00
LICENSE
README.md Merge rusty-hook repo into capture repo. 2024-02-06 10:07:16 -07:00

hog-rs

PostHog Rust service monorepo. This is not the Rust client library for PostHog.

capture

This is a rewrite of capture.py, in Rust.

Why?

Capture is very simple. It takes some JSON, checks a key in Redis, and then pushes onto Kafka. It's mostly IO bound.

We currently use far too much compute to run this service, and it could be more efficient. This effort should not take too long to complete, but should massively reduce our CPU usage - and therefore spend.

How?

I'm trying to ensure the rewrite at least vaguely resembles the Python version. This will both minimize accidental regressions, but also serve as a "rosetta stone" for engineers at PostHog who have not written Rust before.

rusty-hook

A reliable and performant webhook system for PostHog

Requirements

  1. Rust.
  2. Docker, or podman and podman-compose: To setup development stack.

Testing

  1. Start development stack:
docker compose -f docker-compose.yml up -d --wait
  1. Test:
# Note that tests require a DATABASE_URL environment variable to be set, e.g.:
# export DATABASE_URL=postgres://posthog:posthog@localhost:15432/test_database
# But there is an .env file in the project root that should be used automatically.
cargo test