Skip to content

Replace version in definition schema with file_format#1154

Open
lmolkova wants to merge 7 commits intoopen-telemetry:mainfrom
lmolkova:definition-file-format
Open

Replace version in definition schema with file_format#1154
lmolkova wants to merge 7 commits intoopen-telemetry:mainfrom
lmolkova:definition-file-format

Conversation

@lmolkova
Copy link
Member

@lmolkova lmolkova commented Jan 23, 2026

Align definition schema marker with resolved schema introduced in #1136

Extracted from #1106

@lmolkova lmolkova requested a review from a team as a code owner January 23, 2026 23:12
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.0%. Comparing base (54ee5f5) to head (3b3e3c2).

Files with missing lines Patch % Lines
crates/weaver_semconv/src/semconv.rs 66.6% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1154   +/-   ##
=====================================
  Coverage   79.9%   80.0%           
=====================================
  Files        109     109           
  Lines       8528    8528           
=====================================
+ Hits        6820    6823    +3     
+ Misses      1708    1705    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -1,4 +1,4 @@
version: "2"
file_format: definition/2.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'm not sure we want a three-version rule on language syntax. Or at least we should answer some questions:

  1. When do we fail to load a file because of major/minor versions? E.g. do we need something in place where weaver will fail to resolve definition/2.1.0 right now because we haven't defined the syntax there?
  2. When will we bump this version? Should we do so on any major feature addition to the syntax? (probably). We should open a ticket to have some kind of automated tracker to let us know to do this so it doesn't get lost.
  3. Do we need a tool to migrate from version 2.x -> 2.y? I had started working on such a thing for 1->2.

I'm on board moving this direction of using file_format everywhere, and we can make these decisions over time, but I'd like to write down our versioning/loading policy a bit more (it can be in follow on bugs) and make sure our release that uses this syntax can "scale" to future versions/usage.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great point. I don't really see a point in following semver for the definition. I hope we'll deprecate v1 and remove support for it at some point, then this won't be necessary at all.

But I still want a bit of consistency with file_format (primarily i think version is ambiguous) , so I updated the PR to dofile_format: definition/2.

V1(SemConvSpecV1),
/// Version 2 of the semantic convention schema.
#[serde(rename = "2")]
#[serde(rename = "definition/2.0.0")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will ONLY handle the literal string definition/2.0.0. If we were to try a version bump, like definition/2.1.0 then this would fail to resolve previous versions.

I think there's some HARD implications here for us to sort through. E.g. I'd prefer If we had a custom deserialization path for SERDE that would resolve version string and then delegate to a deserializer of choice.

That custom path would be responsible for

  • knowing if the version that came is compatible with versions we can represent in the current weaver.
  • Choosing the right Rust structure to deserialize into.

@lmolkova lmolkova force-pushed the definition-file-format branch from f400877 to 3b3e3c2 Compare February 9, 2026 23:22

let cleaned = serde_yaml::Value::Mapping(mapping);
if is_v2 {
let v2 = serde_yaml::from_value::<SemConvSpecV2>(cleaned).map_err(de::Error::custom)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure the errors are still meaningful here?

@lmolkova lmolkova moved this to To consider for the next release in OTel Weaver Project Feb 18, 2026
@jsuereth jsuereth moved this from To consider for the next release to Next Release in OTel Weaver Project Feb 18, 2026
Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, two major questions:

  • One on errors and what they look like wrapped now
  • Another on whether we should update the file format error message

/// This indicates the file version used is not yet stable.
#[error("Version `{version}` schema file format is not yet stable: {provenance}")]
/// This indicates the file format (version) used is not yet stable.
#[error("Version `{file_format}` schema file format is not yet stable: {provenance}")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should this now read "File Format"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Next Release

Development

Successfully merging this pull request may close these issues.

2 participants

Comments