Standardize gateway JSONL records with event/_schema and millisecond timestamps#6485
Merged
Conversation
Copilot
AI
changed the title
[WIP] Standardize JSONL log record format
Standardize gateway JSONL records with May 25, 2026
event/_schema and millisecond timestamps
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes the MCP Gateway’s machine-readable JSONL logging contract (RPC + DIFC) by introducing explicit event and _schema discriminators and aligning timestamps (JSONL + text logs) to a consistent UTC ISO-8601-with-milliseconds format, enabling downstream parsers/aggregators to rely on a single record shape.
Changes:
- Replaced overloaded JSONL
typefields witheventand added_schemaversioning for RPC and DIFC-filter records. - Unified timestamp formatting across JSONL and text logs to millisecond-precision UTC.
- Updated in-repo workflows/docs/tests to parse and assert the new JSONL fields (
event,_schema) and timestamp layout.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the updated logging contract and timestamp format. |
| internal/server/difc_log.go | Updates DIFC log comment to reflect difc_filtered event naming. |
| internal/mcp/connection_logging_test.go | Updates MCP connection logging test assertions to event/_schema. |
| internal/logger/rpc_logger.go | Adds RPCMessageType.JSONLEvent() mapping to standardized event strings. |
| internal/logger/rpc_logger_test.go | Updates RPC logger tests to assert event/_schema. |
| internal/logger/jsonl_logger.go | Implements JSONL record shape changes and millisecond timestamp formatting. |
| internal/logger/jsonl_logger_test.go | Updates JSONL logger tests for new fields and timestamp parsing. |
| internal/logger/common.go | Updates text log timestamp formatting to millisecond layout. |
| internal/logger/common_test.go | Updates log line format tests for millisecond timestamps and parsing. |
| .github/workflows/smoke-proxy-github-script.md | Updates DIFC event counting to match event:"difc_filtered". |
| .github/workflows/smoke-proxy-github-script.lock.yml | Mirrors the smoke workflow update in the compiled/locked workflow. |
| .github/workflows/smoke-proxy-github-script.invalid.yml | Mirrors the smoke workflow update in the generated invalid fixture. |
| .github/workflows/repo-assist.md | Updates JSONL parsing logic to use event == difc_filtered. |
| .github/workflows/integrity-filtering-audit.md | Updates audit guidance/greps to match the new JSONL discriminator. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 14/14 changed files
- Comments generated: 2
Collaborator
|
@copilot address review feedback |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot stopped work on behalf of
lpcox due to an error
May 25, 2026 17:38
This was referenced May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MCP Gateway logs had mixed record semantics (
typeused for both direction and record kind), no schema discriminator, and inconsistent timestamp precision across JSONL vs text logs. This change aligns gateway logs to the AWF-style base contract so cross-log parsing and aggregation can use one shape.JSONL contract normalization (RPC + DIFC)
JSONLRPCMessagenow emits:timestamp(ISO 8601 UTC with milliseconds)event(rpc_request/rpc_response)_schema(rpc-message/v2)JSONLFilteredItemnow emits:timestamp(same format)event: "difc_filtered"_schema: "difc-filtered/v2"typefrom JSONL records in favor ofevent.Timestamp consistency across logs
mcp-gateway.logand{serverID}.log) now uses the same millisecond-precision UTC layout as JSONL.Parser/spec updates for downstream consumers
rpc-messages.jsonlto match the new discriminator (event == "difc_filtered"), including Repo Assist and DIFC audit/smoke workflows.Test updates for schema and format expectations
event,_schema, and millisecond timestamp parsing instead of legacytypevalues.