Skip to content

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Jun 25, 2025

Part of #13264 but applied generically to all pdata types

@dmitryax dmitryax requested review from mx-psi, dmathieu, a team and bogdandrutu as code owners June 25, 2025 05:08
@dmitryax dmitryax force-pushed the internalize-copy-to branch from 02ff0d3 to 1b77214 Compare June 25, 2025 05:15
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

Attention: Patch coverage is 98.35651% with 13 lines in your changes missing coverage. Please review.

Project coverage is 91.56%. Comparing base (a33fdf3) to head (a7ce063).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pdata/internal/wrapper_value.go 74.28% 9 Missing ⚠️
pdata/pmetric/generated_exemplar.go 81.81% 2 Missing ⚠️
pdata/pmetric/generated_numberdatapoint.go 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13267      +/-   ##
==========================================
- Coverage   91.57%   91.56%   -0.02%     
==========================================
  Files         522      522              
  Lines       29089    29145      +56     
==========================================
+ Hits        26639    26687      +48     
- Misses       1933     1939       +6     
- Partials      517      519       +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.

@dmitryax dmitryax force-pushed the internalize-copy-to branch from 1b77214 to 72db77c Compare June 25, 2025 23:19
sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) })
}

func copyOrigResourceSpansSlice(dest, src []*otlptrace.ResourceSpans) []*otlptrace.ResourceSpans {
Copy link
Member

Choose a reason for hiding this comment

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

Not related to your change since you preserve existing logics, we should consolidate this logic with the one that we have on the primitive slices that uses append.

Probably we need some benchmarks and decide on one of them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried in #13293

Copy link
Member Author

@dmitryax dmitryax Jun 29, 2025

Choose a reason for hiding this comment

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

Tried the append approach in #13293. Looks like it's a no-go.

Also, tried the opposite, and it gave a slight improvement #13294

if src.Min_ == nil {
dest.Min_ = nil
} else {
dest.Min_ = &otlpmetrics.HistogramDataPoint_Min{Min: src.GetMin()}
Copy link
Member

Choose a reason for hiding this comment

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

If destination has min, can avoid a new allocation here and re-use that.

Copy link
Member

Choose a reason for hiding this comment

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

Can be done in separate PR since is an optimization.

@github-actions github-actions bot requested a review from bogdandrutu June 26, 2025 22:58
@dmitryax dmitryax added this pull request to the merge queue Jun 26, 2025
Merged via the queue into open-telemetry:main with commit 6aa2b81 Jun 27, 2025
56 checks passed
@dmitryax dmitryax deleted the internalize-copy-to branch June 27, 2025 00:07
github-merge-queue bot pushed a commit that referenced this pull request Jun 27, 2025
If destination has an optional field set to some value but source has it
unset, we need to unset the field on the destination instead of keeping
the old value.

Found this bug while working on
#13267
github-merge-queue bot pushed a commit that referenced this pull request Jun 30, 2025
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