Skip to content

head-lag: Serialized can read its own monitor lines at /logs/serialized - #2990

Merged
Flotapponnier merged 1 commit into
mainfrom
hotfix/serialized-logs-endpoint
Oct 15, 2026
Merged

Flotapponnier merged 1 commit into
mainfrom
hotfix/serialized-logs-endpoint

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Adds GET /logs/serialized?tail=N on each regional head-lag probe (us-east, eu-west, sgp). It returns only the Serialized monitor's lines:

  • connects and drops
  • each trade over 3 s, with its hash, Serialized's at and our receive time
  • duplicate deliveries

The endpoint takes its own token, SERIALIZED_LOGS_TOKEN, sent in the X-Logs-Token header, so it can be shared with Serialized without opening the full log. It answers 403 when the variable is unset. Lines go to a dedicated 20,000-line ring, because the GeckoTerminal tape turns the shared ring over in under an hour.

This also fixes /logs itself. The log package kept the original stderr from init, so no log.Printf line ever reached the ring. That covers the drop, slow-trade and duplicate lines, and most of the Codex and OKX output.

Tested locally on the real binary:

  • /logs/serialized returns only [SERIALIZED] lines, and 403 without the token.
  • log.Printf lines now appear in /logs.

…ed (#2989)

GET /logs/serialized?tail=N on each regional probe returns only the
Serialized monitor's lines: connects, drops, each trade over 3 s with
its hash, `at` and our receive time, and duplicate deliveries. It takes
its own token, SERIALIZED_LOGS_TOKEN in X-Logs-Token, so it can be handed
to Serialized without opening the full log. Lines go to a dedicated
20,000-line ring, because the GeckoTerminal tape turns the shared one
over in under an hour.

Also routes the log package into the capture: it held the original
stderr from init, so every log.Printf line (drops, slow trades,
duplicates, most of the Codex and OKX paths) never reached /logs.

(cherry picked from commit 9aeb4cd)
@Flotapponnier
Flotapponnier merged commit 19ed413 into main Oct 15, 2026
2 checks passed
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.

1 participant