observability: remove cadvisor #681

Closed
kert wants to merge 0 commits from chore/remove-cadvisor into main
Owner

Rootless Docker hides container names from cgroup-based exporters, so this cadvisor only ever emitted anonymous series (152 live, zero with a name label). Every panel that queried it has been blank since it was added.

Removed

  • compose.yml: the cadvisor service (privileged, rootfs/sys/docker.sock mounts).
  • infra/prometheus/targets/services.yml: the cadvisor:8080 file_sd target.
  • tests/test_observability.py: TestCadvisor; the targets test now asserts the job is absent; dropped from PROMTAIL_LABELED. tests/test_compose_mounts.py: dropped from the privileged-exempt set.
  • infra/grafana/dashboards/homelab-overview.json: Containers up, Container CPU %, Container memory (MiB) (stat row re-flowed, logs panel moved up). infra/grafana/dashboards/gpu-notebooks.json: Notebooks/Zotero CPU % and memory.

Applied live (2026-09-08): container and gcr.io/cadvisor/cadvisor:latest image removed. Prometheus has already dropped the target (file_sd refresh); Grafana re-provisions the trimmed dashboards on its next scan.

Verification: pytest tests/test_observability.py tests/test_compose_mounts.py → 34 passed; docker compose config renders. The May 2026 plan/spec under docs/superpowers/ still mention cadvisor as history.

Rootless Docker hides container names from cgroup-based exporters, so this `cadvisor` only ever emitted anonymous series (152 live, zero with a `name` label). Every panel that queried it has been blank since it was added. **Removed** - `compose.yml`: the `cadvisor` service (privileged, rootfs/sys/docker.sock mounts). - `infra/prometheus/targets/services.yml`: the `cadvisor:8080` file_sd target. - `tests/test_observability.py`: `TestCadvisor`; the targets test now asserts the job is absent; dropped from `PROMTAIL_LABELED`. `tests/test_compose_mounts.py`: dropped from the privileged-exempt set. - `infra/grafana/dashboards/homelab-overview.json`: *Containers up*, *Container CPU %*, *Container memory (MiB)* (stat row re-flowed, logs panel moved up). `infra/grafana/dashboards/gpu-notebooks.json`: *Notebooks/Zotero CPU %* and *memory*. **Applied live (2026-09-08):** container and `gcr.io/cadvisor/cadvisor:latest` image removed. Prometheus has already dropped the target (file_sd refresh); Grafana re-provisions the trimmed dashboards on its next scan. **Verification:** `pytest tests/test_observability.py tests/test_compose_mounts.py` → 34 passed; `docker compose config` renders. The May 2026 plan/spec under `docs/superpowers/` still mention cadvisor as history.
kert added 40 commits 2026-09-09 01:19:15 +00:00
The re-farm script's first step walked all 12 PFS dockets (~93k comments,
~5 h of API budget) before reaching CMS-2026-2377. fetch-docket-comments
is not a substitute: it omits the reg-docket:<id> tag that
backfill-comments --docket filters on. Add --docket to fetch-pfs-comments
so tagging stays identical and the other dockets are skipped.
The API backfill enriches ~970 comments/hr, so 15k new comments meant a
next-day index. The Mirrulations mirror is a superset of the live docket
(18,651 vs 18,647 comments on 2026-09-08) and runs ~600/min, creating,
tagging and enriching items identically. Run mirror → extract → index
first, then the API list walk + backfill + incremental extract/index to
catch anything the mirror lags on.
Fix round 1: the sealed-docket test file's _store() helper never closed
its in-memory Store, and extract's file-backed lookup connection was
never closed either — both leaked sqlite3 connections that surfaced as
nondeterministic ResourceWarnings when GC'd during unrelated tests.
Replace _store() with a store fixture that closes on teardown, and have
extract() close the private read connection _build_bib_helpers opens
for file-backed stores (the :memory: case still reuses store's own
connection, left untouched). Also reworded the _build_bib_helpers
docstring: attach_callback is None for --no-bib or --no-attach; the
store is None only for --no-bib.
`stack llm index` read index_docket_state before anything had created
it: migrate() only ran inside index_refs, so the first sealed run on an
un-migrated database died with UndefinedTable. Build one engine in the
CLI, migrate it, and hand it down (index_refs takes an `engine` kwarg);
--force still builds nothing.

index_refs also marked a sealed docket complete when some of its refs
loaded blank or produced no chunks — a seal claiming coverage the run
never achieved. Count unindexable refs per docket and write
index_docket_state only for dockets with none.
An empty walk over a docket bib never ingested (a farm that never
landed) satisfied should_seal and sealed it shut with zero comments.
Read docket_counts before sealing and require at least one stored
comment; the counts read is reused for the seal row.

--force also skipped attachments for every comment whose row came back
"unchanged", so the one flag meant to repair a docket could not repair
its missing files.
apply() deleted storage copies inside the BEGIN/COMMIT, so a failure
partway through rolled the rows back and left the surviving rows
pointing at files that were already gone. Collect the doomed paths
during the transaction, COMMIT, then unlink — rows and files can now
only be lost together.

--apply also prints how many keys it removed (first 20), and main()
closes the connection it opens.
is_current() stat'd every source file bare, so a file removed between
iterdir() and stat() aborted the whole extract run; a vanished source
now just doesn't affect currency.

The lazy Zotero snapshot stamped the snapshot with the source's mtime
even when shutil.copy2 had failed, which would have passed a stale
snapshot off as current on every later run. Copying moved into
_copy_snapshot() so both callers know whether it worked.

Docs: upsert_status spells out the merge rules (extra_json exempt from
empty-keeps-stored, tags/collections union-merged) and
`backfill-comments --force` says it bypasses the docket seal only.
The class drove `fetch-pfs-comments` against a MagicMock store to cover
line numbers that no longer exist — the same defect as the class removed
in 3df7a3f. A mock store asserts nothing about the fetch loop, which now
lives in walk_docket and is covered by tests/bib/test_walk_docket.py and
tests/cli/test_bib_fetch_sealed.py.
Treating a blank load() as unindexable defeated the feature it was
meant to protect: four of the eleven historical dockets hold 1-2
comments with no text at all, so none of them could ever be marked
complete and ~130k items would be re-listed on every run.

An item with no text is a finished state, not a failure. Stamp it into
index_state with content_hash='' / chunk_count=0 and its fingerprint —
the empty hash cannot collide with a real sha256 — so the next run
fingerprint-skips it without a load, and it no longer blocks its
docket's completion. Text appearing later changes the fingerprint and
the item is embedded normally.

Only a ref that loaded *with* text and chunked to nothing stays
unindexable and blocks index_docket_state; the embed/write path already
aborts the whole run on error. The index_state upsert both callers need
is now _record_state().
chore(observability): remove cadvisor
Some checks failed
CI / lint (push) Successful in 34s
CI / notebooks-smoke (push) Successful in 1m32s
CI / lint (pull_request) Successful in 29s
CI / test (push) Has been cancelled
CI / notebooks-smoke (pull_request) Successful in 1m33s
Infra CI / notebooks (pull_request) Successful in 5m44s
Infra CI / zotero (pull_request) Successful in 27s
Infra CI / docs (pull_request) Successful in 1m42s
Infra CI / api (pull_request) Successful in 1m12s
Infra CI / llm (pull_request) Successful in 51s
Infra CI / mc (pull_request) Successful in 13s
CI / test (pull_request) Successful in 24m12s
caf43846c5
Rootless Docker hides container names from cgroup-based exporters, so
cadvisor only ever produced anonymous series here (152 of them, none
with a name label). The five dashboard panels that queried it have been
blank since it was added; drop the service, its scrape target, the
tests that pinned it, and those panels.
kert added 1 commit 2026-09-09 01:23:39 +00:00
docs: drop the cadvisor task and mentions from the observability plan and spec
Some checks failed
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / notebooks-smoke (push) Has been cancelled
Infra CI / notebooks (push) Has been cancelled
Infra CI / zotero (push) Has been cancelled
Infra CI / docs (push) Has been cancelled
Infra CI / api (push) Has been cancelled
Infra CI / llm (push) Has been cancelled
Infra CI / mc (push) Has been cancelled
CI / lint (pull_request) Successful in 33s
CI / notebooks-smoke (pull_request) Successful in 1m32s
Infra CI / notebooks (pull_request) Successful in 1m12s
Infra CI / zotero (pull_request) Successful in 14s
Infra CI / docs (pull_request) Successful in 13s
Infra CI / api (pull_request) Successful in 12s
Infra CI / llm (pull_request) Successful in 17s
Infra CI / mc (pull_request) Successful in 13s
CI / test (pull_request) Successful in 17m57s
aadf037b5e
kert added 1 commit 2026-09-09 01:23:52 +00:00
docs: last mention in the observability plan architecture note
All checks were successful
CI / lint (pull_request) Successful in 36s
CI / notebooks-smoke (pull_request) Successful in 1m23s
CI / lint (push) Successful in 30s
CI / test (pull_request) Successful in 17m32s
CI / notebooks-smoke (push) Successful in 1m20s
Infra CI / notebooks (pull_request) Successful in 53s
Infra CI / zotero (pull_request) Successful in 14s
Infra CI / docs (pull_request) Successful in 20s
Infra CI / api (pull_request) Successful in 13s
Infra CI / llm (pull_request) Successful in 13s
Infra CI / mc (pull_request) Successful in 22s
Infra CI / notebooks (push) Successful in 46s
CI / test (push) Successful in 14m45s
Infra CI / zotero (push) Successful in 18s
Infra CI / docs (push) Successful in 12s
Infra CI / api (push) Successful in 13s
Infra CI / llm (push) Successful in 12s
Infra CI / mc (push) Successful in 15s
d0d80c4f47
kert closed this pull request 2026-09-09 14:39:11 +00:00
kert deleted branch chore/remove-cadvisor 2026-09-09 14:39:11 +00:00
Some checks are pending
CI / lint (pull_request) Successful in 36s
CI / notebooks-smoke (pull_request) Successful in 1m23s
CI / lint (push) Successful in 30s
CI / test (pull_request) Successful in 17m32s
CI / notebooks-smoke (push) Successful in 1m20s
Infra CI / notebooks (pull_request) Successful in 53s
Infra CI / zotero (pull_request) Successful in 14s
Infra CI / docs (pull_request) Successful in 20s
Infra CI / api (pull_request) Successful in 13s
Infra CI / llm (pull_request) Successful in 13s
Infra CI / mc (pull_request) Successful in 22s
Infra CI / notebooks (push) Successful in 46s
CI / test (push) Successful in 14m45s
Infra CI / zotero (push) Successful in 18s
Infra CI / docs (push) Successful in 12s
Infra CI / api (push) Successful in 13s
Infra CI / llm (push) Successful in 12s
Infra CI / mc (push) Successful in 15s
ci/woodpecker/push/ci
Required
ci/woodpecker/pr/ci
Required
ci/woodpecker/push/infra-ci
Required
ci/woodpecker/pr/infra-ci
Required

Pull request closed

Sign in to join this conversation.