Documentation ¶
Index ¶
- func NewFactory() processor.Factory
- type AndConfig
- type AndSubPolicyConfig
- type Config
- type DecisionCacheCfg
- type DowngraderConfig
- type LatencyConfig
- type OTTLConditionConfig
- type PolicyConfig
- type PolicyType
- type ProbabilisticConfig
- type RemoteProbabilisticConfig
- type RootSpansConfig
- type SharedPolicyConfig
- type SpanCountConfig
- type StatusCodeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
Types ¶
type AndConfig ¶
type AndConfig struct {
SubPolicyCfg []AndSubPolicyConfig `mapstructure:"and_sub_policy"`
}
AndConfig holds the common configuration to all and policies.
type AndSubPolicyConfig ¶
type AndSubPolicyConfig struct {
}AndSubPolicyConfig holds the common configuration to all policies under and policy.
type Config ¶
type Config struct { // PolicyConfig sets the tail-based sampling policy which makes a sampling decision // for a given trace when requested. PolicyConfig []PolicyConfig `mapstructure:"policies"` // TargetHeapBytes, is the optional target heap size runtime.MemStats.HeapAlloc. // If set, the processor may adjust cache sizes dynamically in order to keep within the target. // A good starting point to set this is about 75% of overall memory resource allocation. TargetHeapBytes uint64 `mapstructure:"target_heap_bytes"` // PrimaryCacheSize sets the initial and maximum size of the primary cache that holds non-low priority traces. PrimaryCacheSize int `mapstructure:"primary_cache_size"` // SecondaryCacheSize defaults to 10% of the primary cache size. // It should not more than 50% of the primary cache size SecondaryCacheSize int `mapstructure:"secondary_cache_size"` DecisionCacheCfg `mapstructure:"decision_cache"` // FlushOnShutdown determines whether to flush the pending/cached trace data upon shutdown. FlushOnShutdown bool `mapstructure:"flush_on_shutdown"` // CompressionEnabled compresses trace data in the primary and secondary caches if enabled CompressionEnabled bool `mapstructure:"compression_enabled"` }
type DecisionCacheCfg ¶
type DecisionCacheCfg struct { // SampledCacheSize specifies the size of the cache that holds the sampled trace IDs. // This value will be the maximum amount of trace IDs that the cache can hold before overwriting previous IDs. // For effective use, this value should be at least an order of magnitude higher than Config.MaxTraces. // By default, 10x the Config.MaxTraces value will be used. SampledCacheSize int `mapstructure:"sampled_cache_size"` // NonSampledCacheSize specifies the size of the cache that holds the non-sampled trace IDs. // This value will be the maximum amount of trace IDs that the cache can hold before overwriting previous IDs. // For effective use, this value should be at least an order of magnitude higher than Config.MaxTraces. // By default, 10x the Config.MaxTraces value will be used. NonSampledCacheSize int `mapstructure:"non_sampled_cache_size"` }
type DowngraderConfig ¶
type DowngraderConfig struct { DowngradeTo string `mapstructure:"downgrade_to"` SubPolicyCfg SharedPolicyConfig `mapstructure:"sub_policy"` }
type LatencyConfig ¶
type LatencyConfig struct { // Lower bound in milliseconds ThresholdMs int64 `mapstructure:"threshold_ms"` }
LatencyConfig holds the configurable settings to create a latency filter sampling policy evaluator
type OTTLConditionConfig ¶
type OTTLConditionConfig struct { ErrorMode ottl.ErrorMode `mapstructure:"error_mode"` SpanConditions []string `mapstructure:"span"` SpanEventConditions []string `mapstructure:"spanevent"` }
OTTLConditionConfig holds the configurable setting to create a OTTL condition filter sampling policy evaluator.
type PolicyConfig ¶
type PolicyConfig struct { // Configs for defining and policy AndConfig AndConfig `mapstructure:"and"` RootSpansConfig RootSpansConfig `mapstructure:"root_spans"` DowngraderConfig DowngraderConfig `mapstructure:"downgrader"` }
PolicyConfig holds the common configuration to all policies.
type PolicyType ¶
type PolicyType string
PolicyType indicates the type of sampling policy.
const ( // Probabilistic samples a given percentage of traces. Probabilistic PolicyType = "probabilistic" // And allows defining a policy, combining the other policies in one And PolicyType = "and" // Downgrader downgrades a sampled decision Downgrader PolicyType = "downgrader" // SpanCount sample traces that are have more spans per Trace than a given threshold. SpanCount PolicyType = "span_count" // RootSpans allows a sub-policy to be defined, and operates the sub-policy only on root spans with no children. RootSpans PolicyType = "root_spans" // Latency sample traces that are longer than a given threshold. Latency PolicyType = "latency" // StatusCode sample traces that have a given status code. StatusCode PolicyType = "status_code" // OTTLCondition sample traces which match user provided OpenTelemetry Transformation Language // conditions. OTTLCondition PolicyType = "ottl_condition" // Threshold retrieves the threshold from sampling.tail.threshold attribute. // It compares the threshold to the trace ID. Threshold PolicyType = "threshold" // RemoteProbabilistic fetches the sampling rate and samples traces based on the returned rate at runtime. RemoteProbabilistic PolicyType = "remote_probabilistic" )
type ProbabilisticConfig ¶
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 `mapstructure:"hash_salt"` // 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 `mapstructure:"sampling_percentage"` }
ProbabilisticConfig holds the configurable settings to create a probabilistic sampling policy evaluator.
type RemoteProbabilisticConfig ¶
type RemoteProbabilisticConfig 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 `mapstructure:"hash_salt"` // DefaultRate is the default rate at which traces are going to be sampled if there is an error from the specified rate getter. // Defaults to zero, i.e.: no sample. Values greater or equal 100 are treated as "sample all traces". DefaultRate float64 `mapstructure:"default_rate"` // RateGetterExt is the component id of the rate getter extension to use to fetch the sampling rate at runtime. // The extension must implement the RateGetter interface. RateGetterExt component.ID `mapstructure:"rate_getter"` }
RemoteProbabilisticConfig holds the configurable settings to create a remote probabilistic sampling policy evaluator.
type RootSpansConfig ¶
type RootSpansConfig struct {
SubPolicyCfg SharedPolicyConfig `mapstructure:"sub_policy"`
}
type SharedPolicyConfig ¶
type SharedPolicyConfig struct { string `mapstructure:"name"` Type PolicyType `mapstructure:"type"` ProbabilisticConfig `mapstructure:"probabilistic"` SpanCountConfig `mapstructure:"span_count"` LatencyConfig `mapstructure:"latency"` StatusCodeConfig `mapstructure:"status_code"` OTTLConditionConfig `mapstructure:"ottl_condition"` RemoteProbabilisticConfig `mapstructure:"remote_probabilistic"` }Name
SharedPolicyConfig holds the common configuration to all policies that are used in derivative policy configurations such as the "and" policy.
type SpanCountConfig ¶
type SpanCountConfig struct { // MinSpans is the minimum number of spans in a Trace for it to be sampled MinSpans int32 `mapstructure:"min_spans"` // LogSampled indicates whether to emit a log when a trace is sampled. // It will log trace ID, services in trace, and span count. LogSampled bool `mapstructure:"log_sampled"` }
SpanCountConfig holds the configurable settings to create a Span Count filter sampling policy evaluator
type StatusCodeConfig ¶
type StatusCodeConfig struct {
StatusCodes []string `mapstructure:"status_codes"`
}
StatusCodeConfig holds the configurable settings to create a status code filter sampling policy evaluator.