remote

package
v2.29.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options options

Options is a factory for all available options

Functions

This section is empty.

Types

type Option

type Option func(options *options)

Option is a function that sets some option on the Throttler

type Throttler

type Throttler struct {
	// contains filtered or unexported fields
}

Throttler retrieves credits from agent and uses it to throttle operations.

func NewThrottler

func NewThrottler(service string, options ...Option) *Throttler

NewThrottler returns a Throttler that polls agent for credits and uses them to throttle the service.

func (*Throttler) Close

func (t *Throttler) Close() error

Close stops the throttler from fetching credits from remote.

func (Throttler) HostPort

func (Throttler) HostPort(hostPort string) Option

HostPort creates an Option that sets the hostPort of the local agent that keeps track of credits.

func (*Throttler) IsAllowed

func (t *Throttler) IsAllowed(operation string) bool

IsAllowed implements Throttler#IsAllowed.

func (Throttler) Logger

func (Throttler) Logger(logger jaeger.Logger) Option

Logger creates an Option that sets the logger used by the Throttler.

func (Throttler) Metrics

func (Throttler) Metrics(m *jaeger.Metrics) Option

Metrics creates an Option that initializes Metrics on the Throttler, which is used to emit statistics.

func (Throttler) RefreshInterval

func (Throttler) RefreshInterval(refreshInterval time.Duration) Option

RefreshInterval creates an Option that sets how often the Throttler will poll local agent for credits.

func (*Throttler) SetProcess

func (t *Throttler) SetProcess(process jaeger.Process)

SetProcess implements ProcessSetter#SetProcess. It's imperative that the UUID is set before any remote requests are made.

func (Throttler) SynchronousInitialization

func (Throttler) SynchronousInitialization(b bool) Option

SynchronousInitialization creates an Option that determines whether the throttler should synchronously fetch credits from the agent when an operation is seen for the first time. This should be set to true if the client will be used by a short lived service that needs to ensure that credits are fetched upfront such that sampling or throttling occurs.

Jump to

Keyboard shortcuts

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