Repository navigation
logging: log /admin/stats as its own route, status only (TC-1482) - #372
Conversation
Adds the /admin/stats route label to the log-shipper field list (copy of the tinycloud-dev canonical list), the ingress route map and the Vector boundary cases. Re-pins log-shipper/canonical.json to the tinycloud-dev PR head, so the pin MUST be updated after that PR merges. Regenerates the embedded Vector config in the N0 compose and its fixture, and moves the N0 template lock. Route template plus status only; no query, credential, body or address (TC-961).
# Conflicts: # .github/workflows/docker.yml # docs/releasing.md # docs/runbooks/tc-959-n0-log-shipping.md
|
APPROVE: see TC-1482 (reviewed exact head 2dc8e4b) Independent review (Opus gate) of the logging delta Combined hashes, recomputed with docker.yml's
TC-961, route + status only:
Merge-order precondition:
(a)(b)(c) against the combined compose: unchanged from my #371 comment.
CI at 2dc8e4b when posting: pass: Build dstack ingress image, Version guard, at-rest harness, boundary, build (workspace), capabilities, clippy (workspace), fmt (workspace), hosted-compose-proof, m1-realdata, plan, separate workspace lockfiles, w5 workspace lockfile. Pending: |
|
APPROVE: see TC-1274 (reviewed exact head ed81bd1) |
Stacking
This PR is stacked on #371 (
feat/tc-1482-deploy-wiring, head03810e2944bd55f45124d07b43931fb262f895f1), which merges first. The stack base is unchanged: the base branch is still #371's, and #371's head is merged into this branch (merge commited81bd19; the branch heldfe16c319before, and #371 had moved on to03810e29). The base is #371's branch so the diff shows only the logging change. After #371 merges, retarget the base tomain. This PR contains a merge of #371's head and resolves the shared lock files so both changes are present.Change
GET /admin/stats(#370) is logged as its own route, route template plus status only. Refs TC-1482. Production logs are public (TC-961), so no query string,Authorizationheader or token, request or response body, client address, space ID, DID or key is logged for it.log-shipper/fields.json: copy of the tinycloud-dev canonical field list (tinycloud-dev PR https://github.com/samgbafa/tinycloud-dev/pull/163): adds the/admin/statsroute value next to/admin/usage.log-shipper/canonical.json: provenance pin moved to that PR's headee823cd5e2aed6ece73bc80ce5123793f67a0e99and the new sha256cff33bf50586d8a4425ca1584f125bd891380b74eef76de8e5da690d442ce6d8(the/admin/statsroute and the threecurrent_kv_c_index_*event codes). This pin points at the unmerged perf(TC-286): bound Prometheus route-label cardinality #163 head; after tinycloud-dev perf(TC-286): bound Prometheus route-label cardinality #163 merges, re-pinrevisionto its merge commit (see below).deploy/ingress/redacted-logging.conf:/admin/statsis a literal route in the$tc_routemap. The log format is unchanged: route, method, status and timings only. Without this entry it logs as<other>.log-shipper/cases.mjs: Vector cases for node and ingress/admin/statslines (exact output key set; authorization, query, uri, body, address and upstream values never appear) and a rejected route with a query string.docker-compose.dstack-postgres.yamlandscripts/ci/fixtures/tc959-n0-compose.yaml: embeddedVECTOR_CONFIG_JSONregenerated from the compiler. The compose keeps TC-1482: wire optional NODE_STATS_READ_TOKEN into the production deploy (companion to #370) #371'sNODE_STATS_READ_TOKENline and the two files are byte-identical..github/workflows/docker.yml,docs/releasing.mdand the TC-959 runbook: raw compose32a002ef5751817619423c9e60776e03f2c3517315f5aa3a9c8654e3394777f1, template79469f97a8dcecc7856caa11b26e3004b36d4b8ae9e16a51f963d0687992b9fb(route, TC-1482: wire optional NODE_STATS_READ_TOKEN into the production deploy (companion to #370) #371's env line and the three codes together; before the codes: rawd1fcd66534e3131c691935b7b1dc774d93f8b1e75dab52b178cafba59b2cbdbf, template87b5d12a86f07f33ae68832c802894c061a6b4e194aea078cb5eb95a068719aa; TC-1482: wire optional NODE_STATS_READ_TOKEN into the production deploy (companion to #370) #371 alone was raw8f67b3b2…, templateae497fed…).log-shipper/diagnostics.jsonandlog-shipper/cases.mjs(TC-1274, tinycloud-node feat(TC-1274): seek KV list ranges on a COLLATE "C" index; hold the legacy-artifact fence scan for 60 s #374): the three constant messages of migrationm20261020_000000_current_kv_key_c_index(feat(TC-1274): seek KV list ranges on a COLLATE "C" index; hold the legacy-artifact fence scan for 60 s #374 heada353d209574c9b3639d646c1ff4a55346170550a) map by exact text tocurrent_kv_c_index_missing(warn),current_kv_c_index_invalid(warn) andcurrent_kv_c_index_wrong_shape(error); targettinycloud_core::migrations::…matches the existingtinycloud_core::rule. One Vector case per code (canary inevent,index,reason; exact output key set). If feat(TC-1274): seek KV list ranges on a COLLATE "C" index; hold the legacy-artifact fence scan for 60 s #374 changes a message, this mapping must be re-synced. The ingress redacted-logging config is unchanged.deploy/ingress/test-redacted-logging.sh: also requests/admin/stats?token=<canary>and expects the lineGET /admin/stats 200with the token absent. It needs Docker and was not run here.CHANGELOG.md: one entry.Re-pin after the tinycloud-dev PR merges (separate from the retarget)
This PR stays a draft until tinycloud-dev #163 merges.
canonical.jsonrevisionto its merge commit onmain.sha256stayscff33bf50586d8a4425ca1584f125bd891380b74eef76de8e5da690d442ce6d8whileops/logging/fields.jsonis unchanged by review.ops/logging/fields.json, copy it byte-for-byte tolog-shipper/fields.json, updatesha256, regenerate the embeddedVECTOR_CONFIG_JSON(compose and fixture), and move the N0 template lock again.Other open PRs
#370 touches
CHANGELOG.mdanddocs/releasing.md(textual overlap only). #353, #356 and #357 touchCHANGELOG.mdonly, #359 touches none of these files. #342 and #288 are older open PRs that touchlog-shipper/*and the compose.Verification (no Docker, no deploy)
vector testforerrors_slowandall_requests, 95 cases each (92 + the threecurrent_kv_c_index_*cases), 0 failed;vector validateof the rendered runtime config passes;log-shipper/native-check.mjspasses with 0 canary hits.node --testforbudget,profile,tc959-docker,tc959-readiness: 33 pass.scripts/ci/test-deploy-recovery.py: 25 pass (after merging TC-1482: wire optional NODE_STATS_READ_TOKEN into the production deploy (companion to #370) #371's head).NODE_STATS_READ_TOKENline, and the compose equals the fixture. Mutations: pointingcurrent_kv_c_index_invalidatunclassifiedfails its Vector case; removing an enum entry fromfields.jsonfailsnode --testand the pin hash. The lock indocker.ymlequals the template hash computed with the workflow's own normalization.nginx -tpasses on a local nginx 1.18 withredacted-logging.conf. With a stub upstream returning a body,/admin/stats?token=…with anAuthorizationheader logs only{"method":"GET","route":"/admin/stats","status":401,…}. The token,Bearer, query, address, User-Agent and upstream body do not appear./admin/stats/extralogs<other>.scripts/tc959-check.mjsitself (needsdocker compose config),deploy/ingress/test-redacted-logging.sh(Docker), the hosted compose proof (CI).The
/admin/statsingress label reaches production only when the ingress image is rebuilt fromdeploy/ingressand re-pinned.