Skip to content

Fix attributes with no stability being dropped in the v1 to v2 conversion - #1695

Merged
jsuereth merged 4 commits into
open-telemetry:mainfrom
jerbly:fix-v1-v2-attribute-conversion
Aug 13, 2026
Merged

jsuereth merged 4 commits into
open-telemetry:mainfrom
jerbly:fix-v1-v2-attribute-conversion

Conversation

@jerbly

@jerbly jerbly commented Aug 13, 2026

Copy link
Copy Markdown
Member

Catalog::convert_ref looks up a v1 attribute in the v2 catalog by comparing every field, and the stability clause read .map(|s| a.common.stability == *s).unwrap_or(false). An attribute with no stability therefore never matched. The catalog itself is built with stability.unwrap_or(Alpha), so the entry was there all along — the lookup just could not reach it. This PR applies the same Alpha default on the lookup side.

A missing stability is only a warning, so registries like this resolve and reach the conversion. Every signal loop calls convert_ref and skips the attribute when it returns None, so spans, events, metrics and attribute groups all lost it in silence. Entities are where it shows: an entity that loses an identity attribute has no identity, and registry package --v2 shipped identity: [] with a zero exit code.

The entity loop also hit an else { // TODO logic error! }, which is now a convert_attribute_ref helper returning AttributeNotFound.

This is the second of a series of small PRs for entity association resolution, and it is independent of the others.

@jerbly
jerbly requested a review from a team as a code owner August 13, 2026 00:50
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-08-13 22:26 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.6%. Comparing base (04abca0) to head (2347282).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/weaver_resolved_schema/src/v2/mod.rs 87.5% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1695     +/-   ##
=======================================
- Coverage   81.6%   81.6%   -0.1%     
=======================================
  Files        131     131             
  Lines      11829   11826      -3     
=======================================
- Hits        9656    9652      -4     
- Misses      2173    2174      +1     

☔ View full report in Codecov by Harness.
📢 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.

.as_ref()
.map(|s| a.common.stability == *s)
.unwrap_or(false)
// A v1 attribute can have no stability. The catalog

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch!

@jsuereth
jsuereth enabled auto-merge (squash) August 13, 2026 13:01
== *attribute
.stability
.as_ref()
.unwrap_or(&weaver_semconv::stability::Stability::Alpha)

@lmolkova lmolkova Aug 13, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit,

Suggested change
.unwrap_or(&weaver_semconv::stability::Stability::Alpha)
.unwrap_or(&weaver_semconv::stability::Stability::Development)

(even before alpha, this is where all semconv start)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was more than a one line change because this was used in the comparison so it need to change on both sides of that. But, since development is the default this turns out neater anyway. See 2347282

@jsuereth
jsuereth merged commit eb5f085 into open-telemetry:main Aug 13, 2026
28 checks passed
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.

3 participants