fix: expose trace pagination in cli and otel (#1687)
This commit is contained in:
@@ -3242,7 +3242,20 @@ export async function handleCodeAgentTraceHttp(request, response, url, options)
|
||||
const statusCode = context.found ? 200 : 404;
|
||||
void emitCodeAgentOtelSpan("trace_events_read", traceId, requestOptions.env ?? process.env, {
|
||||
startTimeMs: startedAt,
|
||||
attributes: { "http.method": "GET", "http.route": "/v1/agent/traces/:traceId", "http.status_code": statusCode, returnedEvents: Array.isArray(body?.events) ? body.events.length : 0, found: Boolean(context.found) }
|
||||
attributes: {
|
||||
"http.method": "GET",
|
||||
"http.route": "/v1/agent/traces/:traceId",
|
||||
"http.status_code": statusCode,
|
||||
found: Boolean(context.found),
|
||||
returnedEvents: Array.isArray(body?.events) ? body.events.length : 0,
|
||||
sinceSeq: pageOptions.sinceSeq,
|
||||
limit: pageOptions.limit,
|
||||
fromSeq: body?.range?.fromSeq ?? null,
|
||||
toSeq: body?.range?.toSeq ?? null,
|
||||
totalEvents: body?.range?.total ?? body?.eventCount ?? null,
|
||||
hasMore: Boolean(body?.hasMore),
|
||||
fullTraceLoaded: Boolean(body?.fullTraceLoaded)
|
||||
}
|
||||
});
|
||||
sendJson(response, statusCode, codeAgentCompatProjectionPayload(body, context));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user