Skip to content

fix: prefer app spans for message trace lookup - #20

Merged
rowan-stein merged 3 commits into
mainfrom
noa/issue-19
Jun 3, 2026
Merged

rowan-stein merged 3 commits into
mainfrom
noa/issue-19

Conversation

@casey-brooks

Copy link
Copy Markdown
Contributor

Summary

  • Keep ListSpans(filter: { message_id }) focused on agent application spans when no more-specific filter is supplied, so message-based trace discovery does not select low-level transport traces first.
  • Preserve exact message + trace lookups for explicit trace-scoped queries.
  • Add trace summary category counts (message, llm, tool) derived from canonical span names or application attributes so UI/E2E summaries can still report non-zero run counts when producers use provider-specific span names.
  • Extend E2E coverage for message filtering with a same-message transport span.

Closes #19

Test & Lint Summary

  • ~/go/bin/buf generate buf.build/agynio/api --path agynio/api/tracing/v1 --path agynio/api/notifications/v1 --path agynio/api/identity/v1 --path agynio/api/ziti_management/v1 --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/threads/v1
  • go test ./...: 4 packages passed, 0 failed, 0 skipped; remaining packages had no test files
  • go build ./...: passed with no errors
  • go test ./test/e2e -tags e2e -run TestListSpansOrganizationAndMessageFilters: not part of final pass because it requires a live tracing E2E environment; local attempt reached the service but failed existing fixture auth with PermissionDenied: thread access denied

@casey-brooks

Copy link
Copy Markdown
Contributor Author

Local Test & Lint Summary

  • ~/go/bin/buf generate buf.build/agynio/api --path agynio/api/tracing/v1 --path agynio/api/notifications/v1 --path agynio/api/identity/v1 --path agynio/api/ziti_management/v1 --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/threads/v1
  • go test ./...: 4 packages passed, 0 failed, 0 skipped; remaining packages had no test files
  • go build ./...: passed with no errors
  • go test ./test/e2e -tags e2e -run TestListSpansOrganizationAndMessageFilters: not part of final pass because it requires a live tracing E2E environment; local attempt reached the service but failed existing fixture auth with PermissionDenied: thread access denied

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review started.

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix. I found two coverage gaps in the changed behavior that should be addressed before merge.

Comment thread test/e2e/spans_test.go
Comment thread internal/server/server.go
@casey-brooks

Copy link
Copy Markdown
Contributor Author

Addressed Noa review

  • Added store-level tests for ListSpans(message_id) query behavior, including application-span preference over same-message transport spans when no specific trace/name/kind filter is supplied.
  • Added store-level test ensuring explicit trace-scoped message_id queries remain exact and do not apply application-span preference.
  • Added store-level summary test verifying message/llm/tool category counts are returned and provider-specific classification attributes are included in the category query.

Local Test & Lint Summary

  • ~/go/bin/buf generate buf.build/agynio/api --path agynio/api/tracing/v1 --path agynio/api/notifications/v1 --path agynio/api/identity/v1 --path agynio/api/ziti_management/v1 --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/threads/v1
  • go test ./...: 5 packages passed, 0 failed, 0 skipped; remaining packages had no test files
  • go build ./...: passed with no errors

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review started.

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up. The store-level tests cover the query-building path now, but the public trace summary response still lacks coverage for the new category keys.

Comment thread internal/store/store_test.go
@casey-brooks

Copy link
Copy Markdown
Contributor Author

Addressed latest Noa review

  • Added server-boundary coverage in internal/server/server_test.go for GetTraceSummary.
  • The test uses a stubbed store summary with category counts and verifies the public GetTraceSummaryResponse.CountsByName contains message, llm, and tool keys alongside provider-specific span-name counts.
  • Introduced a narrow spanStore interface so the server can be tested at the handler/service boundary without a DB.

Local Test & Lint Summary

  • ~/go/bin/buf generate buf.build/agynio/api --path agynio/api/tracing/v1 --path agynio/api/notifications/v1 --path agynio/api/identity/v1 --path agynio/api/ziti_management/v1 --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/threads/v1
  • go test ./...: 5 packages passed, 0 failed, 0 skipped; remaining packages had no test files
  • go build ./...: passed with no errors

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review complete. The requested message lookup and trace summary category response coverage is now present; previous threads have been resolved. I was able to run CGO_ENABLED=0 go test ./internal/store successfully locally, but internal/server still cannot run in this checkout because generated .gen API packages are absent. Approving based on code review.

@rowan-stein
rowan-stein merged commit 52a7d41 into main Jun 3, 2026
1 check 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.

Tracing E2E: ListSpans(messageId) returns no trace (Claude) / wrong trace summary counts (Codex)

3 participants