mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
fix: improve Langfuse span filter to exclude all Next.js infrastructure traces (#365)
* debug: add log to verify instrumentation initialization * fix: improve Langfuse span filter to exclude all Next.js infrastructure traces
This commit is contained in:
@@ -19,10 +19,13 @@ export function register() {
|
||||
const spanName = otelSpan.name
|
||||
// Skip Next.js HTTP infrastructure spans
|
||||
if (
|
||||
spanName.startsWith("POST /") ||
|
||||
spanName.startsWith("GET /") ||
|
||||
spanName.startsWith("POST") ||
|
||||
spanName.startsWith("GET") ||
|
||||
spanName.startsWith("RSC") ||
|
||||
spanName.includes("BaseServer") ||
|
||||
spanName.includes("handleRequest")
|
||||
spanName.includes("handleRequest") ||
|
||||
spanName.includes("resolve page") ||
|
||||
spanName.includes("start response")
|
||||
) {
|
||||
return false
|
||||
}
|
||||
@@ -36,4 +39,5 @@ export function register() {
|
||||
|
||||
// Register globally so AI SDK's telemetry also uses this processor
|
||||
tracerProvider.register()
|
||||
console.log("[Langfuse] Instrumentation initialized successfully")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user