A timeseries database created for events, logs, traces and metrics. Speaks the postgres dialect, and stores data in s3 via delta lake protocol
A timeseries database created for events, logs, traces and metrics. Speaks the postgres dialect, and stores data in s3 via delta lake protocol
TimeFusion stores observability data — logs, traces, metrics, and events — as Delta Lake tables on your own S3-compatible object storage, and lets you query it over the PostgreSQL wire protocol. It uses Apache DataFusion for query execution and a write-ahead log + in-memory buffer for sub-second write durability.
If you already have a Postgres client, you already have a TimeFusion client.
Status: Pre-1.0. TimeFusion runs in production at APIToolkit, but the schema, wire behavior, and configuration surface can still change between releases — pin a version before depending on it. (The version a client sees via
SHOW server_versionreflects the embedded PostgreSQL-protocol layer, not TimeFusion's own.)
psql, any Postgres driver, or
existing BI/observability tooling. No new client to learn.project_id, with shared tables for default projects and dedicated tables
for projects that need isolation. Postgres client ──▶ pgwire ──▶ DataFusion query engine
(psql, drivers) │
▼
┌───────────── write path ─────────────┐
│ WAL (durable) ─▶ in-memory buffer │
│ │ flush every ~10 min │
│ ▼ │
│ Delta Lake (Parquet) on S3 │
└────────────────────────────────────────┘
▲
Foyer cache (memory + disk)INSERT → WAL append (durable) → in-memory buffer (fast ack).
Completed time buckets flush to Delta in the background.Single-writer WAL. Exactly one TimeFusion process may run against a given WAL directory. Startup takes an exclusive
flockon the WAL dir to enforce this; a second process waits (serving57P03) until the first exits. Keep the readiness probe a plain TCP check on the pgwire port so rolling deploys hand off cleanly. Seedocs/WAL.mdandRUNBOOK.mdfor deploy guidance.
Storage layout: events are written to a Delta table such as
otel_logs_and_spans, partitioned by [project_id, date]. Table schemas live
in schemas/ and are loaded at startup.
Queries must filter on
project_id— it is the tenancy and partition key. Queries without it scan across tenants and are far slower.
The bundled Compose stack runs TimeFusion against a local MinIO — no AWS account or credentials needed. It builds the image, starts MinIO, creates the bucket, and launches TimeFusion on port 5432:
git clone https://github.com/monoscope-tech/timefusion.git
cd timefusion
docker compose upThen connect from another terminal — skip to Connect.
Images are published per commit to GitHub Container Registry, tagged with the git short SHA (see the packages page for available tags):
docker run -d -p 5432:5432 \
-e AWS_S3_BUCKET=your-bucket \
-e AWS_ACCESS_KEY_ID=your-key \
-e AWS_SECRET_ACCESS_KEY=your-secret \
ghcr.io/monoscope-tech/timefusion:Requires a recent stable Rust toolchain (edition 2024 → Rust 1.85+).
git clone https://github.com/monoscope-tech/timefusion.git
cd timefusion
cargo build --release
AWS_S3_BUCKET=your-bucket ./target/release/timefusionpsql "postgresql://postgres:postgres@localhost:5432/postgres"INSERT INTO otel_logs_and_spans (name, id, project_id, timestamp, date, hashes)
VALUES ('api.request', '550e8400-e29b-41d4-a716-446655440000',
'prod-api-001', '2025-01-17 14:25:00', '2025-01-17', ARRAY[]::text[]);
SELECT name, COUNT(*) AS count
FROM otel_logs_and_spans
WHERE project_id = 'prod-api-001' AND date = '2025-01-17'
GROUP BY name
ORDER BY count DESC;TimeFusion speaks analytical SQL: aggregations, window functions,
PERCENTILE_CONT, FILTER, CTEs, and a TimescaleDB-compatible time_bucket.
Here's finding slow API endpoints from trace data:
SELECT name AS endpoint,
COUNT(*) AS request_count,
AVG(duration / 1000000)::INT AS avg_duration_ms,
MAX(duration / 1000000)::INT AS max_duration_ms
FROM otel_logs_and_spans
WHERE project_id = 'prod-api-001'
AND timestamp >= '2025-01-17 14:00:00' AND timestamp 1000000000 -- 1 second, in nanoseconds
GROUP BY name
ORDER BY avg_duration_ms DESC; endpoint | request_count | avg_duration_ms | max_duration_ms
-------------------------+---------------+-----------------+-----------------
POST /api/v1/payments | 1 | 3421 | 3421
GET /api/v1/users/:id | 1 | 2100 | 2100
POST /api/v1/users | 1 | 1523 | 1523More query examples — error rates, trace lookup, time-bucketed aggregation, moving averages
…bash git clone https://github.com/monoscope-tech/timefusion.git cd timefusion
docker compose up -d minio createbucket
export AWS_S3_BUCKET=timefusion
AWS_S3_ENDPOINT=http://localhost:9000
AWS_ALLOW_HTTP=true
AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=minioadmin
cargo run
**Tests:**
```bash
make test # the whole suite in one parallel run (~74s)
cargo nextest run # one test or one .slt file, e.g. `dedup_compaction`
cargo nextest run --lib # unit tests only
make test-e2e # end-to-end (Docker required; testcontainers MinIO)
RUST_LOG=debug cargo nextest run --no-capture # with debug logging
Tests run under [cargo-nextest](https://nexte.st) (one process per test).
Install: `curl -LsSf https://get.nexte.st/latest/mac | tar zxf - -C ~/.cargo/bin`.Faster local builds (macOS arm64): .cargo/config.toml links with ld64.lld
instead of the system linker, and [profile.dev] uses debug = "line-tables-only"
— together these roughly halve the warm recompile of the large database.rs crate
(~22s → ~12s). This requires ld64.lld on disk:
brew install llvm@15 # provides /opt/homebrew/opt/llvm@15/bin/ld64.lld
…
bash
make ci-signoff # local checks, published results, then remaining remote checks
make ci-status # what CI would run right now, without running itContributions are welcome — see CONTRIBUTING.md.
MIT — see LICENSE.
Apache DataFusion · Delta Lake · Apache Arrow · pgwire · Foyer
No open issues yet, or sync has not completed.