Tolerate unknown properties in resolved schema / published manifest#1365
Draft
lmolkova wants to merge 1 commit intoopen-telemetry:mainfrom
Draft
Tolerate unknown properties in resolved schema / published manifest#1365lmolkova wants to merge 1 commit intoopen-telemetry:mainfrom
lmolkova wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1365 +/- ##
======================================
Coverage 81.9% 81.9%
======================================
Files 115 117 +2
Lines 9850 9978 +128
======================================
+ Hits 8069 8175 +106
- Misses 1781 1803 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Plan (incomplete, with follow ups)
Forward-compatibility for resolved schemas and publication manifests
Goal
Older weaver must read resolved schemas and publication manifests produced by newer weaver (minor version ahead). Unknown fields tolerated and ignored. Major version mismatch must fail.
Scope
ResolvedTelemetrySchemaand all nested types)PublicationRegistryManifest)SemConvSpecV2,CommonFields, etc.) — these keep#[serde(deny_unknown_fields)]Rules
Implementation pattern
Every struct in resolved schema and publication manifest: remove
#[serde(deny_unknown_fields)], add:This applies to ALL nested types: Registry, Refinements, Span, Metric, Event, Entity, AttributeGroup, SpanAttributeRef, MetricAttributeRef, EventAttributeRef, EntityAttributeRef, Attribute (catalog), SpanName, SpanRefinement, MetricRefinement, EventRefinement
When a definition type is reused in resolved schema:
#[serde(flatten)](e.g., CommonFields): no changes needed — outer struct's unknown_fields HashMap absorbs everything, inner deny_unknown_fields is effectively ignoredTypo detection (two-pass)
collect_unknown_fields must cover every type that has unknown_fields: HashMap
Version parsing
Resolved schema: prefix "resolved", current 2.0
Publication manifest: prefix "manifest", current 2.0
Tests
Convention
#[serde(flatten, skip_serializing)]and#[schemars(skip)]. Never written back out. Never appear in generated JSON schemas.