Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e7390ab
feat(clickhouse): logs in ClickHouse, shared by every telemetryd in f…
sylvesterdamgaard Oct 23, 2026
289ffc9
feat(clickhouse): count log volume in ClickHouse, not line by line
sylvesterdamgaard Oct 23, 2026
c7c3ae3
perf(clickhouse): resolve streams to hashes, read log windows newest …
sylvesterdamgaard Oct 23, 2026
3b720d7
test(clickhouse): the same logs answer the same on both stores
sylvesterdamgaard Oct 23, 2026
fa2693a
fix(clickhouse): a range under a second no longer crosses the window …
sylvesterdamgaard Oct 23, 2026
9291940
feat(clickhouse): readiness, status and metrics see ClickHouse
sylvesterdamgaard Oct 23, 2026
060644a
refactor(clickhouse): one scan for every signal; trace tables
sylvesterdamgaard Oct 23, 2026
d039828
perf(clickhouse): log volume from a per-second rollup
sylvesterdamgaard Oct 23, 2026
d6301cb
feat(clickhouse): traces in ClickHouse, shared by every telemetryd in…
sylvesterdamgaard Oct 23, 2026
34aa723
feat(clickhouse): metrics in ClickHouse, answered exactly as the loca…
sylvesterdamgaard Oct 23, 2026
1210fed
feat(clickhouse): ninety days and more — retention, tiers, minute rollup
sylvesterdamgaard Oct 23, 2026
b4fd0a2
feat(clickhouse): a live tail sees every instance's lines
sylvesterdamgaard Oct 23, 2026
2b3d424
feat(clickhouse): what each app holds, from the streams summaries
sylvesterdamgaard Oct 23, 2026
bde09ea
perf(clickhouse): hourly and daily metric summaries for long windows
sylvesterdamgaard Oct 23, 2026
3e88d3b
feat(clickhouse): replicated clusters, proven across replicas
sylvesterdamgaard Oct 23, 2026
14ff6d7
ci(clickhouse): every ClickHouse test, against a replicated cluster
sylvesterdamgaard Oct 23, 2026
6a98b5c
docs(clickhouse): scale out on ClickHouse
sylvesterdamgaard Oct 23, 2026
2ddf0ca
merge feat/clickhouse: metrics on the shared schema layout
sylvesterdamgaard Oct 23, 2026
0d11831
perf(clickhouse): cheaper summaries on the hot path
sylvesterdamgaard Oct 23, 2026
377ef1d
perf(clickhouse): trace search and TraceQL metrics at scale
sylvesterdamgaard Oct 23, 2026
d9c18c7
test(clickhouse): an unreachable ClickHouse is refused loudly
sylvesterdamgaard Oct 23, 2026
d8b81fb
Merge feat/clickhouse-metrics: metrics in ClickHouse
sylvesterdamgaard Oct 23, 2026
7d2ee1f
docs(clickhouse): metrics on ClickHouse; CI runs the PromQL corpus on it
sylvesterdamgaard Oct 23, 2026
71ce3ad
docs(clickhouse): ingest measured across four instances
sylvesterdamgaard Oct 23, 2026
3625672
fix(clickhouse): review findings — security, readiness, operator UX
sylvesterdamgaard Oct 23, 2026
4f1462f
fix(clickhouse): wait for the database on this replica before its tables
sylvesterdamgaard Oct 23, 2026
fcc8477
fix(clickhouse): metric folds — versions counted once, targeted repai…
sylvesterdamgaard Oct 23, 2026
feb3216
wip: client and scan polish (see next commit)
sylvesterdamgaard Oct 23, 2026
aa7925b
Merge feat/clickhouse-metrics-polish: fold correctness, repair cost, …
sylvesterdamgaard Oct 23, 2026
229dc62
fix(clickhouse): traces — searches read past refused spans, RE2-safe …
sylvesterdamgaard Oct 23, 2026
3a2874f
fix(clickhouse): restart runs no DDL, log planner and regex safety
sylvesterdamgaard Oct 23, 2026
5e8efbd
Merge branch 'feat/clickhouse-traces-polish' into feat/clickhouse
sylvesterdamgaard Oct 23, 2026
038992c
feat(clickhouse): status, startup and test DX
sylvesterdamgaard Oct 23, 2026
e97b0a5
docs(clickhouse): operating a fleet on ClickHouse
sylvesterdamgaard Oct 23, 2026
ff223e7
fix(clickhouse): limited log scans read windows again; check trusts t…
sylvesterdamgaard Oct 23, 2026
d6dc7e5
chore: tokio 1.54.1 (RUSTSEC-2026-0386), doc links to private items
sylvesterdamgaard Oct 23, 2026
fdc297f
fix(relay): a client over its share no longer holds a queue permit wh…
sylvesterdamgaard Oct 25, 2026
b08a3a8
perf(clickhouse): an n-gram body index, so a line filter on a bare id…
sylvesterdamgaard Oct 25, 2026
610faad
perf(clickhouse): a sparse filter widens its next window by the rate …
sylvesterdamgaard Oct 25, 2026
9f68180
perf(clickhouse): a scan's page scales with what the predicate keeps
sylvesterdamgaard Oct 25, 2026
340deff
feat(clickhouse): migrate an older database, import a single node
sylvesterdamgaard Oct 25, 2026
1fd4add
feat(clickhouse): clusters of several shards
sylvesterdamgaard Oct 25, 2026
5ab791f
docs(clickhouse): no rustdoc links to private items in migrate
sylvesterdamgaard Oct 25, 2026
2270cec
Merge branch 'feat/clickhouse-migrate' into feat/clickhouse
sylvesterdamgaard Oct 25, 2026
3c125e5
Merge branch 'feat/clickhouse-shards' into feat/clickhouse
sylvesterdamgaard Oct 25, 2026
b0d5f14
test(clickhouse): migrate tests on one server when the suite runs sha…
sylvesterdamgaard Oct 25, 2026
95bc804
fix(server): a timed-out request says when to retry
sylvesterdamgaard Oct 25, 2026
3f26b11
docs: operating telemetryd on ClickHouse, and a command-line reference
sylvesterdamgaard Oct 25, 2026
2a5473c
fix: three review findings on the ClickHouse store
sylvesterdamgaard Oct 25, 2026
9c78f82
fix: refolds no longer race the pass in flight, and two review follow…
sylvesterdamgaard Oct 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,50 @@ jobs:
- name: Prometheus agrees with every expectation
run: python3 scripts/promql-conformance.py --check

# ClickHouse as the store: the Loki and Tempo corpora answered from it, its answers
# held to the local store's, a live tail across instances, two instances in front
# of different replicas of one replicated cluster agreeing — and all of it again on a
# cluster of two shards of two replicas, with instances in front of different shards.
clickhouse:
name: ClickHouse as the store
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
- name: a replicated ClickHouse cluster, and one of two shards
run: |
docker compose -f scripts/clickhouse/compose.yml up -d --wait
docker compose -f scripts/clickhouse/sharded/compose.yml up -d --wait
- name: every test that runs against ClickHouse
env:
TELEMETRYD_TEST_CLICKHOUSE_URL: http://td:td@127.0.0.1:18124
TELEMETRYD_TEST_CLICKHOUSE_CLUSTER: td
TELEMETRYD_TEST_CLICKHOUSE_REPLICAS: http://td:td@127.0.0.1:18124,http://td:td@127.0.0.1:18125
TELEMETRYD_TEST_CLICKHOUSE_SHARDED_CLUSTER: td_sharded
TELEMETRYD_TEST_CLICKHOUSE_SHARDED_UNSAFE_CLUSTER: td_sharded_unsafe
TELEMETRYD_TEST_CLICKHOUSE_SHARDED_URLS: http://td:td@127.0.0.1:18134,http://td:td@127.0.0.1:18136
TELEMETRYD_TEST_CLICKHOUSE_REQUIRED: "1"
run: cargo test --locked -p telemetryd-server -p telemetryd-query
- name: every test again, on two shards
env:
TELEMETRYD_TEST_CLICKHOUSE_URL: http://td:td@127.0.0.1:18134
TELEMETRYD_TEST_CLICKHOUSE_URL_CLUSTER: td_sharded
TELEMETRYD_TEST_CLICKHOUSE_CLUSTER: td_sharded
TELEMETRYD_TEST_CLICKHOUSE_REPLICAS: http://td:td@127.0.0.1:18134,http://td:td@127.0.0.1:18137
TELEMETRYD_TEST_CLICKHOUSE_SHARDED_CLUSTER: td_sharded
TELEMETRYD_TEST_CLICKHOUSE_SHARDED_UNSAFE_CLUSTER: td_sharded_unsafe
TELEMETRYD_TEST_CLICKHOUSE_SHARDED_URLS: http://td:td@127.0.0.1:18134,http://td:td@127.0.0.1:18136
TELEMETRYD_TEST_CLICKHOUSE_REQUIRED: "1"
run: cargo test --locked -p telemetryd-server -p telemetryd-query
- name: what ClickHouse said, if it refused
if: failure()
run: |
docker compose -f scripts/clickhouse/compose.yml logs --tail 200
docker compose -f scripts/clickhouse/sharded/compose.yml logs --tail 200

# The same for LogQL: `crates/server/tests/logql_conformance.rs` holds telemetryd to
# Loki's answers in `check`; this asks Loki again.
logql-conformance:
Expand All @@ -279,7 +323,7 @@ jobs:
ci:
name: ci
if: always()
needs: [check, deny, msrv, supply-chain, build, promql-conformance, logql-conformance, tempo-conformance]
needs: [check, deny, msrv, supply-chain, build, promql-conformance, logql-conformance, tempo-conformance, clickhouse]
runs-on: ubuntu-latest
steps:
# Parsed with jq rather than grep. The grep version worked, but only because
Expand Down
9 changes: 8 additions & 1 deletion BUILD-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,13 @@ cargo deny check # advisories, licenses, bans, sources
python3 scripts/generate-sbom.py --check
python3 scripts/check-docs.py
python3 scripts/soak.py target/debug/telemetryd # the binary, over HTTP
cargo test -p telemetryd-server -p telemetryd-query # again, on a replicated ClickHouse
```

The last runs in the "ClickHouse as the store" job against the two-replica cluster in
`scripts/clickhouse/compose.yml`, with `TELEMETRYD_TEST_CLICKHOUSE_REQUIRED=1` so a
test that could not reach ClickHouse fails rather than skips.

The soak is the one that runs the product rather than its parts: it starts the real
binary, pushes all three signals at it, queries them back through the Loki, Tempo and
Prometheus APIs, restarts the process and checks the data survived. It exists because
Expand Down Expand Up @@ -632,7 +637,9 @@ Not gaps. These are decisions:

- **Inbound TLS** — terminate at a reverse proxy. *Outbound* TLS is built: the key fetch, relay shipping and transfer all verify against roots compiled into the binary, or the host's store with the `platform-verifier` feature. That distinction was a defect before it was a decision.
- **Multi-tenancy** — `app` is a query namespace, not a security boundary
- **Clustering, replication, object-store tiering** — single node is the design
- **Clustering telemetryd itself** — with ClickHouse as the store, instances share
nothing but the database, and replication and tiering to object storage are
ClickHouse's (docs/cookbook/scale-out-on-clickhouse.md)
- **Plugins, relabelling rules, write-path transformations** — shape data in the
instrumentation
- **A separate "events" signal** — OpenTelemetry has no such signal. An event is a log
Expand Down
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tower = { version = "0.5", features = ["util"] }
# connections with a timer — see crates/server/src/connections.rs.
hyper = { version = "1", default-features = false, features = ["http1", "http2", "server"] }
hyper-util = { version = "0.1", default-features = false, features = ["tokio", "service"] }
tower-http = { version = "0.7", features = ["trace", "limit", "timeout", "catch-panic"] }
tower-http = { version = "0.7", features = ["trace", "limit", "catch-panic"] }
http-body-util = "0.1"

# serde + config
Expand Down
38 changes: 31 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ read APIs are three standards rather than ours. If this stops being the right to
the UI at Loki and Prometheus and run one export command. The exit is designed in, not
discovered later.

telemetryd is scoped deliberately: one team, a handful of apps, one VPS or a dev
laptop. It targets that case completely rather than scaling to a large fleet.
telemetryd starts where most teams are: one team, a handful of apps, one VPS or a dev
laptop, and it serves that case completely on its own.

**Single-node is a design choice, not a limitation we plan to remove.** It is what
lets us delete sharding, consensus, object-store tiering and a query scheduler — and
ship one static binary — about 15 MB — instead of a stack of services to operate. If you outgrow one
node, you have outgrown telemetryd, and we would rather say so than pretend
otherwise.
**One node is the default, and needs nothing else.** No database, no consensus, no
query scheduler: one static binary — about 15 MB — instead of a stack of services to
operate. When one machine stops being enough, the same binary runs as many instances as
you like in front of one ClickHouse, with the same APIs and the same answers; see
[Scale out on ClickHouse](docs/cookbook/scale-out-on-clickhouse.md).

> **Status: feature complete.** All three signals go in as OTLP/HTTP JSON (plus
> Prometheus `remote_write`), land in Parquet segments, and come back out through the
Expand Down Expand Up @@ -264,6 +264,30 @@ cargo bench -p telemetryd-store # measures the constants
cargo test -p telemetryd-store --test scale --release # asserts the asymptotics
```

The tests that run against ClickHouse skip unless they are given one. A replicated
cluster of two replicas, as CI runs, is in `scripts/clickhouse/compose.yml`:

```bash
docker compose -f scripts/clickhouse/compose.yml up -d --wait
TELEMETRYD_TEST_CLICKHOUSE_URL=http://td:td@127.0.0.1:18124 \
TELEMETRYD_TEST_CLICKHOUSE_CLUSTER=td \
TELEMETRYD_TEST_CLICKHOUSE_REPLICAS=http://td:td@127.0.0.1:18124,http://td:td@127.0.0.1:18125 \
TELEMETRYD_TEST_CLICKHOUSE_REQUIRED=1 \
cargo test -p telemetryd-server -p telemetryd-query
```

The same suite on a cluster of two shards of two replicas, as CI runs it too, with
`scripts/clickhouse/sharded/compose.yml` up: `TELEMETRYD_TEST_CLICKHOUSE_URL=http://td:td@127.0.0.1:18134`
and `TELEMETRYD_TEST_CLICKHOUSE_URL_CLUSTER=td_sharded`, plus
`TELEMETRYD_TEST_CLICKHOUSE_SHARDED_CLUSTER=td_sharded`,
`TELEMETRYD_TEST_CLICKHOUSE_SHARDED_UNSAFE_CLUSTER=td_sharded_unsafe` and
`TELEMETRYD_TEST_CLICKHOUSE_SHARDED_URLS=http://td:td@127.0.0.1:18134,http://td:td@127.0.0.1:18136`
for `tests/clickhouse_shards.rs`.

`TELEMETRYD_TEST_CLICKHOUSE_REQUIRED=1` turns a skip into a failure. Each test writes
to a database of its own, `td_test_*`, and leaves it behind for inspection;
`docker compose … down -v` removes them all.

Performance is held in place from two directions: benchmarks measure the constants,
and `tests/scale.rs` asserts the asymptotics as *segment-open counts* rather than
wall-clock times — so they mean something on a shared CI runner. See
Expand Down
2 changes: 2 additions & 0 deletions bin/telemetryd/src/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ pub fn run(args: &BenchArgs) -> anyhow::Result<()> {
exact_key: None,
columns: None,
required_text: None,
body_filters: &[],
},
&matchers,
&|_| true,
Expand Down Expand Up @@ -256,6 +257,7 @@ fn record(writer: usize, timestamp_nanos: u64) -> LogRecord {
attributes,
trace_id: None,
span_id: None,
resource: telemetryd_core::Labels::default(),
}
}

Expand Down
Loading
Loading