Skip to content

feat(server): add Stage A observability for multi-doc reuse - #67

Open
7774596 wants to merge 4 commits into
masterfrom
feat/multi-doc-production
Open

7774596 wants to merge 4 commits into
masterfrom
feat/multi-doc-production

Conversation

@7774596

@7774596 7774596 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Stage A observability for multi-document chunk reuse: opt-in Prometheus /metrics, /diag/explain, and a baseline measurement script.
  • Track chunk access safely with read-only diagnostic lookup paths so metrics and diagnostics do not pollute LFU/LRU access counters.
  • Wire --enable-metrics into python -m daser.server and add tests for metrics, diagnostics, CLI behavior, msgpack compatibility, and lookup access accounting.

Test plan

  • ruff check daser/ tests/
  • ruff format --check daser/ tests/
  • ruff check examples/baseline_measure/measure.py
  • ruff format --check examples/baseline_measure/measure.py
  • PYTHONHASHSEED=0 /data/sza/conda_env/daser/bin/python -m pytest -q -m "not integration" --ignore=tests/integration --ignore=tests/connector/test_daser_connector.py --ignore=tests/connector/test_gds_transfer.py tests/ (215 passed, 1 skipped)
  • Manual HTTP smoke on GPU 1 with /health, /documents, /diag/explain, /infer, and /metrics passing; store-dir /data/sza/daser-http-smoke-stagea

Notes

  • Stage flags remain opt-in; metrics are disabled unless --enable-metrics is passed.
  • Smoke services were stopped after validation; logs are under /data/sza/vllm_daser_smoke_8011.log and /data/sza/daser_http_smoke_2036.log.

7774596 added 4 commits June 8, 2026 12:06
Consolidate the production-grade plan for user-managed multi-document
chunk reuse into a single optimization record under
``docs/optimizations/``. The document captures positioning, SLA
targets, connector capability boundary, staged roadmap (observability,
DocSet management, hierarchical cache, accuracy safety net), data
model extensions, CLI flags, test matrix, risks, rollback plan, and
PR breakdown. No source code changes; later PRs land each stage behind
independent feature flags.
Lay the metadata foundation for production observability and the
later LFU+LRU hybrid eviction policy.

- ChunkMeta gains ``access_count`` and ``last_access_time``; both
  default to zero / ``created_at`` so existing call sites are
  unaffected.
- ``MetadataStore.load`` now reads chunks through a
  ``_chunk_meta_from_payload`` helper that drops unknown payload
  keys, keeping msgpack records both forward- and backward-compatible
  as later production stages add more fields.
- ``MetadataStore.touch`` updates the stats and ``ServerCore.lookup``
  calls it for every matched chunk, so hit traffic alone is enough
  to drive eviction and metrics later.
- Unit tests cover the new defaults, the touch contract, both
  msgpack compatibility directions, and the existing lookup paths.
Align Stage A lookup tests with master prefix index helpers after rebase.
Expose opt-in Prometheus metrics and diagnostic cache explanations for the HTTP service, while keeping diagnostic lookups read-only so access counters reflect production demand. Add a baseline measurement script and tests for metrics, diagnostics, CLI wiring, and lookup access accounting.
@7774596
7774596 requested a review from GentleCold June 9, 2026 08:42
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