0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-21 13:39:22 +01:00
posthog/rust
Oliver Browne a7c4078a09 cleanup
2024-11-20 01:12:56 +02:00
..
.cargo
.sqlx fix(err): add issue name and description (#26200) 2024-11-18 13:58:59 +02:00
bin feat(max): Use new "Product description" project setting (#25937) 2024-11-04 16:34:24 +00:00
capture fix: Revert "fix(capture): strip invalid utf16 surrogate pairs from input" (#25523) 2024-10-10 22:05:57 +03:00
common feat(err): Emit to clickhouse from cymbal (#26244) 2024-11-19 11:00:08 +02:00
cyclotron-core feat(sike): pipe created ids back up to node (#25926) 2024-10-31 14:46:35 +00:00
cyclotron-fetch feat: Cyclotron batch updates - take 2 (#25050) 2024-09-18 15:59:46 +02:00
cyclotron-janitor chore(cyclotron): modify janitor metric, expose depth limit (#25060) 2024-09-18 20:16:09 +01:00
cyclotron-node feat(sike): pipe created ids back up to node (#25926) 2024-10-31 14:46:35 +00:00
cymbal cleanup 2024-11-20 01:12:56 +02:00
docker/echo-server
feature-flags feat(flags): add support for matching static cohort membership (#25942) 2024-11-16 00:02:43 +00:00
hook-api fix: use jemalloc everywhere we're rusty (#24796) 2024-09-05 06:19:25 +00:00
hook-common
hook-janitor fix: use jemalloc everywhere we're rusty (#24796) 2024-09-05 06:19:25 +00:00
hook-worker chore: rust linting in CI (#25758) 2024-10-24 11:29:11 +01:00
migrations
property-defs-rs fix(propdefs): actually die on worker panics (#26236) 2024-11-19 10:28:12 +02:00
.dockerignore
.env
.gitignore
Cargo.lock fix(err): consumer hangs (#26288) 2024-11-19 16:45:25 +00:00
Cargo.toml feat(err): store result of frame resolution (#26001) 2024-11-06 13:28:12 +01:00
depot.json
docker-compose.yml
Dockerfile
Dockerfile.migrate-hooks feat(max): Use new "Product description" project setting (#25937) 2024-11-04 16:34:24 +00:00
LICENSE
README.md

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