tail_sampling

package
v0.32.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package tail_sampling provides an otelcol.processor.tail_sampling component.

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	DecisionWait:            30 * time.Second,
	NumTraces:               50000,
	ExpectedNewTracesPerSec: 0,
}

DefaultArguments holds default settings for Arguments.

Functions

This section is empty.

Types

type AndCfg

type AndCfg struct {
	SubPolicyCfg []AndSubPolicyCfg `river:"and_sub_policy,block"`
}

func (AndCfg) Convert

func (andCfg AndCfg) Convert() tsp.AndCfg

type AndSubPolicyCfg

type AndSubPolicyCfg struct {
	SharedPolicyCfg SharedPolicyCfg `river:",squash"`
}

AndSubPolicyCfg holds the common configuration to all policies under and policy.

func (AndSubPolicyCfg) Convert

func (andSubPolicyCfg AndSubPolicyCfg) Convert() tsp.AndSubPolicyCfg

type Arguments

type Arguments struct {
	PolicyCfgs              []PolicyCfg   `river:"policy,block"`
	DecisionWait            time.Duration `river:"decision_wait,attr,optional"`
	NumTraces               uint64        `river:"num_traces,attr,optional"`
	ExpectedNewTracesPerSec uint64        `river:"expected_new_traces_per_sec,attr,optional"`
	// Output configures where to send processed data. Required.
	Output *otelcol.ConsumerArguments `river:"output,block"`
}

Arguments configures the otelcol.processor.tail_sampling component.

func (Arguments) Convert

func (args Arguments) Convert() otelconfig.Processor

Convert implements processor.Arguments.

func (Arguments) Exporters

Exporters implements processor.Arguments.

func (Arguments) Extensions

func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension

Extensions implements processor.Arguments.

func (Arguments) NextConsumers

func (args Arguments) NextConsumers() *otelcol.ConsumerArguments

NextConsumers implements processor.Arguments.

func (*Arguments) UnmarshalRiver

func (args *Arguments) UnmarshalRiver(f func(interface{}) error) error

UnmarshalRiver implements river.Unmarshaler. It applies defaults to args and validates settings provided by the user.

type CompositeCfg

type CompositeCfg struct {
	MaxTotalSpansPerSecond int64                   `river:"max_total_spans_per_second,attr"`
	PolicyOrder            []string                `river:"policy_order,attr"`
	SubPolicyCfg           []CompositeSubPolicyCfg `river:"composite_sub_policy,block,optional"`
	RateAllocation         []RateAllocationCfg     `river:"rate_allocation,block,optional"`
}

CompositeCfg holds the configurable settings to create a composite sampling policy evaluator.

func (CompositeCfg) Convert

func (compositeCfg CompositeCfg) Convert() tsp.CompositeCfg

type CompositeSubPolicyCfg

type CompositeSubPolicyCfg struct {
	SharedPolicyCfg SharedPolicyCfg `river:",squash"`

	// Configs for and policy evaluator.
	AndCfg AndCfg `river:"and,block,optional"`
}

CompositeSubPolicyCfg holds the common configuration to all policies under composite policy.

func (CompositeSubPolicyCfg) Convert

func (compositeSubPolicyCfg CompositeSubPolicyCfg) Convert() tsp.CompositeSubPolicyCfg

type LatencyCfg

type LatencyCfg struct {
	// ThresholdMs in milliseconds.
	ThresholdMs int64 `river:"threshold_ms,attr"`
}

LatencyCfg holds the configurable settings to create a latency filter sampling policy evaluator

func (LatencyCfg) Convert

func (latencyCfg LatencyCfg) Convert() tsp.LatencyCfg

type NumericAttributeCfg

type NumericAttributeCfg struct {
	// Tag that the filter is going to be matching against.
	Key string `river:"key,attr"`
	// MinValue is the minimum value of the attribute to be considered a match.
	MinValue int64 `river:"min_value,attr"`
	// MaxValue is the maximum value of the attribute to be considered a match.
	MaxValue int64 `river:"max_value,attr"`
}

NumericAttributeCfg holds the configurable settings to create a numeric attribute filter sampling policy evaluator.

func (NumericAttributeCfg) Convert

func (numericAttributeCfg NumericAttributeCfg) Convert() tsp.NumericAttributeCfg

type PolicyCfg

type PolicyCfg struct {
	SharedPolicyCfg SharedPolicyCfg `river:",squash"`

	// Configs for defining composite policy
	CompositeCfg CompositeCfg `river:"composite,block,optional"`

	// Configs for defining and policy
	AndCfg AndCfg `river:"and,block,optional"`
}

func (PolicyCfg) Convert

func (policyCfg PolicyCfg) Convert() tsp.PolicyCfg

type ProbabilisticCfg

type ProbabilisticCfg struct {
	// HashSalt allows one to configure the hashing salts. This is important in scenarios where multiple layers of collectors
	// have different sampling rates: if they use the same salt all passing one layer may pass the other even if they have
	// different sampling rates, configuring different salts avoids that.
	HashSalt string `river:"hash_salt,attr,optional"`
	// SamplingPercentage is the percentage rate at which traces are going to be sampled. Defaults to zero, i.e.: no sample.
	// Values greater or equal 100 are treated as "sample all traces".
	SamplingPercentage float64 `river:"sampling_percentage,attr"`
}

ProbabilisticCfg holds the configurable settings to create a probabilistic sampling policy evaluator.

func (ProbabilisticCfg) Convert

func (probabilisticCfg ProbabilisticCfg) Convert() tsp.ProbabilisticCfg

type RateAllocationCfg

type RateAllocationCfg struct {
	Policy  string `river:"policy,attr"`
	Percent int64  `river:"percent,attr"`
}

RateAllocationCfg used within composite policy

func (RateAllocationCfg) Convert

func (rateAllocationCfg RateAllocationCfg) Convert() tsp.RateAllocationCfg

type RateLimitingCfg

type RateLimitingCfg struct {
	// SpansPerSecond sets the limit on the maximum nuber of spans that can be processed each second.
	SpansPerSecond int64 `river:"spans_per_second,attr"`
}

RateLimitingCfg holds the configurable settings to create a rate limiting sampling policy evaluator.

func (RateLimitingCfg) Convert

func (rateLimitingCfg RateLimitingCfg) Convert() tsp.RateLimitingCfg

type SharedPolicyCfg

type SharedPolicyCfg struct {
	Name                string              `river:"name,attr"`
	Type                string              `river:"type,attr"`
	LatencyCfg          LatencyCfg          `river:"latency,block,optional"`
	NumericAttributeCfg NumericAttributeCfg `river:"numeric_attribute,block,optional"`
	ProbabilisticCfg    ProbabilisticCfg    `river:"probabilistic,block,optional"`
	StatusCodeCfg       StatusCodeCfg       `river:"status_code,block,optional"`
	StringAttributeCfg  StringAttributeCfg  `river:"string_attribute,block,optional"`
	RateLimitingCfg     RateLimitingCfg     `river:"rate_limiting,block,optional"`
	SpanCountCfg        SpanCountCfg        `river:"span_count,block,optional"`
	TraceStateCfg       TraceStateCfg       `river:"trace_state,block,optional"`
}

This cannot currently have a Convert() because tsp.sharedPolicyCfg isn't public

type SpanCountCfg

type SpanCountCfg struct {
	// Minimum number of spans in a Trace
	MinSpans int32 `river:"min_spans,attr"`
}

SpanCountCfg holds the configurable settings to create a Span Count filter sampling policy sampling policy evaluator

func (SpanCountCfg) Convert

func (spanCountCfg SpanCountCfg) Convert() tsp.SpanCountCfg

type StatusCodeCfg

type StatusCodeCfg struct {
	StatusCodes []string `river:"status_codes,attr"`
}

StatusCodeCfg holds the configurable settings to create a status code filter sampling policy evaluator.

func (StatusCodeCfg) Convert

func (statusCodeCfg StatusCodeCfg) Convert() tsp.StatusCodeCfg

type StringAttributeCfg

type StringAttributeCfg struct {
	// Tag that the filter is going to be matching against.
	Key string `river:"key,attr"`
	// Values indicate the set of values or regular expressions to use when matching against attribute values.
	// StringAttribute Policy will apply exact value match on Values unless EnabledRegexMatching is true.
	Values []string `river:"values,attr"`
	// EnabledRegexMatching determines whether match attribute values by regexp string.
	EnabledRegexMatching bool `river:"enabled_regex_matching,attr,optional"`
	// CacheMaxSize is the maximum number of attribute entries of LRU Cache that stores the matched result
	// from the regular expressions defined in Values.
	// CacheMaxSize will not be used if EnabledRegexMatching is set to false.
	CacheMaxSize int `river:"cache_max_size,attr,optional"`
	// InvertMatch indicates that values or regular expressions must not match against attribute values.
	// If InvertMatch is true and Values is equal to 'acme', all other values will be sampled except 'acme'.
	// Also, if the specified Key does not match on any resource or span attributes, data will be sampled.
	InvertMatch bool `river:"invert_match,attr,optional"`
}

StringAttributeCfg holds the configurable settings to create a string attribute filter sampling policy evaluator.

func (StringAttributeCfg) Convert

func (stringAttributeCfg StringAttributeCfg) Convert() tsp.StringAttributeCfg

type TraceStateCfg

type TraceStateCfg struct {
	// Tag that the filter is going to be matching against.
	Key string `river:"key,attr"`
	// Values indicate the set of values to use when matching against trace_state values.
	Values []string `river:"values,attr"`
}

func (TraceStateCfg) Convert

func (traceStateCfg TraceStateCfg) Convert() tsp.TraceStateCfg

Jump to

Keyboard shortcuts

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