Skip to content

feat(metrics): Prometheus /metrics on worker and master - #140

Merged
beinan merged 1 commit into
lance-format:mainfrom
beinan:metrics-endpoints
Jul 14, 2026
Merged

beinan merged 1 commit into
lance-format:mainfrom
beinan:metrics-endpoints

Conversation

@beinan

@beinan beinan commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • New shared lance-context-metrics crate: installs a process-wide Prometheus recorder, exposes GET /metrics on each binary's main HTTP port, HTTP request count/latency middleware, and process CPU/memory/FD/thread gauges (metrics-process) refreshed per scrape.
  • Worker (data-plane): rollout appends, WAL-cleanup outcomes, compaction success/failure/duration, LRU cache hit/miss + resident-store gauge.
  • Master (control-plane): stats-scan duration + experiment aggregate gauges (count/rows/fragments).
  • Each process exposes only its own metrics — ready for Prometheus/Datadog scraping.

Test plan

  • cargo build --workspace
  • cargo clippy clean on metrics/server/master
  • cargo fmt --all
  • metrics crate unit test: /metrics renders Prometheus text
  • live smoke: worker /metrics returns process + domain metrics, /health OK

🤖 Generated with Claude Code

Add a shared `lance-context-metrics` crate that installs a process-wide
Prometheus recorder, exposes `GET /metrics` on each binary's main HTTP
port, records HTTP request count/latency via middleware, and emits
process CPU/memory/FD/thread gauges (metrics-process) refreshed per scrape.

Worker (data-plane) instruments rollout appends, WAL cleanup outcomes,
compaction success/failure/duration, and LRU cache hit/miss + resident
store gauge. Master instruments stats-scan duration and experiment
aggregate gauges (count/rows/fragments). Each process exposes only its
own metrics, ready for Prometheus/Datadog scraping.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@beinan
beinan force-pushed the metrics-endpoints branch from 1d6d49c to a1e448d Compare July 14, 2026 17:19
@beinan
beinan merged commit 39aead1 into lance-format:main Jul 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant