#229 OpenAPI: Observability Endpoints (22 endpoints)
Description
Edit## Scope
Document observability and monitoring endpoints:
- `api/blueprints/v1/logs.py` (7 endpoints)
- `api/blueprints/v1/activities.py` (7 endpoints)
- `api/blueprints/v1/analytics.py` (6 endpoints)
- `api/blueprints/v1/audit_logs.py` (2 endpoints)
## Logs Endpoints (7)
1. GET /logs/workflows/{id} - Get workflow logs
2. GET /logs/workers/{id} - Get worker logs
3. GET /logs/tasks/{id} - Get task logs
4. GET /logs/search - Search logs
5. GET /logs/stream - Stream logs (SSE)
6. GET /logs/export - Export logs
7. GET /logs/retention - Get retention policy
## Activities Endpoints (7)
1. GET /activities - List activities
2. GET /activities/{id} - Get activity
3. GET /activities/summary - Get summary
4. GET /activities/timeline - Get timeline
5. GET /activities/by-user/{id} - Get by user
6. GET /activities/by-workflow/{id} - Get by workflow
7. GET /activities/export - Export activities
## Analytics Endpoints (6)
1. GET /analytics/workflows - Workflow analytics
2. GET /analytics/tasks - Task analytics
3. GET /analytics/workers - Worker analytics
4. GET /analytics/trends - Trend data
5. GET /analytics/dashboard - Dashboard data
6. GET /analytics/export - Export analytics
## Audit Logs Endpoints (2)
1. GET /audit-logs - List audit logs
2. GET /audit-logs/export - Export audit logs
## Pydantic Models
```python
class LogEntry(BaseModel):
timestamp: datetime
level: str
message: str
source: str
metadata: dict = {}
class ActivityEntry(BaseModel):
activity_id: str
action: str
actor: str
resource_type: str
resource_id: str
timestamp: datetime
class AnalyticsResponse(BaseModel):
period_start: datetime
period_end: datetime
metrics: dict
breakdown: list[dict]
```
## Depends On
- #224 (Infrastructure Setup)
## Acceptance Criteria
- [ ] All 22 endpoints documented
- [ ] SSE streaming documented
- [ ] Export formats documented
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...