Trench
Self-hosted event tracking on Kafka and ClickHouse, compatible with the Segment API, for teams handling real-time analytics at volume.

Trench is an event tracking system the team at Frigade built to scale their own real-time pipeline, then released. It handles large event volumes, answers queries in real time, and is cookie-free plus GDPR and PECR compliant, with users able to access, rectify or delete their own data.
Apache Kafka carries ingestion and ClickHouse stores and queries the events. The API follows Segment's Track, Group and Identify calls, so existing instrumentation can point at Trench without being rewritten. A single production-ready Docker image is the deployment unit, and one node processes thousands of events per second.
Working with the data takes a few forms.
- Event ingestion: batched events post to the events endpoint with a public API key in the authorization header.
- Event queries: the same endpoint reads events back filtered by type, using the private key instead.
- Raw SQL: a queries endpoint accepts SQL directly against the events table.
- Webhooks: data connects onward to other destinations.
- Grafana: the demo video builds a basic Google Analytics equivalent by pairing Trench with Grafana.
The code is MIT licensed. Getting started needs only Docker and Docker Compose, with 4 GB of RAM and four CPU cores suggested for production. Cloning the repository and bringing up the dev compose file starts a server with local ClickHouse and Kafka on port 4000. A managed cloud with autoscaling exists for teams who would rather not operate Kafka themselves.
Stars
1,662Forks
64Last commit
5 months agoRepository age
2 yearsLicense
MITVersion
trench-js@0.0.17Repository
FrigadeHQ/trench
Auto-fetched from GitHub .
Open source alternatives similar to Trench:
Stars
Forks
Last commit
Stars
Forks
Last commit
Stars
Forks
Last commit