fix: detect workbench recovery authority fanout
This commit is contained in:
@@ -233,6 +233,17 @@ const knownTraceAttributeKeys = new Set([
|
||||
"opencode.provider.sse.done_lines",
|
||||
"opencode.provider.sse.json_errors",
|
||||
"opencode.provider.sse.reasoning_only_choices_dropped",
|
||||
"workbench.sync.contract_version",
|
||||
"workbench.sync.since_outbox_seq",
|
||||
"workbench.sync.cursor_outbox_seq",
|
||||
"workbench.sync.event_count",
|
||||
"workbench.sync.entity_family_count",
|
||||
"workbench.sync.entity_families",
|
||||
"workbench.sync.max_entity_version",
|
||||
"workbench.realtime.authority",
|
||||
"workbench.projection.revision",
|
||||
"workbench.terminal.seal",
|
||||
"workbench.detail.projection",
|
||||
]);
|
||||
|
||||
function isKnownTraceAttributeKey(value: string): boolean {
|
||||
@@ -432,7 +443,7 @@ export function renderTraceTable(input: {
|
||||
formatTable(["NAME", "TRACE", "SESSION", "TURN", "STATUS", "EVENT", "PROJECTED", "SOURCE", "MESSAGE"], projectionRows.length > 0 ? projectionRows : [["-", "-", "-", "-", "-", "-", "-", "-", "-"]]),
|
||||
"",
|
||||
"Projection sync cursors:",
|
||||
formatTable(["SERVICE", "TRACE", "SESSION", "AFTER", "END", "EVENTS", "RAW", "MAX", "LAST", "TERM"], projectionSyncRows.length > 0 ? projectionSyncRows : [["-", "-", "-", "-", "-", "-", "-", "-", "-", "-"]]),
|
||||
formatTable(["SERVICE", "TRACE", "SESSION", "AFTER", "END", "EVENTS", "RAW", "MAX", "LAST", "TERM", "AUTH"], projectionSyncRows.length > 0 ? projectionSyncRows : [["-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"]]),
|
||||
"",
|
||||
"Span name counts:",
|
||||
formatTable(["NAME", "COUNT"], countRows.length > 0 ? countRows : [["-", "-"]]),
|
||||
@@ -599,19 +610,26 @@ function traceProjectionRows(spans: Record<string, unknown>[]): string[][] {
|
||||
}
|
||||
|
||||
function traceProjectionSyncRows(spans: Record<string, unknown>[]): string[][] {
|
||||
const rows = spans.filter((span) => textValue(span.name) === "projection_sync").map((span) => {
|
||||
const rows = spans.filter((span) => {
|
||||
const name = textValue(span.name);
|
||||
const attrs = asPlainRecord(span.attributes);
|
||||
return name === "projection_sync"
|
||||
|| name === "workbench.sync.replay"
|
||||
|| spanColumnAttr(attrs, ["workbench.sync.contract_version", "workbench.sync.cursor_outbox_seq", "workbench.sync.event_count", "workbench.realtime.authority"]) !== "-";
|
||||
}).map((span) => {
|
||||
const attrs = asPlainRecord(span.attributes);
|
||||
return [
|
||||
shortenEnd(textValue(span.service), 18),
|
||||
shortenMiddle(spanColumnAttr(attrs, ["traceId"]), 18),
|
||||
shortenMiddle(spanColumnAttr(attrs, ["sessionId"]), 18),
|
||||
shortenEnd(spanColumnAttr(attrs, ["afterSeq"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["endSeq"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["eventCount"]), 8),
|
||||
shortenMiddle(spanColumnAttr(attrs, ["traceId", "workbench.trace_id"]), 18),
|
||||
shortenMiddle(spanColumnAttr(attrs, ["sessionId", "workbench.session_id"]), 18),
|
||||
shortenEnd(spanColumnAttr(attrs, ["afterSeq", "workbench.sync.since_outbox_seq"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["endSeq", "workbench.sync.cursor_outbox_seq"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["eventCount", "workbench.sync.event_count"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["rawEventCount"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["maxSeq"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["maxSeq", "workbench.sync.max_entity_version"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["traceLastSeq"]), 8),
|
||||
shortenEnd(spanColumnAttr(attrs, ["terminalFromEvents", "terminalFromRawEvents", "terminalStatus"]), 12),
|
||||
shortenEnd(spanColumnAttr(attrs, ["terminalFromEvents", "terminalFromRawEvents", "terminalStatus", "workbench.terminal.seal"]), 12),
|
||||
shortenEnd(spanColumnAttr(attrs, ["workbench.realtime.authority", "workbench.sync.contract_version", "workbench.detail.projection"]), 18),
|
||||
];
|
||||
});
|
||||
return dedupeRows(rows).slice(0, 16);
|
||||
|
||||
Reference in New Issue
Block a user