Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRemoteSampler ¶
func NewRemoteSampler(ctx context.Context, serviceName string, cloudPlatform string, opts ...Option) (sdktrace.Sampler, error)
NewRemoteSampler returns a sampler which decides to sample a given request or not based on the sampling rules set by users on AWS X-Ray console. Sampler also periodically polls sampling rules and sampling targets. NOTE: ctx passed in NewRemoteSampler API is being used in background go routine. Cancellation to this context can kill the background go routine. serviceName refers to the name of the service equivalent to the one set in the AWS X-Ray console when adding sampling rules and cloudPlatform refers to the cloud platform the service is running on ("ec2", "ecs", "eks", "lambda", etc). Guide on AWS X-Ray remote sampling implementation (https://aws-otel.github.io/docs/getting-started/remote-sampling#otel-remote-sampling-implementation-caveats).
func SemVersion
deprecated
Types ¶
type FallbackSampler ¶
type FallbackSampler struct {
// contains filtered or unexported fields
}
FallbackSampler does the sampling at a rate of 1 req/sec and 5% of additional requests.
func NewFallbackSampler ¶
func NewFallbackSampler() *FallbackSampler
NewFallbackSampler returns a FallbackSampler which samples 1 req/sec and additional 5% of requests using traceIDRatioBasedSampler.
func (*FallbackSampler) Description ¶
func (fs *FallbackSampler) Description() string
Description returns description of the sampler being used.
func (*FallbackSampler) ShouldSample ¶
func (fs *FallbackSampler) ShouldSample(parameters sdktrace.SamplingParameters) sdktrace.SamplingResult
ShouldSample implements the logic of borrowing 1 req/sec and then use traceIDRatioBasedSampler to sample 5% of additional requests.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option sets configuration on the sampler.
func WithEndpoint ¶
WithEndpoint sets custom proxy endpoint. If this option is not provided the default endpoint used will be http://127.0.0.1:2000.
func WithLogger ¶
WithLogger sets custom logging for remote sampling implementation. If this option is not provided the default logger used will be go-logr/stdr (https://github.com/go-logr/stdr).
func WithSamplingRulesPollingInterval ¶
WithSamplingRulesPollingInterval sets polling interval for sampling rules. If this option is not provided the default samplingRulesPollingInterval used will be 300 seconds.