Repository navigation
feat(fabric-api): Report Looking Glass throttling and limiter health - #1122
Conversation
caf4c58 to
2dd1918
Compare
2dd1918 to
a85ba15
Compare
|
Two review passes ran on this PR. In the second pass pr-rereviewer returned merge: all four findings applied after the first pass were confirmed fixed with tamper tests (the leader counts forwarded refusals, a permit's invalid outcome is handled, the body's test plan matches the log fields, and the summary is four sentences). pr-conventions-reviewer returned hold, on warnings that were then fixed rather than waived. Its one decision finding, about not rendering Kustomize output at the head, does not apply: this PR changes no Kustomize files, and task test:alerts (promtool check and test of the rules) passed on a tree containing this PR's rules. After the second pass the fix commit was squashed into the first, because its 73-character subject broke the subject limit. The PR is now one commit, "feat(fabric-api): Report Looking Glass throttling and limiter health", and its body carries a note that infra's runbook entries and central rules copy follow this change. The tree is byte-identical to the re-reviewed head. CI on a85ba15 is green: Build, Lint, Unit Tests, Unit Tests (root), E2E Tests, Service API bundle, the image and bundle publish jobs, and the CLA check all passed. Auto-merge is not enabled. This PR is based on the branch of #1121, so it must merge only after #1121 lands and this PR is retargeted to main. No human reviewer is configured for this repository, so review comes from the code owners. |
ecv
left a comment
There was a problem hiding this comment.
Approve.
Reviewed against its base feat/lg-backend-controls, not main: metrics and alerts only, with no change to limiter defaults; CI is green at a85ba15.
- Metric labels are bounded:
operationis a fixed query-type set withUnsupportedas the catch-all,reasonandoutcomeare errcode values,scopecomes from the limiter's fixed scopes, andclassis one of three traffic classes. Project, request, service and node names are never labels. serviceOmittedusesr.OmittedReasondirectly as a label value. It is bounded only if discovery sets it from a fixed set; worth a quick check (internal/fabric/gateway/metrics.go).- The four new alerts gate on minimum request counts (20 and 10 in 30m) and
forof 10-15m, so idle or disabled cells do not fire. The gauges exist only where--aggregate-budgetsor--probe-permitsis on.
Follow-ups:
- The
runbook_urlanchors point atdocs/runbooks/galactic/README.mdin the infra repo (#fabricapilimiterunavailableand three more); confirm those sections exist or land them alongside. FabricAPIClockUnsynchronizedORs two selectors, so a pod label collision between gateway and node series is possible only if they ever share a pod; fine today.
Nothing reported why Looking Glass requests were refused, how the cell's aggregate limiter was doing, whether its clock was trusted or why a node refused a probe permit, and no alert covered any of it. The gateway now exports service requests by operation and reason, router outcomes and omissions, request duration, admission refusals by traffic class (service, operator, fabricquery), limiter scope and reason, charged packets by traffic class, the service switch's state, live streams, limiter state and key counts, and clock health. The node exports permit decisions by outcome (accepted, or invalid, malformed, mismatch, expired, starting, clock, lease, epoch, replayed, full) and its clock health. Labels come from fixed sets: no project, request or service ID, node name or target is a label. A follower counts only the requests it refused itself, and the leader counts the rest, including forwarded requests it refused before executing them, so each request is counted once. The leader logs one line per request it ran with the service, project, request ID, operation, reason, router counts and duration, never targets, results or node error text; a request refused before its snapshot is logged at debug level. A test runs requests and throttling and checks the registry and the logs for each. The fabric-api rule group gains FabricAPILimiterUnavailable (no ready limiter in a cell for 10 minutes), FabricAPIClockUnsynchronized, FabricAPIServiceThrottled (most of at least 20 requests in 30 minutes refused by a budget, queue or the limiter) and FabricAPIServiceExecutionFailing (most of at least 10 executed requests returned no router result), each unit-tested with promtool, including idle and disabled cells that must not fire. Related to #1047
a85ba15 to
199ff59
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
The PR's own patch at 199ff59 is identical to the one I approved at a85ba15 (diffed bcb5c24..a85ba15 against eb31cc8..199ff59; only a hunk offset in rules-test.yaml differs), so the gateway.go and rules changes are rebase noise, not new content.
- Prior item 1 is fine:
serviceOmittedlabels withr.OmittedReason, which is only ever set from the fixedOmit*constants in discovery.go (or empty, which is filtered by!r.Selected), so cardinality is bounded. - Prior item 2 is still open: none of the four
runbook_urlanchors (#fabricapilimiterunavailable,#fabricapiclockunsynchronized,#fabricapiservicethrottled,#fabricapiserviceexecutionfailing) exist in infradocs/runbooks/galactic/README.mdon main.
Follow-ups:
- Add the four runbook sections to infra
docs/runbooks/galactic/README.md, or point the annotations somewhere that exists, so paged alerts do not link to a dead anchor.
Summary
Operators had no way to tell why Looking Glass requests were refused, whether the cell's limiter was healthy, or why a node refused a probe permit.
The gateway and nodes now export metrics with fixed label sets for requests, router outcomes, refusals by caller type and limit, charged packets, limiter state, clock health and permit decisions. The leader logs one line per request with its service, project, request ID and counts, never its target or results.
Four new alerts cover an unavailable limiter, an unsynchronised clock, and mostly throttled or mostly failing requests, on top of #1121.
Note
These rules fire in production only once infra adds runbook entries for the four alerts and its central copy of the rules, which follow this change.
Test plan
Related to #1047