xray

package module
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

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

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

Deprecated: Use Version instead.

func Version

func Version() string

Version is the current release version of the AWS XRay remote sampler.

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

func WithEndpoint(endpoint url.URL) Option

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

func WithLogger(l logr.Logger) Option

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

func WithSamplingRulesPollingInterval(polingInterval time.Duration) Option

WithSamplingRulesPollingInterval sets polling interval for sampling rules. If this option is not provided the default samplingRulesPollingInterval used will be 300 seconds.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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