Skip to content
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

Add stringSlice and int64Slice to pcommon, and let tests handle non-number slices #10148

Merged
merged 6 commits into from
May 21, 2024

Conversation

dmathieu
Copy link
Member

Description

This adds a string slice to pcommon, that will be used by the profiles pdata.

Link to tracking issue

Part of #10109.

Testing

This is unit-tested.

cc @mx-psi

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 79.33884% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 92.15%. Comparing base (e7dcfcc) to head (83f82f1).

Files Patch % Lines
pdata/internal/generated_wrapper_byteslice.go 0.00% 5 Missing ⚠️
pdata/internal/generated_wrapper_float64slice.go 0.00% 5 Missing ⚠️
pdata/internal/generated_wrapper_int64slice.go 54.54% 5 Missing ⚠️
pdata/internal/generated_wrapper_stringslice.go 54.54% 5 Missing ⚠️
pdata/internal/generated_wrapper_uint64slice.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10148      +/-   ##
==========================================
- Coverage   92.24%   92.15%   -0.10%     
==========================================
  Files         353      357       +4     
  Lines       16797    16918     +121     
==========================================
+ Hits        15495    15591      +96     
- Misses        963      988      +25     
  Partials      339      339              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmathieu dmathieu marked this pull request as ready for review May 14, 2024 07:34
@dmathieu dmathieu requested a review from a team as a code owner May 14, 2024 07:34
@dmathieu dmathieu requested a review from mx-psi May 14, 2024 07:34
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

I think this should not be a controversial addition, but since this is adding new API on a 1.0 module I would like other @open-telemetry/collector-approvers to take a look.

AIUI the motivation is to support fields like https://github.com/open-telemetry/opentelemetry-proto/blob/a05597bff803d3d9405fcdd1e1fb1f42bed4eb7a/opentelemetry/proto/profiles/v1experimental/pprofextended.proto#L97, so the risk is that we may not use this after all (sounds very unlikely though)

.chloggen/pcommon-string-slice.yaml Outdated Show resolved Hide resolved
@dmathieu dmathieu changed the title Add stringSlice to pcommon, and let tests handle non-number slices Add stringSlice and int64Slice to pcommon, and let tests handle non-number slices May 15, 2024
Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

I don't see a problem adding these, but want to make sure there is no other way for us to support this (if you have any idea, it would be good to brainstorm here).

@mx-psi
Copy link
Member

mx-psi commented May 15, 2024

@dmathieu To confirm: the intent is to use these types for fields like string_table or location_indices, right?

@dmathieu
Copy link
Member Author

Yes, it is. My pdata PR shows that use as well.

@mx-psi
Copy link
Member

mx-psi commented May 15, 2024

Thanks for confirming. I will wait until Friday before merging this to give time to others to review

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

Looking at #10109 I only see the new types being used in pprofile. Is it required that the new types be in pcommon?

@mx-psi
Copy link
Member

mx-psi commented May 16, 2024

Looking at #10109 I only see the new types being used in pprofile. Is it required that the new types be in pcommon?

IMO it is required after profiling is declared stable. It's not strictly required now, but it's better in that we don't need people to update their import paths for this after profiling goes to 1.0

@TylerHelmuth
Copy link
Member

It's not strictly required now, but it's better in that we don't need people to update their import paths for this after profiling goes to 1.0

I guess the risk is that this goes into 1.x pcommon and then needs removed/modified. Unlikely, but how would we handle that? Deprecate it and remove in 2.0?

@mx-psi
Copy link
Member

mx-psi commented May 17, 2024

Deprecate it and remove in 2.0?

Yup, it would become dead code

@TylerHelmuth
Copy link
Member

What would we do if it needs to be modified instead of removed?

@mx-psi
Copy link
Member

mx-psi commented May 17, 2024

What would we do if it needs to be modified instead of removed?

We would have to deprecate it and come up with a different name. I don't think that's going to happen here though, what a StringSlice type should look like is kind of already defined by the other <Type here>Slice types we already support

@mx-psi
Copy link
Member

mx-psi commented May 21, 2024

Waiting for v0.101.0 to be released, will merge after that

@mx-psi mx-psi merged commit 1159fda into open-telemetry:main May 21, 2024
48 of 49 checks passed
@github-actions github-actions bot added this to the next release milestone May 21, 2024
andrzej-stencel pushed a commit to andrzej-stencel/opentelemetry-collector that referenced this pull request May 27, 2024
…umber slices (open-telemetry#10148)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This adds a string slice to pcommon, that will be used by the profiles
pdata.

#### Link to tracking issue

Part of open-telemetry#10109.

#### Testing

This is unit-tested.

cc @mx-psi

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
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.

None yet

4 participants