# Functions
GetClientRate gets the rate at which the trace this span belongs to was sampled by the tracer.
GetEventExtractionRate gets the rate at which the trace from which we extracted this event was sampled at the tracer.
GetGlobalRate gets the cumulative sample rate of the trace to which this span belongs to.
GetMaxEPSRate gets the rate at which this event was sampled by the max eps event sampler.
GetPreSampleRate returns the rate at which the trace this span belongs to was sampled by the agent's presampler.
GetSamplingPriority returns the value of the sampling priority metric set on this span and a boolean indicating if such a metric was actually found or not.
NewDynamicConfig creates a new dynamic config object which maps service signatures to their corresponding sampling rates.
NewErrorsSampler returns an initialized Sampler dedicate to errors.
NewExceptionSampler returns a NewExceptionSampler that ensures that we sample combinations of env, service, name, resource, http-status, error type for each top level or measured spans.
NewMemoryBackend returns an initialized Backend.
NewNoPrioritySampler returns an initialized Sampler dedicated to traces with no priority set.
NewPrioritySampler returns an initialized Sampler.
SampleByRate tells if a trace (from its ID) with a given rate should be sampled Use Knuth multiplicative hashing to leverage imbalanced traceID generators.
SetClientRate sets the rate at which the trace this span belongs to was sampled by the tracer.
SetEventExtractionRate sets the rate at which the trace from which we extracted this event was sampled at the tracer.
SetMaxEPSRate sets the rate at which this event was sampled by the max eps event sampler.
SetPreSampleRate sets the rate at which the trace this span belongs to was sampled by the agent's presampler.
SetSamplingPriority sets the sampling priority value on this span, overwriting any previously set value.
# Constants
ErrorsScoreEngineType is the type of the ScoreEngine sampling error traces.
KeyErrorType is the key of the error type in the meta map.
KeyHTTPStatusCode is the key of the http status code in the meta map.
KeySamplingPriority is the key of the sampling priority value in the metrics map of the root span.
KeySamplingRateClient is a metric key holding the client-set sampling rate for APM events.
KeySamplingRateEventExtraction is the key of the metric storing the event extraction rate on an APM event.
KeySamplingRateGlobal is a metric key holding the global sampling rate.
KeySamplingRateMaxEPSSampler is the key of the metric storing the max eps sampler rate on an APM event.
KeySamplingRatePreSampler is a metric key holding the API rate limiter's rate for APM events.
NormalScoreEngineType is the type of the ScoreEngine sampling non-error traces.
PriorityAutoDrop is the value set by a tracer to suggest dropping a trace.
PriorityAutoKeep is the value set by a tracer to suggest keeping a trace.
PriorityEngineType is type of the priority sampler engine type.
PriorityNone is the value for SamplingPriority when no priority sampling decision could be found.
PriorityUserDrop is the value set by a user to explicitly drop a trace.
PriorityUserKeep is the value set by a user to explicitly keep a trace.
# Structs
DynamicConfig contains configuration items which may change dynamically over time.
ErrorsSampler is dedicated to catching traces containing spans with errors.
ExceptionSampler samples traces that are not caught by the Priority sampler.
MemoryBackend storing any state required to run the sampling algorithms.
NoPrioritySampler is dedicated to catching traces with no priority set.
PrioritySampler computes priority rates per env, service to apply in a feedback loop with trace-agent clients.
RateByService stores the sampling rate per service.
RemoteRates computes rates per (env, service) to apply in trace-agent clients.
Sampler is the main component of the sampling logic.
ScoreSampler samples pieces of traces by computing a signature based on spans (service, name, rsc, http.status, error.type) scoring it and applying a rate.
ServiceSignature represents a unique way to identify a service.
# Type aliases
EngineType represents the type of a sampler engine.
SamplingPriority is the type encoding a priority sampling decision.
Signature is a hash representation of trace or a service, used to identify simlar signatures.