Skip to content

Files

Latest commit

 

History

History

livestream

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 /debug generating 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 .