Skip to content

feat(status): write 0 for unreported interfaces (#12) - #14

Merged
mrcsin merged 1 commit into
masterfrom
feat/status-unreported-interfaces
Oct 28, 2026
Merged

mrcsin merged 1 commit into
masterfrom
feat/status-unreported-interfaces

Conversation

@mrcsin

@mrcsin mrcsin commented Oct 28, 2026

Copy link
Copy Markdown
Owner

When a backend was down, or a running backend stopped reporting an interface (a removed Xray inbound), the interface left usher.prom. No series read 0, so usher_interface_up == 0 stayed silent, and the Alerts section in docs/operations.md needed one absent() term per interface name.

writeStatus now writes usher_interface_up 0, with no user series and no Stats call, for each interface that usher.yml references and no open backend reports. It decides "reported" from the same owners map that logUnknown uses. An unreferenced interface of a down backend is still absent; it has no users. The docs drop UsherInterfaceAbsent and keep three rules with no interface names. They also state that 0 means "the last pass did not apply it", not "users cannot connect", and that the log names no cause for an unreported interface while another backend is down.

Closes #12

Verified: go test -race ./... and scripts/format.sh pass. The branch's internal/pass/pass_test.go run against 979b987 fails six status tests, TestRunStatusBackendDown among them; on this branch all pass.

Per-task commits before collapse
5e67bfe docs(plans): record exec run and verify steps (#12)
a32973e fix(pass): drop restating test helper comment (#12)
110755b fix(status): address smells review (#12)
9a725f5 fix(status): address review findings (#12)
a8abf7d docs(status): document 0 for unreported interfaces (#12)
9cba627 docs(plans): verify unreported interfaces criteria (#12)
a11840f feat(status): write 0 for unreported interfaces (#12)
c4e8ca6 docs(plans): add unreported interfaces plan (#12)

🤖 Generated with Claude Code

When a backend was down, or a running backend stopped reporting an
interface such as a removed Xray inbound, that interface left usher.prom.
Its users could not be managed, yet no series read 0, so
usher_interface_up == 0 stayed silent and operators kept one absent()
term per interface name by hand.

writeStatus now writes usher_interface_up 0, with no user series and no
Stats call, for each interface that usher.yml references and no open
backend reports. It decides "reported" from the same owners map that
logUnknown uses. Reported interfaces keep their current lines, and an
unreferenced interface of a down backend is still absent. The operator
docs drop the per-interface UsherInterfaceAbsent rule: three rules with
no interface names now cover the file.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mrcsin
mrcsin marked this pull request as ready for review October 28, 2026 09:50
@mrcsin
mrcsin merged commit 2d0c367 into master Oct 28, 2026
2 checks passed
@mrcsin
mrcsin deleted the feat/status-unreported-interfaces branch October 28, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(status): write interface_up 0 for unreported interfaces

1 participant