haystack-core-integrations
haystack-core-integrations copied to clipboard
feat(languse): add embedder usage metrics for langfuse
Related Issues
- fixes #2472
Proposed Changes:
Added cost and usage tracking for embedders in the Langfuse integration. Embedders now report token usage metrics to Langfuse for cost monitoring and optimization.
How did you test it?
unit tests, integration tests
Notes for the reviewer
This implementation complements the already-merged PR #2497 which added suffix-based component detection. That PR solved thegenerator whitelist issue and embedder span types. Whereas this PR adds the missing usage/cost extraction for embedders.
Checklist
- I have read the contributors guidelines and the code of conduct
- I have updated the related issue with new insights and changes
- I added unit tests and updated the docstrings
- I've used one of the conventional commit types for my PR title:
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.