-
Notifications
You must be signed in to change notification settings - Fork 1.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
Added support for list values for a key in processor #1936
Changes from all commits
cc919b5
297a709
8aecbbf
8022fef
37b9c5e
afaa0a5
72616c4
8a26330
2e307bc
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 |
---|---|---|
|
@@ -105,8 +105,22 @@ func (ma attributesMatcher) Match(attrs pdata.AttributeMap) bool { | |
return false | ||
} | ||
} else if property.AttributeValue != nil { | ||
if !attr.Equal(*property.AttributeValue) { | ||
propertyAttrValue := property.AttributeValue | ||
switch propertyAttrValue.Type() { | ||
// Case when Attribute Values are of list values. | ||
case pdata.AttributeValueARRAY: | ||
for i := 0; i < propertyAttrValue.ArrayVal().Len(); i++ { | ||
// Check attr value is exists in the AttributeValue array. | ||
// Equal checks for any of int, string, bool and double. | ||
if attr.Equal(propertyAttrValue.ArrayVal().At(i)) { | ||
return true | ||
} | ||
} | ||
return false | ||
default: | ||
if !attr.Equal(*property.AttributeValue) { | ||
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. handling at 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. Can you point to the code where the return value is string? 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. Here Get func. Though the Otherwise handling at Equal func would be ideal. In fact, there is a I have tried using Anything should i be considering for these scenarios? |
||
return false | ||
} | ||
} | ||
} | ||
} | ||
|
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.
Instead of doing this here I suggest that we move this code to
attr.Equal
. It already has a TODO comment that expects this code to be there.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.
Thats right. I tried doing that earlier.
#1936 (comment)