mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-10 10:13:50 +08:00
Closes #1802. ## What this does Deletes the `ate.scheduler.eligible_workers` histogram. Nothing replaces it in this PR. ## Why **It is expensive on the resume path.** `Schedule` built a second slice of the matching workers that scheduling never read, walked it again, and repeated `HasRoom` for each entry. `HasRoom` parses resource quantity strings up to three times for each worker. The metric roughly doubled the per-worker arithmetic of a placement. The filter loop is now one pass over the fleet and builds one slice. **A metric cannot answer the question it was built for.** #564 wanted to tell a full fleet apart from an empty intersection of the constraints, such as a cordoned node behind a node requirement. That needs the selectors, the node requirement and the actor. `docs/metrics/substrate.yaml` bars all three from a metric label and sends them to logs and spans, so no shape of this instrument reaches the answer. A log record at the rejection is the replacement the issue names, and it is not in this PR. ## Also removed `ate.scheduling.constraint` goes with the instrument. No other signal used the attribute. ## Scope of the change - `cmd/ateapi/internal/scheduling/metrics.go` deleted, along with the `WithMeter` option and the second filter pass in `Schedule`. - The instrument and the attribute removed from `docs/metrics/registry/metrics.yaml`. The `pool-keys-paired` exception in `docs/metrics/substrate.yaml` dropped, because the empty pool pair was this instrument's alone. - `docs/observability.md`: the table row and the two label notes removed. - The e2e collector check and the label assertions for the instrument removed. - `TestSchedule_EligibleWorkersMetric` removed. The behaviors it covered (draining workers, a sandbox class mismatch, busy workers) are already in the `TestSchedule` table. ## Testing `go test ./cmd/... ./internal/...` passes. `make verify` passes except `hack/verify/metrics.sh`, which needs Weaver or Docker. Neither is available on this machine, so CI is what checks the registry.