-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[processor/tailsampling] fix the behavior of inverse numeric filters #34416
[processor/tailsampling] fix the behavior of inverse numeric filters #34416
Conversation
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
{ | ||
Desc: "span attribute at the upper limit", | ||
Trace: newTraceIntAttrs(empty, "example", math.MaxInt32), | ||
Decision: Sampled, | ||
}, | ||
{ | ||
Desc: "resource attribute at the upper limit", | ||
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32}, "non_matching", math.MinInt32), |
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.
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32}, "non_matching", math.MinInt32), | |
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32}, "non_matching", math.MaxInt32), |
}, | ||
{ | ||
Desc: "resource attribute above max limit", | ||
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32 + 1}, "non_matching", math.MinInt32), |
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.
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32 + 1}, "non_matching", math.MinInt32), | |
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32 + 1}, "non_matching", math.MaxInt32), |
Or
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32 + 1}, "non_matching", math.MinInt32), | |
Trace: newTraceIntAttrs(map[string]any{"example": math.MinInt32 + 1}, "non_matching", math.MinInt32), |
}, | ||
{ | ||
Desc: "resource attribute at the lower limit", | ||
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32}, "non_matching", math.MinInt32), |
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.
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32}, "non_matching", math.MinInt32), | |
Trace: newTraceIntAttrs(map[string]any{"example": math.MinInt32}, "non_matching", math.MinInt32), |
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.
Actually, there's already a test a few line above with the same name. I wonder if they are the same?
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 spotting this - in this case the name of the test is misleading as it should be resource attribute at upper limit
- will fix that
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
…pen-telemetry#34416) **Description:** This PR fixes the behaviour of numeric attribute filters with the `inverse_match` option set to `true`. In this case, the numeric filter now returns `InvertNotSampled`/`InvertSampled` if its condition matches, to make sure a span with matching attributes is not sampled even though other policies might yield a `Sampled` result. **Link to tracking Issue:** open-telemetry#34296 **Testing:** Added unit tests **Documentation:** No changes here, as the expected behavior is already described in the docs --------- Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Description: This PR fixes the behaviour of numeric attribute filters with the
inverse_match
option set totrue
. In this case, the numeric filter now returnsInvertNotSampled
/InvertSampled
if its condition matches, to make sure a span with matching attributes is not sampled even though other policies might yield aSampled
result.Link to tracking Issue: #34296
Testing: Added unit tests
Documentation: No changes here, as the expected behavior is already described in the docs