Documentation
¶
Overview ¶
Package tail_sampling provides an otelcol.processor.tail_sampling component.
Index ¶
- Variables
- type AndCfg
- type AndSubPolicyCfg
- type Arguments
- func (args Arguments) Convert() (otelconfig.Processor, error)
- func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter
- func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension
- func (args Arguments) NextConsumers() *otelcol.ConsumerArguments
- func (args *Arguments) UnmarshalRiver(f func(interface{}) error) error
- type CompositeCfg
- type CompositeSubPolicyCfg
- type LatencyCfg
- type NumericAttributeCfg
- type PolicyCfg
- type ProbabilisticCfg
- type RateAllocationCfg
- type RateLimitingCfg
- type SharedPolicyCfg
- type SpanCountCfg
- type StatusCodeCfg
- type StringAttributeCfg
- type TraceStateCfg
Constants ¶
This section is empty.
Variables ¶
var DefaultArguments = Arguments{
DecisionWait: 30 * time.Second,
NumTraces: 50000,
ExpectedNewTracesPerSec: 0,
}
DefaultArguments holds default settings for Arguments.
Functions ¶
This section is empty.
Types ¶
type AndSubPolicyCfg ¶
type AndSubPolicyCfg struct {
SharedPolicyCfg SharedPolicyCfg `river:",squash"`
}
AndSubPolicyCfg holds the common configuration to all policies under and policy.
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, error)
Convert implements processor.Arguments.
func (Arguments) Exporters ¶
func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter
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.
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.
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
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.
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"`
}
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.
type RateAllocationCfg ¶
type RateAllocationCfg struct {
Policy string `river:"policy,attr"`
Percent int64 `river:"percent,attr"`
}
RateAllocationCfg used within composite policy
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.
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
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.
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.
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"`
}