Skip to content

improve performance time on vercel for traces#2070

Merged
shagun-singh-inkeep merged 5 commits intomainfrom
TI-12
Feb 17, 2026
Merged

improve performance time on vercel for traces#2070
shagun-singh-inkeep merged 5 commits intomainfrom
TI-12

Conversation

@shagun-singh-inkeep
Copy link
Collaborator

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

🦋 Changeset detected

Latest commit: 882a7d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@inkeep/agents-manage-ui Patch
@inkeep/agents-api Patch
@inkeep/agents-cli Patch
@inkeep/agents-core Patch
@inkeep/agents-manage-mcp Patch
@inkeep/agents-mcp Patch
@inkeep/agents-sdk Patch
@inkeep/agents-work-apps Patch
@inkeep/ai-sdk-provider Patch
@inkeep/create-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 17, 2026 5:24pm
agents-docs Ready Ready Preview, Comment Feb 17, 2026 5:24pm
agents-manage-ui Ready Ready Preview, Comment Feb 17, 2026 5:24pm

Request Review

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(6) Total Issues | Risk: Medium

🟠⚠️ Major (2) 🟠⚠️

Inline Comments:

  • 🟠 Major: agents-manage-ui/src/app/api/signoz/route.ts:94-112 Batch mode bypasses time range validation
  • 🟠 Major: agents-api/src/domains/manage/routes/signoz.ts:230-245 Missing 401/403 error handling and logging consistency

🟡 Minor (2) 🟡

Inline Comments:

  • 🟡 Minor: agents-api/src/domains/manage/routes/signoz.ts:175-180 Missing access denied logging
  • 🟡 Minor: agents-api/src/domains/manage/routes/signoz.ts:187-189 Missing "SigNoz not configured" logging

💭 Consider (2) 💭

💭 1) agents-api/src/domains/manage/routes/signoz.ts:197-227 Add debug logging for request lifecycle

Issue: The /query-batch endpoint lacks the debug logging statements present in the peer /query endpoint (processing request, security filters enforced, proxying to SigNoz, query successful).

Why: Debug logging aids in tracing request flow during development and incident investigation.

Fix: Consider adding logger.debug() calls at key points: before executing step 1, after step 1 success, before step 2, after step 2 success.

💭 2) agents-api/src/domains/manage/routes/signoz.ts No tests for new endpoint

Issue: The new /query-batch endpoint and injectConversationIdFilter function have no unit tests. Neither does the existing enforceSecurityFilters function (which is security-critical).

Why: Without tests, regressions in authorization checks, filter injection, or error handling could go undetected. The enforceSecurityFilters function is particularly important as it enforces tenant isolation.

Fix: Consider adding tests for:

  • Missing payload validation (400 responses)
  • Project access denial (403 responses)
  • System/API key user bypass
  • Empty conversation results (detailResponse: null)
  • Conversation ID injection into detail query
  • SigNoz unavailability (503 responses)

Refs:

  • No existing tests found in agents-api/src/__tests__/manage/ for signoz routes

🚫 REQUEST CHANGES

Summary: This PR introduces a valuable performance optimization by reducing browser-to-server round trips for the traces dashboard. The security filters for tenant isolation are correctly applied to both payloads using the existing enforceSecurityFilters function. However, two issues should be addressed before merging:

  1. Time range validation consistency — the batch mode path should validate time ranges like the single query path does
  2. Error handling parity — the error handler should match the existing /query endpoint's handling of 401/403 errors and include appropriate logging

The minor logging inconsistencies (access denied, SigNoz not configured) would be nice to address for operational parity but are not blocking.

Discarded (8)
Location Issue Reason Discarded
route.ts Different timeout values (30s vs 60s) Intentional design decision — batch executes 2 sequential queries
route.ts Inconsistent error field naming (message vs details) Existing pattern where proxy wraps API errors
signoz-stats.ts:206-212 Retry on 5xx may amplify cascading failures Valid concern but existing pattern; out of scope for this PR
signoz-stats.ts:180-187 Redundant retry configuration Existing pattern; may be intentional redundancy
signoz-stats.ts:244-257 Silent failure in getConversationStats Pre-existing pattern not introduced by this PR
signoz.ts:204-227 Timeout budget exhaustion risk Theoretical risk; 60s total with 30s per query has margin
signozHelpers.ts No tests for enforceSecurityFilters Pre-existing gap not introduced by this PR
signoz-stats.ts:362-387 No tests for client-side pagination logic Client-side code; likely covered by E2E tests
Reviewers (6)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-errors 6 0 0 0 2 0 4
pr-review-sre 7 0 0 0 1 0 6
pr-review-consistency 7 0 1 0 2 0 4
pr-review-standards 2 0 0 0 2 0 0
pr-review-tests 5 0 1 0 0 0 4
pr-review-security-iam 1 0 0 0 1 0 0
Total 28 0 2 0 4 0 18

Note: High discard rate due to semantic deduplication (multiple reviewers flagged same issues) and filtering pre-existing patterns.

@github-actions github-actions bot deleted a comment from claude bot Feb 17, 2026
@shagun-singh-inkeep
Copy link
Collaborator Author

@claude will this improve performance time for loading traces on vercel

@claude
Copy link
Contributor

claude bot commented Feb 17, 2026

Claude Code is working…

I'll analyze this and get back to you.

View job run

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(0) Total Issues | Risk: Low

This is a re-review scoped to the delta since the last automated review. The delta commits address all 4 issues raised in the prior review.

Prior Feedback — Addressed ✅

All 4 inline comments from the previous review have been resolved:

Prior Issue Status Resolution
🟠 Batch mode bypasses time range validation ✅ Addressed Added validation for both paginationPayload and detailPayloadTemplate (lines 108-134 in route.ts)
🟠 Missing 401/403 error handling ✅ Addressed Added auth error handling with logging (lines 244-250 in signoz.ts)
🟡 Missing access denied logging ✅ Addressed Added logger.warn() before 403 response (lines 176-179 in signoz.ts)
🟡 Missing "SigNoz not configured" logging ✅ Addressed Added logger.error() before 500 response (line 192 in signoz.ts)

Delta Verification

The delta changes were validated by pr-review-standards and pr-review-consistency:

  • ✅ Error handling and validation logic is correct
  • ✅ Logging patterns match the existing /query endpoint
  • ✅ Time range validation covers both payloads in batch mode

💭 Consider (from prior review, still applicable)

The prior review noted two "Consider" items that remain valid suggestions for future work, but are not blocking:

  1. Debug logging for request lifecycle — The /query-batch endpoint could benefit from debug logging at key points (before/after step 1, before/after step 2) to match the existing /query endpoint's observability.

  2. Tests for new endpoint — The /query-batch endpoint and injectConversationIdFilter function have no unit tests. Consider adding tests for validation, authorization, and error handling paths.


✅ APPROVE

Summary: All feedback from the prior review has been addressed. The batch endpoint now has proper time range validation, consistent error handling, and logging parity with the existing /query endpoint. This PR is ready to merge and should deliver the intended performance improvement by reducing browser-to-server round trips for the traces dashboard. 🚀

Reviewers (2)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-standards 0 0 0 0 0 0 0
pr-review-consistency 0 0 0 0 0 0 0
Total 0 0 0 0 0 0 0

Note: Delta-scoped re-review — reviewers validated the fixes only, no new issues found.

@github-actions github-actions bot deleted a comment from claude bot Feb 17, 2026
@shagun-singh-inkeep shagun-singh-inkeep merged commit ded8362 into main Feb 17, 2026
10 of 11 checks passed
@shagun-singh-inkeep shagun-singh-inkeep deleted the TI-12 branch February 17, 2026 18:58
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.

1 participant

Comments