mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
feat: integrate Langfuse for LLM observability (#66)
* feat: integrate Langfuse for LLM observability - Add instrumentation.ts with Langfuse OpenTelemetry exporter - Enable experimental telemetry on streamText calls - Add instrumentationHook to Next.js config - Install required dependencies (@vercel/otel, langfuse-vercel, etc.) * feat: add optional Langfuse observability integration - Add session tracking with unique sessionId per conversation - Add user tracking via IP address (x-forwarded-for header) - Make telemetry conditional - only enabled if LANGFUSE_PUBLIC_KEY is set - Add environment variable validation in instrumentation.ts - Add sessionId validation (type check + 200 char limit) - Update env.example with Langfuse configuration docs - Remove unused langfuse-vercel and @vercel/otel packages * fix: remove deprecated instrumentationHook (enabled by default in Next.js 15)
This commit is contained in:
@@ -16,8 +16,10 @@
|
||||
"@ai-sdk/google": "^2.0.0",
|
||||
"@ai-sdk/openai": "^2.0.19",
|
||||
"@ai-sdk/react": "^2.0.22",
|
||||
"@langfuse/otel": "^4.4.4",
|
||||
"@next/third-parties": "^16.0.6",
|
||||
"@openrouter/ai-sdk-provider": "^1.2.3",
|
||||
"@opentelemetry/sdk-trace-node": "^2.2.0",
|
||||
"@radix-ui/react-dialog": "^1.1.6",
|
||||
"@radix-ui/react-scroll-area": "^1.2.3",
|
||||
"@radix-ui/react-slot": "^1.1.2",
|
||||
|
||||
Reference in New Issue
Block a user