-
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
Changes from 1 commit
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: bug_fix | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: tailsamplingprocessor | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Fix the behavior for numeric tag filters with `inverse_match` set to `true`. | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [34296] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,21 +38,41 @@ func TestNumericTagFilter(t *testing.T) { | |||||||||
Trace: newTraceIntAttrs(empty, "example", math.MinInt32), | ||||||||||
Decision: Sampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "resource attribute at the lower limit", | ||||||||||
Trace: newTraceIntAttrs(map[string]any{"example": math.MinInt32}, "non_matching", math.MinInt32), | ||||||||||
Decision: Sampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
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), | ||||||||||
Decision: Sampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "span attribute below min limit", | ||||||||||
Trace: newTraceIntAttrs(empty, "example", math.MinInt32-1), | ||||||||||
Decision: NotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "resource attribute below min limit", | ||||||||||
Trace: newTraceIntAttrs(map[string]any{"example": math.MinInt32 - 1}, "non_matching", math.MinInt32), | ||||||||||
Decision: NotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "span attribute above max limit", | ||||||||||
Trace: newTraceIntAttrs(empty, "example", math.MaxInt32+1), | ||||||||||
Decision: NotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "resource attribute above max limit", | ||||||||||
Trace: newTraceIntAttrs(map[string]any{"example": math.MaxInt32 + 1}, "non_matching", math.MaxInt32), | ||||||||||
Decision: NotSampled, | ||||||||||
}, | ||||||||||
} | ||||||||||
|
||||||||||
for _, c := range cases { | ||||||||||
|
@@ -81,27 +101,47 @@ func TestNumericTagFilterInverted(t *testing.T) { | |||||||||
{ | ||||||||||
Desc: "nonmatching span attribute", | ||||||||||
Trace: newTraceIntAttrs(empty, "non_matching", math.MinInt32), | ||||||||||
Decision: Sampled, | ||||||||||
Decision: InvertSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "span attribute at the lower limit", | ||||||||||
Trace: newTraceIntAttrs(empty, "example", math.MinInt32), | ||||||||||
Decision: NotSampled, | ||||||||||
Decision: InvertNotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "resource attribute at the lower limit", | ||||||||||
Trace: newTraceIntAttrs(map[string]any{"example": math.MinInt32}, "non_matching", math.MinInt32), | ||||||||||
Decision: InvertNotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "span attribute at the upper limit", | ||||||||||
Trace: newTraceIntAttrs(empty, "example", math.MaxInt32), | ||||||||||
Decision: NotSampled, | ||||||||||
Decision: InvertNotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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. 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 commentThe 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 |
||||||||||
Decision: InvertNotSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "span attribute below min limit", | ||||||||||
Trace: newTraceIntAttrs(empty, "example", math.MinInt32-1), | ||||||||||
Decision: Sampled, | ||||||||||
Decision: InvertSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "resource attribute below min limit", | ||||||||||
Trace: newTraceIntAttrs(map[string]any{"example": math.MinInt32 - 1}, "non_matching", math.MinInt32), | ||||||||||
Decision: InvertSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
Desc: "span attribute above max limit", | ||||||||||
Trace: newTraceIntAttrs(empty, "example", math.MaxInt32+1), | ||||||||||
Decision: Sampled, | ||||||||||
Decision: InvertSampled, | ||||||||||
}, | ||||||||||
{ | ||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Or
Suggested change
|
||||||||||
Decision: InvertSampled, | ||||||||||
}, | ||||||||||
} | ||||||||||
|
||||||||||
|
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.