Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Problem
AWF produces 5 JSONL log files across its containers, but their record formats are inconsistent. This makes cross-log correlation, aggregation, and tooling harder than necessary.
Current State
| File | Timestamp field | Format | Event/Type field | Discriminator |
|---|---|---|---|---|
audit.jsonl (Squid) |
ts |
Unix epoch float | ❌ None | decision + method |
token-usage.jsonl (API proxy) |
timestamp |
ISO 8601 | ❌ None | _schema only |
token-diag.jsonl (API proxy) |
timestamp |
ISO 8601 | ✅ event |
e.g. MODEL_ALIAS_RESOLUTION_STEP |
otel.jsonl (API proxy) |
timestamp |
ISO 8601 | ❌ None | name (span name) |
access.jsonl (CLI proxy) |
ts |
ISO 8601 | ✅ event |
e.g. exec_start, exec_done |
| API proxy stdout | timestamp |
ISO 8601 | ✅ event |
e.g. model_resolution |
Issues
- Inconsistent timestamp field name:
tsvstimestamp— cannot write a single query/parser that works across all logs - Inconsistent timestamp format: Squid uses Unix epoch float (
1716000000.123), everything else uses ISO 8601 (2026-05-25T09:00:00.000Z) - Missing event/type discriminator:
audit.jsonl,token-usage.jsonl, andotel.jsonlhave no top-leveleventortypefield to identify the record kind - Not specified in schemas: The required fields and their formats are not formally defined in the config spec or JSON Schemas
Proposed Standard
All AWF JSONL records MUST include:
{
"timestamp": "<ISO 8601 with milliseconds>",
"event": "<unique_event_type_string>",
"_schema": "<record-type>/v<version>",
...
}Rules
timestamp(string, required): ISO 8601 format with milliseconds (YYYY-MM-DDTHH:mm:ss.SSSZ). Usetimestampas the field name everywhere.event(string, required): A unique, stable identifier for the record type. Must besnake_case. Examples:http_access_allowed,http_access_denied,token_usage,otel_span,cli_exec_start._schema(string, required): Schema version identifier (already present on some records).
Migration Plan
| File | Change |
|---|---|
audit.jsonl |
Rename ts → timestamp, convert to ISO 8601, add event field (http_access_allowed / http_access_denied based on decision) |
token-usage.jsonl |
Add event: "token_usage" field |
otel.jsonl |
Add event: "otel_span" field |
access.jsonl (cli-proxy) |
Rename ts → timestamp |
| API proxy stdout | Already conformant ✅ |
token-diag.jsonl |
Already conformant ✅ |
Schema Updates
- Update
schemas/audit.schema.jsonto requiretimestamp(ISO 8601) andevent - Update
schemas/token-usage.schema.jsonto requireevent - Add
schemas/otel-span.schema.json(or document the format) - Add
schemas/cli-proxy-access.schema.json(or document the format) - Document the standard fields in
docs/awf-config-spec.md§13 (Log File Inventory) as a normative requirement
Breaking Change Considerations
audit.jsonl: Renamingts→timestampand switching from epoch → ISO 8601 is a breaking change for downstream consumers (e.g.awf logs statsparser)access.jsonl: Renamingts→timestampaffects any CLI proxy log consumers- Both require a schema version bump and migration period (emit both old and new field names temporarily, or bump schema version and let consumers check
_schema)
Affected Files
src/squid/config-generator.ts— Squidaudit_jsonllogformat stringcontainers/api-proxy/token-persistence.js—buildTokenUsageRecord()containers/api-proxy/otel.js—FileExporter.export()containers/cli-proxy/server.js—accessLog()src/logs/log-aggregator.ts— Parser foraudit.jsonl(will need to handle both formats during migration)schemas/audit.schema.json— Addeventfield, changetstotimestampschemas/token-usage.schema.json— Addeventfielddocs/awf-config-spec.md§13 — Document normative field requirements
Reacted by Copilot
Metadata
Metadata
Labels
enhancementNew feature or request
Activity
github-actions commentedon May 25, 2026
👋 Hello! I checked for potential duplicates and found a related issue (not a duplicate):
While both issues discuss JSONL log formats and schemas, they address different concerns:
This issue appears to be a valid follow-up that builds on the schema work from #2378, identifying concrete format standardization needs. The two issues complement each other rather than duplicate.
This is an automated message from the issue duplication detector.
Note
🔒 Integrity filter blocked 6 items
The following items were blocked because they don't meet the GitHub integrity level.
search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: