RFC-015: Unified Observability Protocol (UOP) — 7. Storage
AIGP Specification › RFC-015: Unified Observability Protocol (UOP) › 7. Storage
← 6. Request Tracing · Section index · 8. Integration Points →
7. Storage
All UOP data is stored in the existing governance-server DynamoDB single-table. No additional tables or external storage required.
7.1 DynamoDB Entity Design
| Entity | PK | SK | GSI1PK | GSI1SK |
|---|---|---|---|---|
| Signal (raw) | APP#{app_id} | SIG#{timestamp}#{signal_id} | REQ#{request_id} | SIG#{timestamp}#{signal_id} |
| Aggregate (hourly) | APP#{app_id} | AGG#HOURLY#{date}#{hour} | AGG#{date} | APP#{app_id}#{hour} |
| Aggregate (daily) | APP#{app_id} | AGG#DAILY#{date} | AGG#{date} | APP#{app_id} |
| Aggregate (monthly) | APP#{app_id} | AGG#MONTHLY#{year-month} | AGG#{year-month} | APP#{app_id} |
| Alert | APP#{app_id} | ALERT#{timestamp}#{alert_id} | ALERTS#{date} | #{timestamp}#{alert_id} |
| Trace | TRACE#{request_id} | SIG#{timestamp}#{signal_id} |
7.2 GSI Usage
GSI1 Cross-App Queries
- Query all signals for a request_id:
GSI1PK = REQ#{request_id} - Query all aggregates for a date:
GSI1PK = AGG#{date} - Query all alerts for a date:
GSI1PK = ALERTS#{date}
7.3 TTL and Retention
| Entity | TTL | Rationale |
|---|---|---|
| Raw signals | 30 days | High volume, query by trace only |
| Hourly aggregates | 90 days | Dashboard drill-down |
| Daily aggregates | 1 year | Trend analysis |
| Monthly aggregates | Indefinite | Compliance and reporting |
| Alerts | 90 days | Operational review |
| Traces | 30 days | Debugging and audit |
TTL is enforced via DynamoDB TTL attribute (expires_at).
7.4 Write Pattern
Signals are written in two paths:
- Synchronous raw signal written on receipt (single PutItem)
- Asynchronous aggregation runs every 5 minutes via governance-server background task, reading recent signals and updating aggregate counters (UpdateItem with ADD)
# Aggregate update (atomic counter increment){ "TableName": "gov-app-table", "Key": {"PK": "APP#identity-service", "SK": "AGG#HOURLY#2026-05-04#10"}, "UpdateExpression": "ADD aigp_request_count :one, total_tokens :tokens, total_cost_usd :cost", "ExpressionAttributeValues": { ":one": 1, ":tokens": 2470, ":cost": 0.0247 }}← 6. Request Tracing · Section index · 8. Integration Points →