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

Allow creation of AttributeValue from nostd::span<const char*> #1416

Open
sirzooro opened this issue May 25, 2022 · 4 comments
Open

Allow creation of AttributeValue from nostd::span<const char*> #1416

sirzooro opened this issue May 25, 2022 · 4 comments
Assignees
Labels
breaking change API or ABI breaking change do-not-stale good first issue Good for newcomers help wanted Good for taking. Extra help will be provided by maintainers

Comments

@sirzooro
Copy link

Is your feature request related to a problem?
For debugging purposes I would like to add current callstack as an attribute to a span. backtrace_symbols returns char**, so I would like to use it directly and pass to span->SetAttribute(...), wrapped in nostd::span<const char*>. Now this is not possible, AttributeValue cannot be created from nostd::span<const char*>.

Describe the solution you'd like
Allow creation of AttributeValue from nostd::span<const char*>.

Describe alternatives you've considered
Now I need to create extra std::vector<opentelemetry::nostd::string_view> as a workaround.

@lalitb lalitb self-assigned this Jun 1, 2022
@lalitb
Copy link
Member

lalitb commented Jun 2, 2022

This is a valid use case. Though adding any new type in AttributeValue will break the ABI compliance.

@lalitb
Copy link
Member

lalitb commented Jun 6, 2022

@sirzooro - We discussed in the community meeting, that it would be good to support nostd::span<const char*>. Do you have plans to add the support?

@lalitb lalitb added help wanted Good for taking. Extra help will be provided by maintainers good first issue Good for newcomers labels Jun 6, 2022
@owent
Copy link
Member

owent commented Jun 7, 2022

Could we also add nostd::span<std::string> if we are planing to break ABI?
We can assign std::vector<std::string> and google::protobuf::RepeatedPtrField<std::string> to nostd::span<std::string> directly .
We must create a container of string_view and keep the same lifetime with the container of std::string now. It's expensive.

@github-actions
Copy link

github-actions bot commented Aug 7, 2022

This issue was marked as stale due to lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change API or ABI breaking change do-not-stale good first issue Good for newcomers help wanted Good for taking. Extra help will be provided by maintainers
Projects
None yet
Development

No branches or pull requests

4 participants