livestream/README.md
The start of something fresh.
Hog 3000 powers live event stream on PostHog: https://us.posthog.com/project/0/activity/live
/ - 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 /debug generating a server side events,/metrics - exposes metrics in Prometheus formatOne 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 .
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