-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add a more flexible sampling strategy data model #107
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: xiancli <xiancheng.li@ebay.com>
This feels too simplistic to me. Compare with open-telemetry/oteps#250 |
Signed-off-by: xiancli <xiancheng.li@ebay.com>
Good idea. How about introducing an "any" or "conjunction" option, along with adding a dimension matching strategy, similar to the changes made in this commit - 171bccd? Any thoughts, please advise! |
I would recommend starting with some use cases and showing a yaml-equivalent of the config for those, then we can translate it to the IDL. I think your proposal is still too rigid. For example, here's the DLS that Gemini recommends: message SamplingRule {
// Logical expression combining conditions
LogicalExpression expression = 1;
// Sampling strategy
oneof sampling_strategy {
FixedRateSampling fixed_rate_sampling = 2;
ProbabilisticSampling probabilistic_sampling = 3;
// Add other sampling strategies as needed
}
}
message LogicalExpression {
oneof expression {
Condition condition = 1;
AndExpression and_expression = 2;
OrExpression or_expression = 3;
NotExpression not_expression = 4;
}
}
message AndExpression {
repeated LogicalExpression expressions = 1;
}
message OrExpression {
repeated LogicalExpression expressions = 1;
}
message NotExpression {
LogicalExpression expression = 1;
} example rule message SamplingRule {
expression {
and_expression {
expressions {
condition {
attribute: "http.status_code"
operator: GREATER_THAN
int_value: 500
}
}
expressions {
condition {
attribute: "service.name"
operator: EQUALS
string_value: "my_service"
}
}
}
}
fixed_rate_sampling {
rate: 0.5
}
} The challenge when dealing with expressions and boolean logic is in validating that the rules in a strategy are disjoint, as otherwise the stratas are going to overlap and proper stratified sampling probabilities cannot be determined (although we probably can deal with that by assuming a priority order of the rules where earlier rule wins, in which case even if two rules overlap in the search space prioritizing one of them will effectively make them disjoint). |
Signed-off-by: xiancli <xiancheng.li@ebay.com>
Which problem is this PR solving?
Description of the changes
How was this change tested?