Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI
v4 API Implementation Tasks
This directory contains tasks for implementing the v4 API endpoints that query Clickhouse data as part of the transition to OpenTelemetry.
Overview
The v4 API will replace the existing v2 API endpoints that query data from Supabase. The new endpoints will query data from Clickhouse, which stores OpenTelemetry trace, log, and metric data.
Task Structure
Each task is defined in a separate Markdown file with the following structure:
- Task name and description
- Requirements
- Implementation details
- Testing requirements
- Dependencies
- Estimated time
Task Dependencies
The tasks are ordered by dependency, with earlier tasks being dependencies for later tasks:
- Clickhouse Client: Implement a client for connecting to Clickhouse
- Authentication Middleware: Implement middleware for authenticating requests
- Trace Endpoints: Implement endpoints for querying trace data
- Log Endpoints: Implement endpoints for querying log data
- Metric Endpoints: Implement endpoints for querying metric data
- Session Endpoints: Implement endpoints for querying session data
- Computed Fields Migration: Migrate computed fields from v2 to v4
- API Documentation: Create documentation for the v4 API
- Testing and Validation: Create tests for the v4 API
- Deployment and Monitoring: Create a deployment and monitoring strategy
Implementation Strategy
The implementation strategy is to create a new set of v4 endpoints that query data from Clickhouse, while maintaining backward compatibility with the existing v2 endpoints. This will allow for a gradual migration from v2 to v4.
Computed Fields Migration
A key challenge in this implementation is migrating the computed fields from v2 to v4. In v2, these fields were computed by "meters", but in v4, they need to be computed from OpenTelemetry data in Clickhouse. Task 7 focuses on this migration.
Authentication
The v4 endpoints will use the same authentication mechanism as the v3 endpoints, which exchange an API key for a JWT token. The token is then used to authenticate requests to the v4 endpoints.
Testing
Each task includes testing requirements to ensure that the implementation is correct and performs well. Task 9 focuses on comprehensive testing of the entire v4 API.
Deployment
Task 10 focuses on creating a deployment and monitoring strategy for the v4 API, including procedures for deploying, monitoring, and alerting.