Skip to content

Commit

Permalink
Delete all attribute keys matching pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-pinola-rf committed Mar 18, 2022
1 parent 720b132 commit 5278847
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/coreinternal/attraction/attraction.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,15 @@ func (ap *AttrProc) Process(ctx context.Context, logger *zap.Logger, attrs pdata
// and could impact performance.
switch action.Action {
case DELETE:
attrs.Remove(action.Key)
if action.Regex != nil {
attrs.RemoveIf(
func(s string, v pdata.Value) bool {
return action.Regex.MatchString(s)
},
)
} else {
attrs.Remove(action.Key)
}
case INSERT:
av, found := getSourceAttributeValue(ctx, action, attrs)
if !found {
Expand Down

0 comments on commit 5278847

Please sign in to comment.