rules

package
v1.300039.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionItem

type ActionItem struct {
	SelectorMatchers []SelectorMatcherItem
	Replacements     []Replacement `mapstructure:",omitempty"`
}

type AllowListAction

type AllowListAction string
const (
	AllowListActionKeep    AllowListAction = "keep"
	AllowListActionDrop    AllowListAction = "drop"
	AllowListActionReplace AllowListAction = "replace"
)

func GetAllowListAction

func GetAllowListAction(action string) (AllowListAction, error)

type DropActions

type DropActions struct {
	Actions []ActionItem
}

func NewDropper

func NewDropper(rules []Rule) *DropActions

func (*DropActions) ShouldBeDropped

func (d *DropActions) ShouldBeDropped(attributes pcommon.Map) (bool, error)

type KeepActions

type KeepActions struct {
	Actions []ActionItem
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(rules []Rule, markDataPointAsReserved bool) *KeepActions

func (*KeepActions) ShouldBeDropped

func (k *KeepActions) ShouldBeDropped(attributes pcommon.Map) (bool, error)

type ReplaceActions

type ReplaceActions struct {
	Actions []ActionItem
	// contains filtered or unexported fields
}

func NewReplacer

func NewReplacer(rules []Rule, markDataPointAsReserved bool) *ReplaceActions

func (*ReplaceActions) Process

func (r *ReplaceActions) Process(attributes, _ pcommon.Map, isTrace bool) error

type Replacement

type Replacement struct {
	TargetDimension string `mapstructure:"target_dimension"`
	Value           string `mapstructure:"value"`
}

type Rule

type Rule struct {
	Selectors    []Selector      `mapstructure:"selectors"`
	Replacements []Replacement   `mapstructure:"replacements,omitempty"`
	Action       AllowListAction `mapstructure:"action"`
	RuleName     string          `mapstructure:"rule_name,omitempty"`
}

type Selector

type Selector struct {
	Dimension string `mapstructure:"dimension"`
	Match     string `mapstructure:"match"`
}

type SelectorMatcherItem

type SelectorMatcherItem struct {
	Key     string
	Matcher glob.Glob
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL