Skip to content

Conversation

@DayuanJiang
Copy link
Owner

Summary

  • Restores Langfuse observability integration that was previously removed
  • Adds OpenTelemetry instrumentation for AI SDK telemetry
  • Adds feedback buttons (thumbs up/down) to chat messages
  • Adds session tracking for correlating chats with saves

Changes

New Files

  • lib/langfuse.ts - Langfuse client utilities
  • instrumentation.ts - OpenTelemetry setup with Langfuse span processor
  • app/api/log-save/route.ts - API for logging diagram saves
  • app/api/log-feedback/route.ts - API for user feedback (thumbs up/down)

Updated Files

  • app/api/chat/route.ts - Added sessionId tracking and telemetry
  • components/chat-message-display.tsx - Added feedback buttons
  • components/chat-panel.tsx - Added sessionId state management
  • components/chat-input.tsx - Pass sessionId to save function
  • contexts/diagram-context.tsx - Log saves to Langfuse
  • env.example - Added Langfuse config documentation
  • package.json - Added @langfuse/*, @opentelemetry dependencies

Test Plan

  • Build passes
  • /api/log-feedback returns 200 OK
  • /api/log-save returns 200 OK
  • Langfuse endpoint health check passes
  • Feedback buttons visible in chat UI

- Add lib/langfuse.ts with client, trace input/output, telemetry config
- Add instrumentation.ts for OpenTelemetry setup with Langfuse span processor
- Add /api/log-save endpoint for logging diagram saves
- Add /api/log-feedback endpoint for thumbs up/down feedback
- Update chat route with sessionId tracking and telemetry
- Add feedback buttons (thumbs up/down) to chat messages
- Add sessionId tracking throughout the app
- Update env.example with Langfuse configuration
- Add @langfuse/client, @langfuse/otel, @langfuse/tracing, @opentelemetry/sdk-trace-node
@vercel
Copy link

vercel bot commented Dec 5, 2025

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

Project Deployment Preview Comments Updated (UTC)
next-ai-draw-io Building Building Preview Comment Dec 5, 2025 0:15am

@DayuanJiang DayuanJiang merged commit ed29e32 into main Dec 5, 2025
3 of 4 checks passed
@DayuanJiang DayuanJiang deleted the feat/restore-langfuse-observability branch December 5, 2025 12:15
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.

2 participants