Documentation
¶
Index ¶
- func NewRemoteSampler(ctx context.Context, serviceName string, fraction float64, ...) (sdktrace.Sampler, error)
- func NewTracerProvider(service, host, development string, port int, sampler trace.Sampler) (*trace.TracerProvider, error)
- func SemVersion() string
- func Version() string
- type FallbackSampler
- type Jaeger
- type Option
- type RemoteSamplerOption
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRemoteSampler ¶ added in v0.2.14
func NewRemoteSampler(ctx context.Context, serviceName string, fraction float64, opts ...RemoteSamplerOption) (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.
func NewTracerProvider ¶
func SemVersion ¶
func SemVersion() string
SemVersion is the semantic version to be supplied to tracer/meter creation.
Types ¶
type FallbackSampler ¶ added in v0.2.4
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 ¶ added in v0.2.4
func NewFallbackSampler(fraction float64) *FallbackSampler
NewFallbackSampler returns a FallbackSampler which samples 1 req/sec and additional 5% of requests using traceIDRatioBasedSampler.
func (*FallbackSampler) Description ¶ added in v0.2.4
func (fs *FallbackSampler) Description() string
Description returns description of the sampler being used.
func (*FallbackSampler) ShouldSample ¶ added in v0.2.4
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 Jaeger ¶
type Jaeger struct{}
Jaeger propagator serializes SpanContext to/from Jaeger Headers
Jaeger format:
uber-tracer-id: {tracer-id}:{span-id}:{parent-span-id}:{flags}
func (Jaeger) Extract ¶
func (jaeger Jaeger) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context
Extract extracts a context from the carrier if it contains Jaeger headers.
func (Jaeger) Inject ¶
func (jaeger Jaeger) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
Inject injects a context to the carrier following jaeger format. The parent span ID is set to an dummy parent span id as the most implementations do.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies instrumentation configuration options.
func WithPropagators ¶
func WithPropagators(propagators propagation.TextMapPropagator) Option
WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.
func WithProvider ¶ added in v0.2.1
func WithProvider(provider oteltrace.TracerProvider) Option
WithProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.
type RemoteSamplerOption ¶ added in v0.2.14
type RemoteSamplerOption interface {
// contains filtered or unexported methods
}
RemoteSamplerOption sets configuration on the sampler.
func WithEndpoint ¶ added in v0.2.14
func WithEndpoint(endpoint url.URL) RemoteSamplerOption
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 ¶ added in v0.2.14
func WithLogger(l glog.ILogger) RemoteSamplerOption
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 ¶ added in v0.2.14
func WithSamplingRulesPollingInterval(polingInterval time.Duration) RemoteSamplerOption
WithSamplingRulesPollingInterval sets polling interval for sampling rules. If this option is not provided the default samplingRulesPollingInterval used will be 300 seconds.
type Server ¶
type Server struct {
Tracer oteltrace.Tracer
TracerProvider oteltrace.TracerProvider
Propagators propagation.TextMapPropagator
// contains filtered or unexported fields
}