-
Notifications
You must be signed in to change notification settings - Fork 267
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
Profiles: Replace has_* fields with an enum. #595
Open
aalexand
wants to merge
1
commit into
open-telemetry:main
Choose a base branch
from
aalexand:symlevel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aalexand Why not have this as an attribute? (
I admit I already forgot the relevant part in today's discussion). Looked up the mutability point in the agenda, and just to clarify: wouldn't this be either set once, at origin or if not set at origin, at a later point (e.g. in a processor)? Trying to understand why an attribute wouldn't be a fit here.If it's just a matter of having to remove a previously set attribute, wouldn't this only apply to
SYMBOLIZATION_LEVEL_UNSPECIFIED
(which we can define as the absence of the attribute) or would we need more elaborate processing that takes more cases into account?One reason that springs to mind is implementors not having to deal with OTel KeyValue which IIRC is a concern that you had in the past. Just wondering if there is something else, feel fee to correct my assumptions 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most elaborate "life of a profile" in terms of symbolization that I can think of is something like:
SYMBOLIZATION_LEVEL_NONE
to indicate that only IP addresses are available and nothing else.SYMBOLIZATION_LEVEL_SYMBOLS
level.SYMBOLIZATION_LEVEL_LINES_INLINE
level now.The re-symbolization part is not something that all profilers may want to support, but I wanted to indicate that the level upgrade is possible.
Of course, replacing an attribute in a proto in memory is not a huge deal - iterate over the
repeated opentelemetry.proto.common.v1.KeyValue attributes
list and replace or append the attribute with the desired key and new value, but it's still microchurn and for something that is so common as symbolization level it feels that having a simple explicit field is nicer. But it's definitely not a dealbreaker, so I'd love to hear what others think.As a side note, I wonder if it would be better if
repeated opentelemetry.proto.common.v1.KeyValue attributes
would be amap<Key, Value>
instead. I thought maybe it's to support multi-value attributes, but there is an explicit support for lists in this type, so it's not that.One other thing with commony used attributes also is that the definition of allowed values in their semantics is so far away from the proto itself. With an enum one gets compile-time checks, code completion etc. With attributes I don't even know what kind of presubmit or code generation support exists. This aspect probably shouldn't solely guide our decisions on what should be an attribute vs a field, but I think it's still a factor.