Repository navigation
Hand the Qdrant vector store a metrics factory, so its tracker emits (port of #1532) - #1682
Conversation
9f5458f to
4f0c836
Compare
edwinyyyu
left a comment
There was a problem hiding this comment.
- The commit trailer "(cherry picked from commit b6c90ab4070e2a5f3fb1d6c4fa2b7a7a4fd2e4ad)" names a sha that exists neither locally nor on GitHub; #1532's merge commit is b6c90ab (same 9-character prefix).
- The port also adds
MetricsFactoryIdMixinto database_conf.py's import block (speedkick had it via #1523); the adaptation list omits it.
a20d096 to
c85f3ff
Compare
QdrantVectorStore was the fourth component built without a metrics factory. OperationTracker accepts metrics_factory=None and then discards every timing without an error, so the store looked instrumented and emitted nothing - the same defect as the Neo4j store, the episode store and the session store, which is why no Qdrant latency was observable. QdrantConf gains MetricsFactoryIdMixin so it can resolve one, and database_manager passes it through. test_qdrant_creates_vector_store pinned the exact params and had to change. It now asserts metrics_factory is not None rather than pinning it: passing the keyword is not the property worth guarding, since None is accepted and silently discards everything. Removing the wiring fails it. Ported to main without MemMachine#1532's Dockerfile change (the EXTRAS build arg), which is unrelated to the wiring; the `metrics_factory_id` key is added to the database configuration table in the docs. (cherry picked from commit b6c90ab) Claude-Session: https://claude.ai/code/session_01Nr9kacmpFVTTfkZRw6esxP Co-authored-by: Claude Opus 5 <[email protected]>
c85f3ff to
f51702f
Compare
…he key too The row read "Qdrant: ...", but on main Neo4jConf carries the same mixin and the Neo4j store receives the resolved factory the same way (MemMachine#1678), with no docs row of its own. Named inline, as the table names Milvus on its rows. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
marvinyu-memverge
left a comment
There was a problem hiding this comment.
Approve at 1a0dc14. No asks; one observation.
Observation, not an ask: MilvusConf carries no MetricsFactoryIdMixin on main or on speedkick, and database_manager passes nothing to MilvusVectorStoreParams.metrics_factory (the field exists), so the Milvus store is the fifth component in the shape #1532 describes. Out of this PR's scope; flagging so it is on the list.
Verified: diff-of-diffs of f51702f against b6c90ab differs only in the stated omission (the Dockerfile ARG EXTRAS block) and the stated addition (the docs row), plus the import line your self-review already named; 1a0dc14 on top is the one docs line naming Neo4j on that row, which matches Neo4jConf on main. The wiring mirrors the Neo4j precedent at database_manager.py:267; QdrantVectorStoreParams.metrics_factory and the OperationTracker(params.metrics_factory, prefix="vector_store_qdrant") at :637 were already on main, so the one kwarg at :611 is the whole fix. get_metrics_factory() resolves the class-level "prometheus" factory every wired component shares, and it dedupes histograms by name, so two Qdrant confs in one process share one vector_store_qdrant_latency_seconds series with no duplicate registration. The test sees the real factory (QdrantVectorStore is patched, so no tracker is built in the unit test) and fails on KeyError if the kwarg is removed. CI green at head, no threads.
Port
Copy of #1532, merged into
speedkickasb6c90ab40, onmain: the same commit cherry-picked, keeping its author, wanghy73, with two differences: the Dockerfile change (anEXTRASbuild arg) is left out as unrelated to the wiring, and themetrics_factory_idkey is added to the database configuration table in the docs. A second commit rewords that row to name Neo4j alongside Qdrant, sinceNeo4jConftakes the same key onmain(#1678) and has no row of its own. The other three stores #1532 names, Neo4j, episode and session, were wired onmainby #1678 (the port of #1523); the Qdrant store is the one left.Purpose of the change
OperationTrackeracceptsfactory=Noneand then discards every timing without an error, a warning, or a series. A component that is fully instrumented but never handed a factory looks identical to one that was never instrumented; the only way to notice is to go looking for a metric that should exist and find nothing.That is what
QdrantVectorStorewas doing:QdrantVectorStoreParams.metrics_factorydefaults toNoneand nothing set it.QdrantConfgainsMetricsFactoryIdMixinso it can resolve one, anddatabase_managerpasses it through.test_qdrant_creates_vector_storepinned the exactQdrantVectorStoreParamskwargs and had to change. It now assertsmetrics_factory is not Nonerather than pinning a value: passing the keyword is not the property worth guarding, sinceNoneis accepted and silently discards everything. Removing the wiring fails it.Stack
23 PRs on
main: 5 independent ones, and three consecutive stages numbered on their own: the vector store scale-out, the SQLite store fixes and the vector store contract changes. A stacked PR's diff on GitHub is cumulative until the PRs under it merge.Independent PRs, each directly on
main; review and merge in any order:The vector store stages, consecutive: each stacked on the one below. [vector store scale-out 1/5] is directly on
mainand 2/5 on it alone; they do not depend on the independent PRs. From 3/5 up, the chain's history also carries the independent PRs' commits beneath it, since the later stages were written on top of them ([vector store contract 2/6] on #1624's session policy, for one); so a merge of an independent PR rebases the chain without conflict, and until they merge those PRs' changes show in a stacked PR's diff.speedkick, #1588)speedkick, #1589)This PR is two commits,
f51702f15(the port) and1a0dc145a(the docs-row wording), directly onmain, independent of the others: review and merge it in any order among the independent PRs (a later one touching the same file rebases). The stages' history carries the same change from [vector store scale-out 3/5] up, so their diffs include it until it merges.Verification
At
f51702f15, on 2026-09-21:ruff checkandruff format --checkclean;ty checkclean as CI runs it (uv run --frozen --all-extras ty check --project packages/server); the full server suite without integration tests passes (pytest packages/server/server_tests -m "not integration"), 1914 tests atf51702f15.1a0dc145achanges one line ofdocs/open_source/configuration.mdxand nothing else.🤖 Generated with Claude Code
https://claude.ai/code/session_01ESpWYTmCR7X3bJEpoA8SAn