Skip to content

Trench

Self-hosted event tracking on Kafka and ClickHouse for teams building their own analytics

Permissive (OSI) · MIT

Listed by , founder & editor

23

Health

Dormant

Overview

Stars

1,673

Last commit

8 months ago

Apr 2026

Repository age

2 years

since Sep 2024

Latest version

trench-js@0.0.17

Dec 2024

Contributors

–

Releases

0

last 12 months

Language

TypeScript

Trench is an event tracking system built on Apache Kafka and ClickHouse. It collects events over an HTTP API, stores them in ClickHouse and lets you query them in real time. It is written in TypeScript and released under the MIT license.

The API is compatible with Segment's Track, Group and Identify calls. You can forward data to other destinations with webhooks. It ships as a single Docker image, and the repository includes Docker Compose files that start a local server with ClickHouse and Kafka. The project says one node can process thousands of events per second. It is cookie-free and designed so you can access, correct or delete user data.

A demo in the repository shows how to build a basic Google Analytics-style dashboard with Grafana on top of Trench. It is better seen as analytics infrastructure than a finished dashboard product. A managed cloud version also exists.

Who it's for

Engineering teams that need a high-volume event pipeline

Kafka and ClickHouse handle large event volumes, and you own the data.

Skip if: You want ready-made dashboards and funnels without building queries yourself.

Teams already sending data through Segment's API

Track, Group and Identify calls are compatible, so existing instrumentation may carry over.

Skip if: You depend on Segment's large catalog of prebuilt destinations.

Privacy-focused developers building custom analytics

It uses no cookies and lets you access, change or delete user data.

Skip if: You cannot run Docker, Kafka and ClickHouse.

The problem it solves

Tracking product events at volume usually means paying a vendor or wiring up Kafka and ClickHouse yourself. Trench packages that pipeline behind a simple API you can run on your own servers.

Strengths

  • Segment-compatible Track, Group and Identify API
  • Single Docker image with Compose files for a local setup
  • Real-time queries over events stored in ClickHouse
  • Webhooks forward events to other destinations
  • MIT license

Trade-offs

  • No built-in dashboards; you pair it with a tool such as Grafana
  • No commits since April 2026 and no recent releases
  • Production use calls for about 4GB RAM and 4 CPU cores
  • Kafka plus ClickHouse adds operational weight for small projects

Self-host Trench

Self-hostable
Yes
Minimum RAM
4 GB

Quick start

git clone https://github.com/frigadehq/trench.git
cd trench/apps/trench
cp .env.example .env
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --force-recreate --renew-anon-volumes

From the project's own install instructions. Check the docs for production settings.

In the community

Frequently asked questions

Is Trench free to self-host?

Yes. The self-hosted version is MIT licensed. A paid managed cloud option also exists.

Does it work with Segment's API?

It is compatible with Segment's Track, Group and Identify calls.

What do I need to run it?

Docker and Docker Compose. For production, 4GB of RAM and 4 CPU cores are recommended.

Does it use cookies?

No. It is a no-cookie system that lets you access, correct or delete user data.

Similar tools in Analytics platforms

Your Spotify

Analytics platforms

Self-hosted dashboard that tracks and charts your Spotify listening history

4.6k 220 5 months ago Slowing GPL-3.0

Litlyx

Analytics platforms

Cookieless web analytics you can self-host with Docker or use as a hosted service

1.7k 115 12 months ago Dormant Apache-2.0

Tianji

Analytics platforms

3.1k 200 today Active Apache-2.0

Aptabase

Analytics platforms

Privacy-focused analytics for mobile, desktop and web apps, self-hosted or hosted

1.9k 142 yesterday Active AGPL-3.0

counterscale

Analytics platforms

2.2k 145 2 months ago Slowing MIT

pirsch

Analytics platforms

1k 51 today Thriving AGPL-3.0