Skip to content

[pdata] Add support for the new resource-entity references in xpdata #13264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Jun 24, 2025

Add support for the new resource-entity reference API added to the proto as part of open-telemetry/opentelemetry-proto#635.

The API is separated into the experimental xpdata module since the new entity related protobuf definitions are in development

This is the first step towards adopting Entities in Collector which was drafted in #11958

@dmitryax dmitryax requested review from bogdandrutu and a team as code owners June 24, 2025 21:16
@dmitryax dmitryax force-pushed the resource-entity-ref-support branch 2 times, most recently from 113ab6b to 94e027e Compare June 24, 2025 22:06
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

Attention: Patch coverage is 85.44304% with 23 lines in your changes missing coverage. Please review.

Project coverage is 91.61%. Comparing base (0555b12) to head (770f58c).

Files with missing lines Patch % Lines
pdata/internal/generated_wrapper_entityref.go 54.54% 10 Missing ⚠️
pdata/internal/generated_wrapper_entityrefslice.go 66.66% 10 Missing ⚠️
pdata/xpdata/entity/generated_entityrefslice.go 95.45% 2 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (85.44%) 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   #13264      +/-   ##
==========================================
- Coverage   91.67%   91.61%   -0.06%     
==========================================
  Files         522      527       +5     
  Lines       29208    29366     +158     
==========================================
+ Hits        26775    26903     +128     
- Misses       1917     1944      +27     
- Partials      516      519       +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.

github-merge-queue bot pushed a commit that referenced this pull request Jun 27, 2025
Part of
#13264 but
applied generically to all pdata types
@dmitryax dmitryax force-pushed the resource-entity-ref-support branch 3 times, most recently from 284287b to cddea6a Compare June 30, 2025 03:08
@dmitryax dmitryax moved this to In Progress in Entities Jun 30, 2025
@dmitryax dmitryax changed the title [pdata] Add support for the new resource-entity refences in xpdata [pdata] Add support for the new resource-entity references in xpdata Jun 30, 2025
@dmitryax dmitryax force-pushed the resource-entity-ref-support branch from cddea6a to e91922d Compare July 1, 2025 16:55
)

// ResourceEntityRefs returns the EntityRefs associated with this Resource.
func ResourceEntityRefs(res pcommon.Resource) EntityRefSlice {
Copy link
Member

Choose a reason for hiding this comment

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

s/ResourceEntityRefs/GetEntityRefs?

I think this is temporary correct until the entity is moved to stable. If that is the case we should document it.

Copy link
Member Author

@dmitryax dmitryax Jul 2, 2025

Choose a reason for hiding this comment

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

s/ResourceEntityRefs/GetEntityRefs?

Why don't mention the resource in the name? Also, Get isn't good from the Go best practices perspective. Maybe EntityRefsFromResource?

I think this is temporary correct until the entity is moved to stable. If that is the case we should document it.

Added a comment about that

Add support for the new resource-entity reference API added to the proto as part of open-telemetry/opentelemetry-proto#635.

This required moving CopyTo implementation to the internal package for the structures that are used by other packages
@dmitryax dmitryax force-pushed the resource-entity-ref-support branch from e91922d to 770f58c Compare July 2, 2025 19:01
@github-actions github-actions bot requested a review from bogdandrutu July 2, 2025 19:01
)

// ResourceEntityRefs returns the EntityRefs associated with this Resource.
// Once EntityRefs is stabilized in the proto definition,
Copy link
Member

Choose a reason for hiding this comment

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

Once EntityRefs is stabilized in the proto definition,

FYI: Even though this is in xpdata if incompatible changes are made to the EntityRefs definition, then we can no longer process the incoming request. Please make sure we don't break this.

@dmitryax dmitryax added this pull request to the merge queue Jul 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 2, 2025
@dmitryax dmitryax added this pull request to the merge queue Jul 2, 2025
Merged via the queue into open-telemetry:main with commit 627e36f Jul 2, 2025
56 of 57 checks passed
@dmitryax dmitryax deleted the resource-entity-ref-support branch July 2, 2025 21:42
@github-project-automation github-project-automation bot moved this from In Progress to Done in Entities Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants