tail_sampling

package
v0.37.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 14 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 AndConfig added in v0.35.0

type AndConfig struct {
	SubPolicyConfig []AndSubPolicyConfig `river:"and_sub_policy,block"`
}

func (AndConfig) Convert added in v0.35.0

func (andConfig AndConfig) Convert() tsp.AndCfg

type AndSubPolicyConfig added in v0.35.0

type AndSubPolicyConfig struct {
	SharedPolicyConfig SharedPolicyConfig `river:",squash"`
}

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

func (AndSubPolicyConfig) Convert added in v0.35.0

func (andSubPolicyConfig AndSubPolicyConfig) Convert() tsp.AndSubPolicyCfg

type Arguments

type Arguments struct {
	PolicyCfgs              []PolicyConfig `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() (otelcomponent.Config, error)

Convert implements processor.Arguments.

func (Arguments) Exporters

Exporters implements processor.Arguments.

func (Arguments) Extensions

func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension

Extensions implements processor.Arguments.

func (Arguments) NextConsumers

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

NextConsumers implements processor.Arguments.

func (*Arguments) SetToDefault added in v0.35.0

func (args *Arguments) SetToDefault()

SetToDefault implements river.Defaulter.

func (*Arguments) Validate added in v0.35.0

func (args *Arguments) Validate() error

Validate implements river.Validator.

type BooleanAttributeConfig added in v0.35.0

type BooleanAttributeConfig struct {
	// Tag that the filter is going to be matching against.
	Key string `river:"key,attr"`
	// Value indicate the bool value, either true or false to use when matching against attribute values.
	// BooleanAttribute Policy will apply exact value match on Value
	Value bool `river:"value,attr"`
}

BooleanAttributeConfig holds the configurable settings to create a boolean attribute filter sampling policy evaluator.

func (BooleanAttributeConfig) Convert added in v0.35.0

func (booleanAttributeConfig BooleanAttributeConfig) Convert() tsp.BooleanAttributeCfg

type CompositeConfig added in v0.35.0

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

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

func (CompositeConfig) Convert added in v0.35.0

func (compositeConfig CompositeConfig) Convert() tsp.CompositeCfg

type CompositeSubPolicyConfig added in v0.35.0

type CompositeSubPolicyConfig struct {
	SharedPolicyConfig SharedPolicyConfig `river:",squash"`

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

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

func (CompositeSubPolicyConfig) Convert added in v0.35.0

func (compositeSubPolicyConfig CompositeSubPolicyConfig) Convert() tsp.CompositeSubPolicyCfg

type ErrorMode added in v0.35.0

type ErrorMode string

The error mode determines whether to ignore or propagate errors with evaluating OTTL conditions.

const (
	// "ignore" causes evaluation to continue to the next statement.
	ErrorModeIgnore ErrorMode = "ignore"
	// "propagate" causes the evaluation to be false and an error is returned.
	ErrorModePropagate ErrorMode = "propagate"
)

func (*ErrorMode) Convert added in v0.35.0

func (e *ErrorMode) Convert() ottl.ErrorMode

Convert the River type to the Otel type

func (*ErrorMode) UnmarshalText added in v0.35.0

func (e *ErrorMode) UnmarshalText(text []byte) error

func (*ErrorMode) Validate added in v0.35.0

func (e *ErrorMode) Validate() error

Validate implements river.Validator.

type LatencyConfig added in v0.35.0

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

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

func (LatencyConfig) Convert added in v0.35.0

func (latencyConfig LatencyConfig) Convert() tsp.LatencyCfg

type NumericAttributeConfig added in v0.35.0

type NumericAttributeConfig 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"`
}

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

func (NumericAttributeConfig) Convert added in v0.35.0

func (numericAttributeConfig NumericAttributeConfig) Convert() tsp.NumericAttributeCfg

type OttlConditionConfig added in v0.35.0

type OttlConditionConfig struct {
	ErrorMode           ErrorMode `river:"error_mode,attr"`
	SpanConditions      []string  `river:"span,attr,optional"`
	SpanEventConditions []string  `river:"spanevent,attr,optional"`
}

OttlConditionConfig holds the configurable setting to create a OTTL condition filter sampling policy evaluator.

func (OttlConditionConfig) Convert added in v0.35.0

func (ottlConditionConfig OttlConditionConfig) Convert() tsp.OTTLConditionCfg

type PolicyConfig added in v0.35.0

type PolicyConfig struct {
	SharedPolicyConfig SharedPolicyConfig `river:",squash"`

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

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

func (PolicyConfig) Convert added in v0.35.0

func (policyConfig PolicyConfig) Convert() tsp.PolicyCfg

type ProbabilisticConfig added in v0.35.0

type ProbabilisticConfig 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"`
}

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

func (ProbabilisticConfig) Convert added in v0.35.0

func (probabilisticConfig ProbabilisticConfig) Convert() tsp.ProbabilisticCfg

type RateAllocationConfig added in v0.35.0

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

RateAllocationConfig used within composite policy

func (RateAllocationConfig) Convert added in v0.35.0

func (rateAllocationConfig RateAllocationConfig) Convert() tsp.RateAllocationCfg

type RateLimitingConfig added in v0.35.0

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

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

func (RateLimitingConfig) Convert added in v0.35.0

func (rateLimitingConfig RateLimitingConfig) Convert() tsp.RateLimitingCfg

type SharedPolicyConfig added in v0.35.0

type SharedPolicyConfig struct {
	Name                   string                 `river:"name,attr"`
	Type                   string                 `river:"type,attr"`
	LatencyConfig          LatencyConfig          `river:"latency,block,optional"`
	NumericAttributeConfig NumericAttributeConfig `river:"numeric_attribute,block,optional"`
	ProbabilisticConfig    ProbabilisticConfig    `river:"probabilistic,block,optional"`
	StatusCodeConfig       StatusCodeConfig       `river:"status_code,block,optional"`
	StringAttributeConfig  StringAttributeConfig  `river:"string_attribute,block,optional"`
	RateLimitingConfig     RateLimitingConfig     `river:"rate_limiting,block,optional"`
	SpanCountConfig        SpanCountConfig        `river:"span_count,block,optional"`
	BooleanAttributeConfig BooleanAttributeConfig `river:"boolean_attribute,block,optional"`
	OttlConditionConfig    OttlConditionConfig    `river:"ottl_condition,block,optional"`
	TraceStateConfig       TraceStateConfig       `river:"trace_state,block,optional"`
}

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

type SpanCountConfig added in v0.35.0

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

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

func (SpanCountConfig) Convert added in v0.35.0

func (spanCountConfig SpanCountConfig) Convert() tsp.SpanCountCfg

type StatusCodeConfig added in v0.35.0

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

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

func (StatusCodeConfig) Convert added in v0.35.0

func (statusCodeConfig StatusCodeConfig) Convert() tsp.StatusCodeCfg

type StringAttributeConfig added in v0.35.0

type StringAttributeConfig 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"`
}

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

func (StringAttributeConfig) Convert added in v0.35.0

func (stringAttributeConfig StringAttributeConfig) Convert() tsp.StringAttributeCfg

type TraceStateConfig added in v0.35.0

type TraceStateConfig 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 (TraceStateConfig) Convert added in v0.35.0

func (traceStateConfig TraceStateConfig) Convert() tsp.TraceStateCfg

Jump to

Keyboard shortcuts

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