Skip to content

Introduce switchDictionary methods for profiles#14075

Merged
mx-psi merged 22 commits into
open-telemetry:mainfrom
dmathieu:switchdictionary
Nov 19, 2025
Merged

Introduce switchDictionary methods for profiles#14075
mx-psi merged 22 commits into
open-telemetry:mainfrom
dmathieu:switchdictionary

Conversation

@dmathieu
Copy link
Copy Markdown
Member

This is the next step towards #13106

It introduces private switchDictionary methods for all profile structs, so their base dictionary can be switched, which is a requirement (and maybe the biggest bit) of merging profiles.

Right now, the private method isn't called yet, because this PR is already very big, and I believe introducing MergeTo should be in another PR.
But the gist is that to merge profiles together, we need to change the base dictionary for the profiles that are being moved before we can merge the two slices of resource profiles into one.

@dmathieu dmathieu added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Oct 24, 2025
@dmathieu dmathieu marked this pull request as ready for review October 24, 2025 13:57
@dmathieu dmathieu requested review from a team and mx-psi as code owners October 24, 2025 13:57
@dmathieu
Copy link
Copy Markdown
Member Author

I know this is a quite large PR, but there's a lot of repetition in there (which also can't really be reduced).
I can split this into multiple PRs, but it seemed having lots of small PRs with a private method that's not used didn't make sense.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 68.15920% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.12%. Comparing base (5adc149) to head (14e6712).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pdata/pprofile/location.go 64.28% 5 Missing and 5 partials ⚠️
pdata/pprofile/profile.go 56.52% 5 Missing and 5 partials ⚠️
pdata/pprofile/sample.go 67.74% 5 Missing and 5 partials ⚠️
pdata/pprofile/function.go 73.91% 3 Missing and 3 partials ⚠️
pdata/pprofile/mapping.go 70.00% 3 Missing and 3 partials ⚠️
pdata/pprofile/keyvalueandunit.go 75.00% 2 Missing and 2 partials ⚠️
pdata/pprofile/line.go 69.23% 2 Missing and 2 partials ⚠️
pdata/pprofile/stack.go 69.23% 2 Missing and 2 partials ⚠️
pdata/pprofile/valuetype.go 75.00% 2 Missing and 2 partials ⚠️
pdata/pprofile/profiles.go 66.66% 1 Missing and 1 partial ⚠️
... and 2 more

❌ Your patch status has failed because the patch coverage (68.15%) 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   #14075      +/-   ##
==========================================
- Coverage   92.25%   92.12%   -0.14%     
==========================================
  Files         658      663       +5     
  Lines       41186    41387     +201     
==========================================
+ Hits        37998    38129     +131     
- Misses       2182     2218      +36     
- Partials     1006     1040      +34     

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

Copy link
Copy Markdown
Member

@florianl florianl left a comment

Choose a reason for hiding this comment

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

works fine here 👍

@mx-psi mx-psi added this pull request to the merge queue Nov 19, 2025
Merged via the queue into open-telemetry:main with commit 116c181 Nov 19, 2025
78 of 81 checks passed
@dmathieu dmathieu deleted the switchdictionary branch November 19, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants