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

[pdata/pprofile] Add helper method to allow modifying a struct's attributes #12206

Open
dmathieu opened this issue Jan 29, 2025 · 0 comments · May be fixed by #12390
Open

[pdata/pprofile] Add helper method to allow modifying a struct's attributes #12206

dmathieu opened this issue Jan 29, 2025 · 0 comments · May be fixed by #12390
Assignees

Comments

@dmathieu
Copy link
Member

dmathieu commented Jan 29, 2025

In profiles, attributes are set with an AttributeTable at the profile level. Then, every internal object has an AttributeIndices attribute which holds references to the main table.

This means components need an additional step to modify the attributes (add, remove them). So we should provide an helper method to facilitate the action and make it efficient all the time.

We could have something like:

ToAttributeIndices(data pcommon.Map, table AttributeTable, record attributable)

Which would do a full replace of the attributes with a new map.
However, folks would have to first get the attributes and then update them to make a single update.

We could also have a single attribute add:

Addattribute(key, value string, table AttributeTable, record attributable)

Related: #12176

cc @open-telemetry/profiling-approvers @open-telemetry/profiling-maintainers

@dmathieu dmathieu self-assigned this Jan 29, 2025
@dmathieu dmathieu added this to the Profiling support milestone Jan 29, 2025
@dmathieu dmathieu linked a pull request Feb 14, 2025 that will close this issue
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 a pull request may close this issue.

1 participant