Skip to content

Commit 09ba53a

Browse files
committed
fix(eval): filter scopeless spans in CloudWatch query
Add ispresent(scope.name) filter to the span query so entries missing the required scope field are excluded before being sent to the Evaluate API.
1 parent 3937430 commit 09ba53a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/cli/operations/eval/run-eval.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ async function fetchSessionSpans(opts: FetchSpansOptions): Promise<SessionSpans[
446446
// 1. Query proper OTel spans from the aws/spans log group
447447
let spanQuery = `fields @message, attributes.session.id as sessionId, traceId
448448
| parse resource.attributes.cloud.resource_id "runtime/*/" as parsedAgentId
449-
| filter parsedAgentId = '${sanitizeQueryValue(runtimeId)}'`;
449+
| filter parsedAgentId = '${sanitizeQueryValue(runtimeId)}'
450+
| filter ispresent(scope.name)`;
450451

451452
if (opts.sessionId) {
452453
spanQuery += `\n | filter attributes.session.id = '${sanitizeQueryValue(opts.sessionId)}'`;

0 commit comments

Comments
 (0)