-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(telemetry/utils): add ttft reporting to LangFuse #3594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| # Langfuse only allows searching/filtering/graphing over fields if they are prefixes with this key OR | ||
| # which use a set of reserved keys like ATTR_GEN_AI and ATTR_LANGFUSE items above. | ||
| # so e.g. ATTR_LANGFUSE_SEARCHABLE_PREFIX + "foo" will allow `foo` to be a filterable attribute in langfuse. | ||
| ATTR_LANGFUSE_SEARCHABLE_PREFIX = "langfuse.trace.metadata." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used anywhere? if not it's better to not include it in the types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't think its useful reference for devs (i.e. to sign post you cannot assume simply adding an atrribute makes it useful for searching/graphing in langfuse)? This information was a little hard for me to find as a developer and surprising behaviour in LangFuse (that metadata attached to a trace is not searchable unless nested under very specific namespaces).
But OK I have removed it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's langfuse should document this somewhere, we may not want to add too many platform-specific vars in the codebase.
* staging: (114 commits) Added min_confidence_threshold for deepgram flux. livekit-agents 1.2.15 (livekit#3658) fix livekit#3650 cartesia version backward compatibility (livekit#3651) Unprompted STT Reconnection at startup (livekit#3649) enable zero retention mode in elevenlabs (livekit#3647) fix: heartbeat (livekit#3648) feat: Integrate streaming endpoints for Sarvam APIs (livekit#3498) turn_detection: reduce max_endpointing_delay to 3s (livekit#3640) fix: exclude temperature parameter for gpt-5 and similar models (livekit#3573) add backwards compatibility for google's realtime model (livekit#3630) Align Google STT plugin with official documentation (livekit#3628) feat(speechmatics): add max_speakers parameter for speaker diarization (livekit#3524) fix(deepgram): send CloseStream message before closing TTS WebSocket (livekit#3608) chore: Remove duplicate docstring for `preemptive_generation` parameter in AgentSession (livekit#3624) Add RTZR(ReturnZero) STT Plugin for LiveKit Agents (livekit#3376) feat(telemetry/utils): add ttft reporting to LangFuse (livekit#3594) catch delete_room errors and disable delete_room_on_close by default (livekit#3600) lift google realtime api out of beta (livekit#3614) fix: lock pyav to <16 due to build issue (livekit#3593) Updating Cartesia Version (livekit#3570) ...
This PR extends the recent addition of TTFT metrics to Realtime API kindly provided by @longcw #3507 to allow LangFuse to natively parse this data, as currently it is not possible to Dashboard or filter on TTFT.
This PR makes two changes:
ATTR_LANGFUSE_COMPLETION_START_TIME = "langfuse.observation.completion_start_time"namespace, similarly to how in the codebase we already do for regular non-realtime LLMs.