-
Notifications
You must be signed in to change notification settings - Fork 645
feat(v2): function totals recording rules #4107
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
base: main
Are you sure you want to change the base?
Conversation
@@ -74,11 +74,34 @@ message RecordingRule { | |||
repeated string matchers = 4; | |||
repeated string group_by = 5; | |||
repeated types.v1.LabelPair external_labels = 6; | |||
StacktraceFilter stacktrace_filter = 7; |
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.
Optional. In absence of it total dimension (current implementation) is used.
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.
Ideally that should take the optional argument
StacktraceFilter stacktrace_filter = 7; | |
optional StacktraceFilter stacktrace_filter = 7; |
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.
I guess changes you make here also need to be done to message RecordingRuleStore
?
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.
Yes, I need to make generate
too. Will do it now
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.
Thanks for working on this. A few suggestions, let me know once you want me to take another look
StacktraceFilterType type = 1; | ||
StacktraceFilterFunctionName function_name = 2; |
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.
Rather than type I think it is nicer to use optional field per type and validate that only one is enabled at a time.
Alternatively there is also oneOf
in protobuf: https://protobuf.dev/programming-guides/proto3/#using-oneof
StacktraceFilterType type = 1; | |
StacktraceFilterFunctionName function_name = 2; | |
optional StacktraceFilterFunctionName function_name = 1; | |
// And in the future | |
// optional StacktraceFilterFunctionNameRegExp functionNameRegExp = 2; |
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.
Cool, I like this approach as well. I'll do it this way!
(I copied mine from Query
)
StacktraceFilter stacktrace_filter = 7; | ||
|
||
// The observed generation of this recording rule. This value should be | ||
// provided when making updates to this record, to avoid conflicting | ||
// concurrent updates. | ||
int64 generation = 7; | ||
int64 generation = 8; |
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.
Careful in protobuf those field IDs should never change or be reused after deprecation, as that would break existing API users.
@@ -74,11 +74,34 @@ message RecordingRule { | |||
repeated string matchers = 4; | |||
repeated string group_by = 5; | |||
repeated types.v1.LabelPair external_labels = 6; | |||
StacktraceFilter stacktrace_filter = 7; |
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.
Ideally that should take the optional argument
StacktraceFilter stacktrace_filter = 7; | |
optional StacktraceFilter stacktrace_filter = 7; |
@@ -74,11 +74,34 @@ message RecordingRule { | |||
repeated string matchers = 4; | |||
repeated string group_by = 5; | |||
repeated types.v1.LabelPair external_labels = 6; | |||
StacktraceFilter stacktrace_filter = 7; |
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.
I guess changes you make here also need to be done to message RecordingRuleStore
?
d3cebd9
to
9f50340
Compare
9f50340
to
639e51e
Compare
Adding a stacktrace filter field in the recording rules.
This way, we can define filter for function names and extend it in the future.
Examples of use:
With this, we should be able to extend it easily to: self function names, and self/total reg_exp function names