Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
879fde6
feat: add Metrics interface to logstore driver
alexluong Mar 4, 2026
bf7bbaa
test: add metrics conformance tests with 300-row dataset
alexluong Mar 4, 2026
fa54da8
feat: implement Postgres logstore metrics queries
alexluong Mar 4, 2026
6898241
feat: implement ClickHouse logstore metrics queries
alexluong Mar 4, 2026
2aaec3e
refactor: remove unimplemented check from metrics conformance tests
alexluong Mar 4, 2026
2bfa9e9
feat: add metrics API endpoints for events and attempts
alexluong Mar 6, 2026
55fbc47
style: gofmt metrics handlers
alexluong Mar 6, 2026
5dbd26f
refactor: remove duplicate derefIntFromIntPtr helper
alexluong Mar 6, 2026
8267a71
fix: add missing tenant_id and attempt_number dimensions to memlogsto…
alexluong Mar 6, 2026
3ae96a1
test: add metrics time-series characteristics conformance suite
alexluong Mar 7, 2026
8aa26a8
chore: bump Go from 1.24 to 1.26
alexluong Mar 8, 2026
f854c02
feat: add post-query bucket filling for metrics time series
alexluong Mar 8, 2026
91c0a2c
fix: wire missing attempt metric filters (code, manual, attempt_number)
alexluong Mar 9, 2026
84c4a1b
refactor: rename date_range to time in metrics API query params and D…
alexluong Mar 10, 2026
010bc04
fix: remove eligible_for_retry from event metrics dimensions and filters
alexluong Mar 10, 2026
0e273d5
refactor: adopt bracket notation array params for metrics API
alexluong Mar 10, 2026
9adb56d
feat: add rate throughput measures to metrics API
alexluong Mar 10, 2026
55e2ac2
test: add rate measure coverage to drivertest
alexluong Mar 10, 2026
713a9b5
feat: add ClickHouse SETTINGS constraints to metrics queries
alexluong Mar 10, 2026
ba043f1
fix: validate time range in metrics queries to prevent div-by-zero in…
alexluong Mar 10, 2026
20ffe3a
fix: add missing tenant_id and attempt_number dimensions to CH and PG…
alexluong Mar 10, 2026
fd54780
refactor: remove dead MetricsMetadata.Granularity field
alexluong Mar 10, 2026
ab40c9c
refactor: move tenant scoping from TenantID field to filters[tenant_id]
alexluong Mar 10, 2026
8d6195b
fix: add defensive guards and validation to metrics time bucketing
alexluong Mar 10, 2026
e6b104a
test: add failing test for 2d granularity data loss
alexluong Mar 10, 2026
aa98cf3
fix: use epoch-anchored alignment for multi-value d/w/M granularities
alexluong Mar 10, 2026
205478c
feat(portal): add metrics dashboard to destination overview
alexluong Mar 8, 2026
5987dc1
fix(portal): replace ResponsiveContainer to fix -1px dimension warnings
alexluong Mar 8, 2026
c170477
feat(portal): redesign metrics dashboard layout and add event count c…
alexluong Mar 9, 2026
bb47c93
feat(portal): add events 24h sparkline column to destinations list
alexluong Mar 9, 2026
3bc00ad
fix(portal): clean up import order and simplify useMetrics URL building
alexluong Mar 10, 2026
ec8e02c
fix: Fix metrics table histogram display
alexbouchardd Mar 10, 2026
d98a42f
chore: Destination page metrics improvements
alexbouchardd Mar 11, 2026
9dd9fda
chore: Update time range picker styling
alexbouchardd Mar 11, 2026
eccac65
fix: Fix metric breakdown height and dimension ellipsis
alexbouchardd Mar 11, 2026
c1d2736
chore: add metrics seed & QA scripts
alexluong Mar 11, 2026
9c71c34
fix(portal): exclude manual retries from event count metrics
alexluong Mar 11, 2026
37dba1a
fix: exclude manual retries from first_attempt_count measure
alexluong Mar 11, 2026
a585217
bench: add metrics benchmarking suite for ClickHouse and PostgreSQL
alexluong Mar 6, 2026
26cd1d6
bench: update metrics bench for new API and add coverage for rate, gr…
alexluong Mar 10, 2026
11b9197
Merge remote-tracking branch 'origin/main' into metrics
alexluong Mar 13, 2026
340bff9
fix: align metrics with 1-based attempt_number indexing
alexluong Mar 13, 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
2 changes: 1 addition & 1 deletion build/Dockerfile.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Stage 0
# Build the binaries
FROM golang:1.24-alpine
FROM golang:1.26-alpine
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
Expand Down
2 changes: 1 addition & 1 deletion build/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.24-alpine AS fetch
FROM golang:1.26-alpine AS fetch
RUN go install github.com/air-verse/air@v1.61.1
WORKDIR /app
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion build/test/Dockerfile.mock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.24-alpine
FROM golang:1.26-alpine
WORKDIR /app
COPY . .
RUN go build -o /bin/mock ./cmd/destinations/mock
Expand Down
83 changes: 83 additions & 0 deletions cmd/bench/metrics/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Metrics Benchmarks Makefile
# Usage: cd cmd/bench/metrics && make <target>

OUTPOST_ROOT := $(shell git rev-parse --show-toplevel)
PG_URL := postgres://outpost:outpost@localhost:5488/bench?sslmode=disable
CH_ADDR := localhost:9009
CH_DB := bench
PG_ROWS := 10000000
CH_ROWS := 10000000

# ── Infra ────────────────────────────────────────────────────────────────────

up/pg:
docker compose -f pg/docker-compose.yml up -d

up/ch:
docker compose -f ch/docker-compose.yml up -d

up: up/pg up/ch

down/pg:
docker compose -f pg/docker-compose.yml down -v

down/ch:
docker compose -f ch/docker-compose.yml down -v

down: down/pg down/ch

# ── Migrations ───────────────────────────────────────────────────────────────

migrate/pg:
cd $(OUTPOST_ROOT) && BENCH_PG_URL="$(PG_URL)" \
go test -run='^$$' -bench=BenchmarkPG -benchtime=1x ./cmd/bench/metrics/

migrate/ch:
cd $(OUTPOST_ROOT) && BENCH_CH_ADDR="$(CH_ADDR)" BENCH_CH_DB="$(CH_DB)" \
go test -run='^$$' -bench=BenchmarkCH -benchtime=1x ./cmd/bench/metrics/

migrate: migrate/pg migrate/ch

# ── Seeding ──────────────────────────────────────────────────────────────────

seed/pg:
psql "$(PG_URL)" -v ROWS=$(PG_ROWS) -f pg/seed.sql

seed/ch:
clickhouse client --port 9009 --database $(CH_DB) \
--param_rows $(CH_ROWS) < ch/seed.sql

# ── Benchmarks ───────────────────────────────────────────────────────────────

bench/pg:
cd $(OUTPOST_ROOT) && BENCH_PG_URL="$(PG_URL)" \
go test -bench=BenchmarkPG -benchtime=1x -count=1 -timeout=30m ./cmd/bench/metrics/

bench/ch:
cd $(OUTPOST_ROOT) && BENCH_CH_ADDR="$(CH_ADDR)" BENCH_CH_DB="$(CH_DB)" \
go test -bench=BenchmarkCH -benchtime=1x -count=1 -timeout=30m ./cmd/bench/metrics/

bench/pg/sustained:
cd $(OUTPOST_ROOT) && BENCH_PG_URL="$(PG_URL)" \
go test -bench=BenchmarkPG -benchtime=10s -count=3 -timeout=30m ./cmd/bench/metrics/

bench/ch/sustained:
cd $(OUTPOST_ROOT) && BENCH_CH_ADDR="$(CH_ADDR)" BENCH_CH_DB="$(CH_DB)" \
go test -bench=BenchmarkCH -benchtime=10s -count=3 -timeout=30m ./cmd/bench/metrics/

bench: bench/pg bench/ch

# ── Full workflow ────────────────────────────────────────────────────────────

setup/pg: up/pg migrate/pg seed/pg
setup/ch: up/ch migrate/ch seed/ch
setup: setup/pg setup/ch

reset/pg: down/pg up/pg migrate/pg seed/pg
reset/ch: down/ch up/ch migrate/ch seed/ch

.PHONY: up/pg up/ch up down/pg down/ch down \
migrate/pg migrate/ch migrate \
seed/pg seed/ch \
bench/pg bench/ch bench/pg/sustained bench/ch/sustained bench \
setup/pg setup/ch setup reset/pg reset/ch
63 changes: 63 additions & 0 deletions cmd/bench/metrics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Metrics Benchmarks

Benchmarks `QueryEventMetrics` / `QueryAttemptMetrics` against PostgreSQL and ClickHouse.

Shared test cases in `bench_test.go`, backend-specific setup in `pg_test.go` / `ch_test.go`.

## Quick Start

```bash
cd outpost/cmd/bench/metrics

# ── ClickHouse ───────────────────────────────
make setup/ch # up + migrate + seed (10M)
make bench/ch # single iteration
make bench/ch/sustained # 10s x 3 runs
make down/ch # cleanup

# ── PostgreSQL ───────────────────────────────
make setup/pg # up + migrate + seed (10M)
make bench/pg # single iteration
make bench/pg/sustained # 10s x 3 runs
make down/pg # cleanup

# ── Both ─────────────────────────────────────
make setup # setup both
make bench # bench both
make down # cleanup both
```

### Individual steps

```bash
make up/ch # start container
make migrate/ch # run migrations
make seed/ch # seed data (default 10M, override: make seed/ch CH_ROWS=1000000000)
make bench/ch # run benchmarks
make reset/ch # down + up + migrate + seed (fresh start)
```

Same targets available for `/pg`.

## Structure

```
metrics/
Makefile # all commands
bench_test.go # shared test cases + date ranges + helpers
pg_test.go # PG setup (BENCH_PG_URL)
ch_test.go # CH setup (BENCH_CH_ADDR)
pg/ # PG infra (docker-compose, seed.sql)
ch/ # CH infra (docker-compose, seed.sql, config/)
```

## Data Distribution

Deterministic via modulo arithmetic (identical for both backends):

- **2 tenants** — `tenant_0` (90%), `tenant_1` (10%)
- **500 destinations** — `dest_0` through `dest_499`
- **3 topics** — `order.created`, `order.updated`, `payment.received`
- **Time** — evenly spread across January 2000
- **Attempts** — chained retries (1 event -> 1-4 attempts), 0.5% permanently failed
- 10M events -> ~12.6M attempts (22.6M total rows)
Loading
Loading