litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Feature]: Support setting span id on langfuse

Open krrishdholakia opened this issue 1 year ago • 3 comments

The Feature

.

Motivation, pitch

allow app owners to set their own custom spans

Twitter / LinkedIn details

No response

krrishdholakia avatar Feb 05 '24 22:02 krrishdholakia

@maxdeichmann is there a difference between span id and trace id?

krrishdholakia avatar Feb 06 '24 16:02 krrishdholakia

@maxdeichmann is there a difference between span id and trace id?

Hi, yes there is. In the picture, on the right side you see the different elements (Spans + Generations + Events) within a span. A trace is a container of all of these and all these elements have their own ids. What exactly are you looking to support here? I assume that users want to create a LiteLLM generation as a child of a span within Langfuse? In this case, it would maybe make sense to support spans or traces natively in the litellm api:

trace = langfuse.trace()
span = trace.span()

litellm.generate(langfuseSpan= span)
litellm.generate(langfuseTrace= trace)

What do you think about this? Alternatively, we could also use the ids like you did with trace_id already.

image

maxdeichmann avatar Feb 07 '24 15:02 maxdeichmann

Hey guys, I also want to create LiteLLM generations as children of another Langfuse observation, e.g., a span. At least that is how I understand this issue. I created a separate issue #3558 and PR #3559 to support the parent_observation_id parameter which solves this problem for us.

hburrichter avatar May 10 '24 09:05 hburrichter

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jan 29 '25 00:01 github-actions[bot]