mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +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
|
const spanName = otelSpan.name
|
||||||
// Skip Next.js HTTP infrastructure spans
|
// Skip Next.js HTTP infrastructure spans
|
||||||
if (
|
if (
|
||||||
spanName.startsWith("POST /") ||
|
spanName.startsWith("POST") ||
|
||||||
spanName.startsWith("GET /") ||
|
spanName.startsWith("GET") ||
|
||||||
|
spanName.startsWith("RSC") ||
|
||||||
spanName.includes("BaseServer") ||
|
spanName.includes("BaseServer") ||
|
||||||
spanName.includes("handleRequest")
|
spanName.includes("handleRequest") ||
|
||||||
|
spanName.includes("resolve page") ||
|
||||||
|
spanName.includes("start response")
|
||||||
) {
|
) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -36,4 +39,5 @@ export function register() {
|
|||||||
|
|
||||||
// Register globally so AI SDK's telemetry also uses this processor
|
// Register globally so AI SDK's telemetry also uses this processor
|
||||||
tracerProvider.register()
|
tracerProvider.register()
|
||||||
|
console.log("[Langfuse] Instrumentation initialized successfully")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user