feat(core): add support for observation events#1190
Merged
Conversation
Contributor
There was a problem hiding this comment.
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.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.
Important
Adds support for Langfuse observation events with new
LangfuseEventclass andcreate_event()method, along with refactoring inclient.pyandspan.py.create_event()method inclient.pyto create Langfuse observation events.LangfuseEventclass inspan.pyfor event-specific span handling.create_trace_id(),_format_otel_span_id(), and_format_otel_trace_id()static methods inclient.py.update_finished_trace()method inclient.py.LangfuseSpanWrapperto supporteventtype spans inspan.py.LangfuseSpanWrapperto handleeventtype in_set_processed_span_attributes()and other methods.This description was created by
for 7f2be0e. You can customize this summary. It will automatically update as commits are pushed.
Greptile Summary
Disclaimer: Experimental PR review
This PR adds support for observation events in the Langfuse Python SDK, integrating them with the existing OpenTelemetry-based tracing system and making several methods static for better efficiency.
LangfuseEventclass andcreate_event()method inlangfuse/_client/span.pyfor handling event-type observationscreate_trace_id,_format_otel_span_id,_format_otel_trace_id) inlangfuse/_client/client.py@abstractmethoddecorator fromLangfuseSpanWrapperinlangfuse/_client/span.pytime_ns()inlangfuse/_client/client.py