You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b8a55e
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(chainlib): cut request bodies on every listener's log lines, and name the GUID on the error line (MAG-4454) (#559)
* fix(utils): cut long log strings on a rune boundary (MAG-4454)
FormatLongString cut at byte offsets, so a multi-byte character at
either cut was split and the JSON log writer replaced its bytes with
U+FFFD. Each cut now moves inward to the nearest rune boundary, at most
three bytes; bytes that are not UTF-8 are cut where they were.
* fix(metrics): carry the request's GUID under GUID on the error-masking line (MAG-4454)
UniqueGuidResponseForError logged the request's GUID only under
msgSeed, so a search for the request's lines by "GUID":"<id>" missed
the line that records why it failed. It now carries GUID too, written
as a quoted decimal string like every other line; msgSeed stays. The
WebSocket marshal-failure line, which had the GUID only under seed,
gets GUID as well.
* fix(chainlib): cut the request body on every listener's log lines unless --debug-relays (MAG-4454)
The GraphQL and REST listeners logged the whole request body at info,
signed transactions included, and every listener's failure line
(LogRequestAndResponse, error level) logged it whole, JSON-RPC and
Tendermint included, although those two cut their own request line.
relayBodyForLog is now the one rule: the body's head and tail,
relayMsgLogMaxChars bytes in all, or the whole body under
--debug-relays. Each listener logs that form on its request line and
hands the same form to its failure line: JSON-RPC, Tendermint POST,
REST POST and non-POST, GraphQL, gRPC unary and stream subscribe, and
the WebSocket manager. The debug-level success lines are unchanged.
The WebSocket manager's RelayMsgLogMaxChars option only ever held the
package constant, so it goes; AnalyzeWebSocketErrorAndGetFormattedMessage
takes the logged frame as a string.
* docs(logs): name the stream label that selects relay_end writes (MAG-4454)
The doc said to select writes by the collector's stream label without
giving it. The collector labels router lines matching
"stateful":("1"|true) with stateful="1", which is also why a | json
extraction of stateful lands as stateful_extracted.
* test(metrics): read the GUID line test's output from the debug ring (MAG-4454)
TestGetUniqueGuidResponseForError_LogsTheGUID captured its lines by
assigning zerolog's global logger. MAG-4740 (#617) moves every
LavaFormat* call onto an atomic stderr sink, after which that assignment
captures nothing and the test fails, whichever of the two PRs lands
second.
The test now reads the debug log ring, as the listener test beside it
does. LavaFormatLog writes the same fields there whichever stderr sink is
installed, so the test holds before and after #617, and it still fails
when the error-masking line drops GUID.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Took 57 minutes
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: avitenzer <tenzer@clara.co.uk>
Copy file name to clipboardExpand all lines: docs/RELAY-END-EVENT.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,10 +80,12 @@ the router (an HTTP 405, for one); the router's own health and probe relays.
80
80
|`attempts`| array | when `stateful` is `true`, when `outcome` is not `ok`, when the relay took more than one attempt or its only attempt failed (a retry, a hedge, a recovery on another upstream), or when an upstream was skipped | One entry per upstream attempt; see [attempts](#attempts). `[]` when nothing was sent. A read its first attempt answered leaves it out. |
81
81
82
82
LogQL's `json` parser renders numbers and booleans as strings (`has_reply="false"`, `status="500"`)
83
-
and skips arrays; `| json attempts="attempts"` extracts the raw array. A field whose name is already a
84
-
stream label is renamed with an `_extracted` suffix: where the collector labels writes `stateful`,
85
-
`| json | stateful="true"` matches nothing, so select writes by that stream label or by the line
86
-
filter `|= "\"stateful\":true"`, which works either way.
83
+
and skips arrays; `| json attempts="attempts"` extracts the raw array. The fleet's log collector puts
84
+
the static stream label `stateful="1"` on every router line that matches `"stateful":("1"|true)`, so
85
+
`{stateful="1"}` selects writes. A field whose name is already a stream label is renamed with an
86
+
`_extracted` suffix: on those streams `| json` extracts the field as `stateful_extracted="true"`, and
87
+
`| json | stateful="true"` matches nothing. The line filter `|= "\"stateful\":true"` selects writes
88
+
on any stream.
87
89
88
90
`error` and `attempts[].message` are prose for a person. The same failure can read differently on
89
91
routers at different `--log-level`s, because an error built by a log formatter whose level is off
0 commit comments