-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
write top span id on trace and re-query by it
- Loading branch information
1 parent
7dcd6f1
commit 296668a
Showing
12 changed files
with
3,133 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
frontend/app/api/projects/[projectId]/spans/[spanId]/basic-info/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Returns span basic info that is shown in the traces table | ||
// when traces arrive realtime | ||
|
||
import { and, eq } from 'drizzle-orm'; | ||
import { NextResponse } from 'next/server'; | ||
|
||
import { db } from '@/lib/db/drizzle'; | ||
import { spans } from '@/lib/db/migrations/schema'; | ||
|
||
export async function GET( | ||
req: Request, | ||
props: { params: Promise<{ projectId: string; spanId: string }> } | ||
): Promise<Response> { | ||
const params = await props.params; | ||
const projectId = params.projectId; | ||
const spanId = params.spanId; | ||
|
||
|
||
const span = await db.query.spans.findFirst({ | ||
where: and(eq(spans.spanId, spanId), eq(spans.projectId, projectId)), | ||
columns: { | ||
spanType: true, | ||
name: true, | ||
inputPreview: true, | ||
outputPreview: true, | ||
} | ||
}); | ||
|
||
return NextResponse.json(span); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE "traces" ADD COLUMN "top_span_id" uuid; |
Oops, something went wrong.