mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
1.3 KiB
1.3 KiB
RealTime Hog 3000
The start of something fresh.
Hog 3000 powers live event stream on PostHog: https://us.posthog.com/project/0/activity/live
Endpoints
/- dummy placeholder/served- total number of events and users recorded/stats- number of unique users (distinct id) on a page/events- stream consumed events to the requester, it's a done through Server Side Event, it supports extra query params adding filters:eventType- event type name,distinctId- only events with a given distinctId,geo- return only coordinates guessed based on IP,
/debug- dummy html for SSE testing,/debug/sse/- backend for/debuggenerating a server side events,/metrics- exposes metrics in Prometheus format
Installing
One needs a IP -> (lat,lng) database:
curl https://mmdbcdn.posthog.net/ | brotli -d > mmdb.db
Config the configs in configs/config.yml. You can take a peak at the examples in configs/configs.example.yml
Run it!
go run .
Notice
If modifying fields with //easyjson:json comment, one must regenerate the easyjson marshaller / unmarshaller.
It requires to install: go install github.com/mailru/easyjson/...@latest