Skip to content

refactor(json)!: rename JsonLayout kvs and diags fields to attributes and context - #313

Merged
tisonkun merged 2 commits into
mainfrom
refactor/json-layout-field-names
Dec 1, 2026
Merged

tisonkun merged 2 commits into
mainfrom
refactor/json-layout-field-names

Conversation

@tisonkun

@tisonkun tisonkun commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rename JsonLayout's serialized JSON sub-objects for structured record key-values and diagnostics from "kvs" and "diags" to "attributes" and "context", and clean up layout/appender documentation to focus strictly on observable contracts.

"kvs" describes a data structure rather than event semantics, and "diags" exposes internal trait shorthand in external JSON log schemas. "attributes" (aligned with the OpenTelemetry Log Data Model) and "context" communicate the distinction between per-event properties and ambient execution metadata directly to log consumers.

Changes

  • logforth-layout-json:
    • Serialize Record::key_values() under "attributes" and Diagnostic entries under "context" (each still omitted when empty).
    • Simplify rustdoc (# Structured Fields) and crate README.md, removing undefined "envelope" terminology and internal buffer/allocation implementation details.
  • Cross-Crate Doc & Hygiene Cleanup:
    • Replace undefined "envelope" phrasing in GoogleCloudLoggingLayout, Journald (standard journal fields), appenders/syslog/README.md (Syslog header), and DESIGN.md (Reserved Top-Level Fields), and elide the explicit lifetime on valid_id in GoogleCloudLoggingLayout.
    • Update README.md, CHANGELOG.md, and integration assertions in layout_test::json, append_test::file, and logforth_test::pipeline.

… and context

Rename the serialized JSON sub-objects for structured record key-values
and diagnostics in `JsonLayout` from `"kvs"` and `"diags"` to
`"attributes"` and `"context"`.

Using semantic field names (`"attributes"` for event properties, matching
the OpenTelemetry Log Data Model, and `"context"` for ambient diagnostic
metadata) avoids leaking internal data-structure and trait shorthand into
external JSON log schemas.

Signed-off-by: tison <[email protected]>
@tisonkun tisonkun changed the title refactor!(json): rename JsonLayout kvs and diags fields to attributes and context refactor(json)!: rename JsonLayout kvs and diags fields to attributes and context Dec 1, 2026
Replace undefined "envelope" terminology across `JsonLayout`,
`GoogleCloudLoggingLayout`, `Journald`, `appenders/syslog/README.md`, and
`DESIGN.md` with standard domain terms (`top-level fields`, `standard
journal fields`, and `Syslog header`), remove internal buffer/allocation
implementation details from `JsonLayout` rustdoc, and elide the explicit
lifetime parameter on `valid_id` in `GoogleCloudLoggingLayout`.

Signed-off-by: tison <[email protected]>
@tisonkun
tisonkun merged commit 75ad464 into main Dec 1, 2026
10 checks passed
@tisonkun
tisonkun deleted the refactor/json-layout-field-names branch December 1, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant