feat(chat): migrate Langfuse tracing to OTEL + add user feedback#18
Merged
Conversation
- Add instrumentation.ts: NodeTracerProvider + LangfuseSpanProcessor - Rewrite api/chat/route.ts: observe() wrapper, propagateAttributes(), experimental_telemetry, getActiveTraceId() injected into messageMetadata - Remove manual sendChatTrace() HTTP calls from lib/langfuse.ts - Add postFeedbackScore() using POST /api/public/scores (not batch ingestion) - Add /api/chat/feedback proxy route (secret key server-side) - Add FeedbackAdapter to useChatRuntime, reads traceId from message metadata - Add ActionBarPrimitive.FeedbackPositive/Negative buttons to AssistantActionBar - Install: @opentelemetry/sdk-trace-node, @opentelemetry/api, langfuse Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add 👍👎 feedback buttons to assistant action bar (hover to reveal) - Track promptVersion and messageCount in Langfuse trace metadata - Set service.name from VERCEL_ENV for environment-aware traces - Fix action bar visibility: remove -mb-7.5 clip, use autohideFloat="always" - Add @opentelemetry/resources for resourceFromAttributes (v2 API) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lity section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
promptVersion,messageCount,service.name(VERCEL_ENV) in traces-mb-7.5clip issue exposed by autohideFloat)langfuse-otel-tracing.mdlearnings docWhat changed
instrumentation.tsNodeTracerProvider+LangfuseSpanProcessor+resourceFromAttributesapp/api/chat/route.tsobserve()+propagateAttributes()+experimental_telemetry, injectstraceIdintomessageMetadatalib/langfuse.tssendChatTrace(), addedpostFeedbackScore()app/api/chat/feedback/route.tscomponents/chat/chat-runtime.tsxFeedbackAdapterreadstraceIdfrom message metadata, POSTs to feedback routecomponents/assistant-ui/thread.tsxautohideFloat="always"+group-hoverCSS, removed-mb-7.5Test plan
promptVersion,messageCount,service.nameappear in trace metadataPOST /api/chat/feedback204user-feedbackscore (1 or 0) appears under Scores tab🤖 Generated with Claude Code