Observability
Observability Purpose Observability records what Teddy executed and how much AI usage each provider consumed, so admins can inspect risky actions and operating cost. Current Scope Tool audit records in wp_teddy_audit_log AI…
Observability#
Purpose#
Observability records what Teddy executed and how much AI usage each provider consumed, so admins can inspect risky actions and operating cost.
Current Scope#
- Tool audit records in
wp_teddy_audit_log - AI usage records in
wp_teddy_ai_usage - Admin page:
Teddy -> Observability - REST endpoints:
GET /teddy/v1/audit-logGET /teddy/v1/ai-usage
Main Classes#
src/Infrastructure/Logging/WpAuditLogger.phpsrc/Infrastructure/Logging/AuditLogRepository.phpsrc/Infrastructure/Logging/AiUsageRepository.phpsrc/Application/UseCase/ListAuditLog.phpsrc/Application/UseCase/ListAiUsage.phpsrc/Admin/ObservabilityPage.php
Data Captured#
Tool audit#
- user id
- tool name
- trace id
- validated input payload
- output payload/error
- status
- duration
- timestamps
AI usage#
- user id
- conversation id
- provider id
- trace id
- estimated input tokens
- estimated output tokens
- estimated USD cost
- timestamp
Notes#
AI usage is currently estimated from prompt/response size when provider-native usage details are unavailable through the current adapter layer. This is enough for v0.2 observability, but later milestones should prefer provider-reported usage when possible.