Skip to content

Conversation

@dmitryax
Copy link
Member

@dmitryax dmitryax commented Oct 21, 2025

When entities are defined, mdatagen generates AssociateWith{EntityType}() methods on ResourceBuilder that associate resources with entity types using the entity refs API. The entities section is backward compatible - existing metadata.yaml files without entities continue to work as before. This change is fully additive and conditionally executed only if metadata.yaml has entities defined.

The generated Go API is experimental and will change once #14039 is merged. The generated documentation will also be updated for better readability

Updates #14051

@dmitryax dmitryax requested a review from a team as a code owner October 21, 2025 00:28
@dmitryax dmitryax requested a review from jmacd October 21, 2025 00:28
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 69.76744% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.57%. Comparing base (2646139) to head (9e3a53f).

Files with missing lines Patch % Lines
...econnector/internal/metadata/generated_resource.go 0.00% 7 Missing ⚠️
cmd/mdatagen/internal/metadata.go 82.85% 3 Missing and 3 partials ⚠️

❌ Your patch check has failed because the patch coverage (69.76%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14053      +/-   ##
==========================================
- Coverage   91.59%   91.57%   -0.02%     
==========================================
  Files         655      655              
  Lines       42786    42829      +43     
==========================================
+ Hits        39188    39222      +34     
- Misses       2772     2779       +7     
- Partials      826      828       +2     

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

When entities are defined, mdatagen generates `AssociateWith{EntityType}()` methods on ResourceBuilder that associate resources with entity types using the entity refs API. The entities section is backward compatible - existing metadata.yaml files without entities continue to work as before.

This change is fully additive for now. The generated Go API is experimental and will change once open-telemetry#14039 is merged.
Copy link
Member

@ChrsMark ChrsMark 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 great. Left a small nit

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants