langfuse / langfuse/langfuse-examples
Correct usage of langfuse with Spring AI
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 39
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Dear langfuse team,
I have been trying to figure out the best way to setup langfuse with Spring AI for some time now and wanted to share where I am at.
For this, I have created a fork of the current sample application here.
Would you mind taking a look to see if:
- This is the correct way to add the session and user id?
- This is the correct way to set the input and output to show up in the UI on the root level?
To me, it looks like, the spans are not correctly nested:
This is also the case if I don't filter out any spans that are not AI related:
However, if I add tool calls, this seems to nest the spans correctly again, but won't show the parameters of the tool calls.
Some other notes
- Maybe the files in the
configfolder help others to see how to reduce the noise coming from opentelemetry spring boot starter. If you don't filter out the spans, you also get all other traces into langfuse, e.g.
I am happy to make this example a bit nicer and more elaborate (with a tool call etc)and submit a pull request to improve the documentation a bit.
Thanks for your help
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked davidbellem/langfuse-examples fork and inspect its config folder and Spring AI setup. Compare the session and user ID, root input/output, span nesting, tool-call parameters, and OpenTelemetry filtering with the current examples. Done means the correct setup is verified and documented in a reproducible example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- documentation, observability
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100