Skip to content

Fix ref_group attribute overrides dropped in span_refinements#1407

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/drop-note-overrides-per-attribute
Draft

Fix ref_group attribute overrides dropped in span_refinements#1407
Copilot wants to merge 1 commit intomainfrom
copilot/drop-note-overrides-per-attribute

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

span_refinements using ref_group to include an attribute_group silently drop per-attribute overrides (e.g. note). The same group included from a regular spans entry preserves overrides correctly.

Root cause: In registry.rs, include_groups resolution was gated behind an else if on the extends branch. Since refinements always set extends, their include_groups (populated from ref_group) were never processed.

# Both pull the same group, but only the span preserves note: OVERRIDE_NOTE
spans:
  - type: my.regular
    attributes:
      - ref_group: my.group  # ✅ OVERRIDE_NOTE preserved

span_refinements:
  - id: my.refinement
    ref: my.base
    attributes:
      - ref_group: my.group  # ❌ OVERRIDE_NOTE dropped, got REGISTRY_NOTE

Changes:

  • Collect include_groups inside the extends block and pass all parent attribute sources together to resolve_inheritance_attrs_unified, so both inheritance and group inclusion are resolved in a single pass
  • The standalone else if branch for include_groups (no extends) is unchanged
  • Updated registry-test-v2-4-refinements to cover ref_group with a note override in both a regular span and a span refinement, asserting both resolve identically

When a refinement (e.g. span_refinements) had both `extends` and
`include_groups` (from ref_group), only the `extends` parent attributes
were resolved due to an `else if` that skipped include_groups processing.

This change integrates include_groups resolution into the extends block
so both are processed together via resolve_inheritance_attrs_unified.

Agent-Logs-Url: https://github.com/open-telemetry/weaver/sessions/82815637-bb24-4098-b2cd-f7d3b5ea6e2c

Co-authored-by: lmolkova <2347409+lmolkova@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.4%. Comparing base (69132ef) to head (2d35a49).

Files with missing lines Patch % Lines
crates/weaver_resolver/src/registry.rs 64.2% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1407     +/-   ##
=======================================
- Coverage   82.4%   82.4%   -0.1%     
=======================================
  Files        120     120             
  Lines      10092   10105     +13     
=======================================
+ Hits        8320    8327      +7     
- Misses      1772    1778      +6     

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

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.

2 participants