Open AbhiPrasad opened 1 month ago
Currently difficult because we need to annotate the LLM spans with the pipeline span's name, and there is no nice way to pass context down in a runtime agnostic way
In python this is done with ContextVar
Maybe we can convert the pipeline span into a transaction, and pull down its name into the children that way?
In python this is done with ContextVar
In Node.js we can use AsyncLocalStorage
, which is what the SDK uses to maintain parent-child relationship between spans even with async behaviour.
In fact the Sentry scope lives on-top of async local storage in the Node SDK, so you can just store stuff on the scope to use.
Problem Statement
Add support for https://docs.sentry.io/product/insights/llm-monitoring/ in JavaScript
Solution Brainstorm
Things we can support:
@vercel/ai
: https://github.com/vercel/ai