Skip to content

Allow cross-registry refinements#1587

Merged
lmolkova merged 4 commits into
open-telemetry:mainfrom
lmolkova:pr1-cross-registry-refinements
Jul 16, 2026
Merged

Allow cross-registry refinements#1587
lmolkova merged 4 commits into
open-telemetry:mainfrom
lmolkova:pr1-cross-registry-refinements

Conversation

@lmolkova

Copy link
Copy Markdown
Member

When refining something from dependency, weaver fails with

  × The following `extends` clause reference is not resolved for the group
  │ 'refined.request'.
  │ `extends` clause reference: span.server.request
  │ Provenance: Some(Provenance { schema_url: SchemaUrl { url: "https://span-
  │ consumer.example.com/schemas/1.0.0", name_range: 8..41, version_range:
  │ 42..47 }, path: "data/registry-test-v2-dep/span_registry/registry/
  │ registry.yaml" })

fixing it

@lmolkova
lmolkova requested a review from a team as a code owner July 12, 2026 22:54

Copilot AI left a comment

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.

Pull request overview

This PR fixes cross-registry (dependency) refinement/extends resolution by preserving the extended group’s signal type during resolution, enabling v1→v2 conversion and inheritance to work when the parent group is not present in the local registry.

Changes:

  • Record the parent group’s GroupType in GroupLineage during extends resolution.
  • Improve v2 dependency group lookup to handle both prefixed (v1-style) and unprefixed (v2-style) IDs and to preserve per-attribute requirement levels/sampling relevance.
  • Add end-to-end resolver fixtures/tests covering metric/span/event (and an ignored entity) refinements over a published v2 dependency.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/weaver_resolver/src/registry.rs Stores extended group type in lineage during extends resolution and continues inheriting required v2 fields.
crates/weaver_resolver/src/lib.rs Adds end-to-end tests asserting resolved v2 output for cross-dependency refinements.
crates/weaver_resolver/src/dependency.rs Improves v2 dependency lookup (prefix-stripping) and attribute inheritance fidelity (requirement level, sampling relevance).
crates/weaver_resolver/data/registry-test-v2-dep/span_registry/registry/registry.yaml New v2 span refinement fixture referencing a dependency span.
crates/weaver_resolver/data/registry-test-v2-dep/span_registry/registry/manifest.yaml New fixture manifest declaring dependency.
crates/weaver_resolver/data/registry-test-v2-dep/span_registry/expected-schema.yaml Expected resolved v2 output for span refinement fixture.
crates/weaver_resolver/data/registry-test-v2-dep/published/resolved.yaml Expands published dependency fixture to include span/event/entity signals and attributes.
crates/weaver_resolver/data/registry-test-v2-dep/metric_registry/registry/registry.yaml New v2 metric refinement fixture referencing a dependency metric.
crates/weaver_resolver/data/registry-test-v2-dep/metric_registry/registry/manifest.yaml New fixture manifest declaring dependency.
crates/weaver_resolver/data/registry-test-v2-dep/metric_registry/expected-schema.yaml Expected resolved v2 output for metric refinement fixture.
crates/weaver_resolver/data/registry-test-v2-dep/event_registry/registry/registry.yaml New v2 event refinement fixture referencing a dependency event.
crates/weaver_resolver/data/registry-test-v2-dep/event_registry/registry/manifest.yaml New fixture manifest declaring dependency.
crates/weaver_resolver/data/registry-test-v2-dep/event_registry/expected-schema.yaml Expected resolved v2 output for event refinement fixture.
crates/weaver_resolver/data/registry-test-v2-dep/entity_registry/registry/registry.yaml New v2 entity refinement fixture (currently exercised by an ignored test).
crates/weaver_resolver/data/registry-test-v2-dep/entity_registry/registry/manifest.yaml New fixture manifest declaring dependency.
crates/weaver_resolved_schema/src/v2/mod.rs Switches refinement detection to rely on the stored extended-group type during v1→v2 conversion.
crates/weaver_resolved_schema/src/lineage.rs Adds non-serialized extends_group_type to GroupLineage and updates extends() signature.
CHANGELOG.md Notes new support for refinements over published dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/weaver_resolved_schema/src/v2/mod.rs
Comment thread crates/weaver_resolved_schema/src/v2/mod.rs
Comment thread crates/weaver_resolved_schema/src/v2/mod.rs
@opentelemetry-pr-dashboard

Copy link
Copy Markdown

This PR has review comments. Review suggestions, whether from maintainers or automated reviewers, aren't always correct or required. Please evaluate each comment on its merits, then make sure each thread has a clear outcome.

For example, link to the commit if you applied a suggestion, explain why it wasn't applied, or ask a follow-up question.

Automation flags a PR for human review once every review thread has a reply or is marked as resolved.

Status across open PRs is visible on the pull request dashboard.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.3%. Comparing base (6211773) to head (f07832e).

Files with missing lines Patch % Lines
crates/weaver_resolver/src/dependency.rs 95.0% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1587   +/-   ##
=====================================
  Coverage   82.3%   82.3%           
=====================================
  Files        129     129           
  Lines      11000   10941   -59     
=====================================
- Hits        9061    9013   -48     
+ Misses      1939    1928   -11     

☔ 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.

@jsuereth jsuereth left a comment

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.

Nice cleanup / extension!

);
if let Some(lineage) = unresolved_group.group.lineage.as_mut() {
lineage.extends(extends);
lineage.extends(extends, parent_summary.r#type.clone());

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.

I find it amusing this is the key fix here :)

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.

right?!

@lmolkova
lmolkova merged commit 92ecfb2 into open-telemetry:main Jul 16, 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