Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
488 changes: 351 additions & 137 deletions api/gen/proto/go/settings/v1/recording_rules.pb.go

Large diffs are not rendered by default.

546 changes: 546 additions & 0 deletions api/gen/proto/go/settings/v1/recording_rules_vtproto.pb.go
29 changes: 29 additions & 0 deletions api/openapiv2/gen/phlare.swagger.json
Original file line number Diff line number Diff line change
@@ -1641,6 +1641,13 @@
}
}
},
"v1MetricType": {
"type": "string",
"enum": [
"TOTAL"
],
"default": "TOTAL"
},
"v1Point": {
"type": "object",
"properties": {
@@ -2006,6 +2013,9 @@
"type": "string",
"format": "int64",
"description": "The observed generation of this recording rule. This value should be\nprovided when making updates to this record, to avoid conflicting\nconcurrent updates."
},
"stacktraceFilter": {
"$ref": "#/definitions/v1StacktraceFilter"
}
}
},
@@ -2301,6 +2311,25 @@
},
"description": "StackTraceSelector is used for filtering stack traces by locations."
},
"v1StacktraceFilter": {
"type": "object",
"properties": {
"functionName": {
"$ref": "#/definitions/v1StacktraceFilterFunctionName"
}
}
},
"v1StacktraceFilterFunctionName": {
"type": "object",
"properties": {
"functionName": {
"type": "string"
},
"metricType": {
"$ref": "#/definitions/v1MetricType"
}
}
},
"v1StacktraceSample": {
"type": "object",
"properties": {
22 changes: 22 additions & 0 deletions api/settings/v1/recording_rules.proto
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ message UpsertRecordingRuleRequest {
// The observed generation of this recording rule. If this value does not
// match the generation stored in the database, this upsert will be rejected.
int64 generation = 6;

optional StacktraceFilter stacktrace_filter = 7;
}

message UpsertRecordingRuleResponse {
@@ -79,6 +81,25 @@ message RecordingRule {
// provided when making updates to this record, to avoid conflicting
// concurrent updates.
int64 generation = 7;

optional StacktraceFilter stacktrace_filter = 8;
}

message StacktraceFilter {
optional StacktraceFilterFunctionName function_name = 1;

// StacktraceFilterFunctionNameRegExp functionNameRegExp = 2;
}

enum MetricType {
TOTAL = 0;

// SELF = 1;
}

message StacktraceFilterFunctionName {
string function_name = 1;
MetricType metric_type = 2;
}

message RecordingRuleStore {
@@ -89,6 +110,7 @@ message RecordingRuleStore {
repeated string group_by = 5;
repeated types.v1.LabelPair external_labels = 6;
int64 generation = 7;
optional StacktraceFilter stacktrace_filter = 8;
}

message RecordingRulesStore {