-
Notifications
You must be signed in to change notification settings - Fork 265
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: update default value field in message Profile #608
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,10 +229,6 @@ message Profile { | |
// for human-friendly content. The profile must stay functional if this field | ||
// is cleaned. | ||
repeated int32 comment_strindices = 15; // Indices into string table. | ||
// Index into the string table of the type of the preferred sample | ||
// value. If unset, clients should default to the last sample value. | ||
int32 default_sample_type_strindex = 16; | ||
|
||
|
||
// A globally unique identifier for a profile. The ID is a 16-byte array. An ID with | ||
// all zeroes is considered invalid. | ||
|
@@ -269,6 +265,9 @@ message Profile { | |
// The field is optional, however if it is present then equivalent converted data should be populated in other fields | ||
// of this message as far as is practicable. | ||
bytes original_payload = 21; | ||
|
||
// Index into the sample_type array for the type of the default sample value. | ||
int32 default_sample_type_index = 23; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Did you see this issue in practice? It's not very obvious to me that this change is worth it:
Also note that this changes the semantics of unset default sample type compared to pprof: here the unset field will effectively mean first sample type, in pprof that means last:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The named issues around Unfortunately there are implementations, where There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that example it seems odd that the sample type name had the unit. I'd expect the name of the sample type to be "time" or something like that, and that's what the default sample type field would also contain. And microseconds or nanoseconds would be the unit field. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I'm mixing something. The value in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For example, for sample types of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your example :) I think it points out exactly the issue with this field. While I run into issues with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But the unit name is clearly not unique - two or more field can use the same unit (e.g. bytes). I'm not sure why this is ambiguous tbh. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my motivation with this proposal is to avoid named issues in the future by pointing the index for the default value to the elements that already exist in sample_type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have opened #610 as an alternative and will close this proposal. |
||
} | ||
|
||
// Represents a mapping between Attribute Keys and Units. | ||
|
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.
Depending on the discussion in #606 (comment) this field ID could also be 16. 23 is chosen here, as this is the next free field ID once #606 is merged.