Collecting AI SDK Telemetry with Upstash Redis Search
Blog post from Upstash
The text discusses the integration of telemetry into AI systems using the Vercel AI SDK and Upstash Redis Search, highlighting the need to collect detailed telemetry data when deploying large language models (LLMs) in production. Traditional application logs do not provide sufficient insight into variables like token usage, latency, and failure reasons, prompting the use of a telemetry system to record these events as JSON documents in Redis. The telemetry is built on OpenTelemetry, and the example provided uses Redis for both storing and querying telemetry data, employing a schema that allows for rich aggregations and insights. This system enables users to track various metrics such as token usage, latency percentiles, failure reasons, and recent generations, with results visualized via a Next.js dashboard. The document also notes limitations in the current version (v6) of the AI SDK, which lacks error hooks for LLM calls, a feature expected to be improved in version 7. This telemetry setup provides a lightweight and efficient solution for monitoring AI applications without the need for additional data stores or ETL processes.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| LLM | 4 | 6,237 | 1,165 | 246 | -31% |
| OpenTelemetry | 3 | 968 | 178 | 57 | +2% |
| Data Pipeline | 1 | 505 | 237 | 97 | -19% |
| Real-time | 1 | 5,758 | 1,361 | 266 | +0% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.