Documentation
¶
Index ¶
Constants ¶
View Source
const ( SamplerTypeRemote = "remote" SamplerTypeProbabilistic = "probabilistic" SamplerTypeConstant = "const" SamplerTypeRateLimiting = "ratelimiting" )
Variables ¶
This section is empty.
Functions ¶
func NewTracerProvider ¶
func NewTracerProvider(ctx context.Context, logger log.Logger, conf []byte) (*tracesdk.TracerProvider, error)
NewTracerProvider returns a new instance of an OpenTelemetry tracer provider.
Types ¶
type Config ¶
type Config struct {
ServiceName string `yaml:"service_name"`
Disabled bool `yaml:"disabled"`
RPCMetrics bool `yaml:"rpc_metrics"`
Tags string `yaml:"tags"`
SamplerType string `yaml:"sampler_type"`
SamplerParam float64 `yaml:"sampler_param"`
SamplerManagerHostPort string `yaml:"sampler_manager_host_port"`
SamplerMaxOperations int `yaml:"sampler_max_operations"`
SamplerRefreshInterval time.Duration `yaml:"sampler_refresh_interval"`
SamplerParentConfig ParentBasedSamplerConfig `yaml:"sampler_parent_config"`
SamplingServerURL string `yaml:"sampling_server_url"`
OperationNameLateBinding bool `yaml:"operation_name_late_binding"`
InitialSamplingRate float64 `yaml:"initial_sampler_rate"`
ReporterMaxQueueSize int `yaml:"reporter_max_queue_size"`
ReporterFlushInterval time.Duration `yaml:"reporter_flush_interval"`
ReporterLogSpans bool `yaml:"reporter_log_spans"`
ReporterDisableAttemptReconnecting bool `yaml:"reporter_disable_attempt_reconnecting"`
ReporterAttemptReconnectInterval time.Duration `yaml:"reporter_attempt_reconnect_interval"`
Endpoint string `yaml:"endpoint"`
User string `yaml:"user"`
Password string `yaml:"password"`
AgentHost string `yaml:"agent_host"`
AgentPort int `yaml:"agent_port"`
Gen128Bit bool `yaml:"traceid_128bit"`
}
Config - YAML configuration. For details see to https://github.com/jaegertracing/jaeger-client-go#environment-variables.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(creditsPerSecond, maxBalance float64) *RateLimiter
NewRateLimiter creates a new RateLimiter.
func (*RateLimiter) CheckCredit ¶
func (rl *RateLimiter) CheckCredit(itemCost float64) bool
CheckCredit tries to reduce the current balance by itemCost provided that the current balance is not lest than itemCost.
func (*RateLimiter) Update ¶
func (rl *RateLimiter) Update(creditsPerSecond, maxBalance float64)
Update changes the main parameters of the rate limiter in-place, while retaining the current accumulated balance (pro-rated to the new maxBalance value). Using this method instead of creating a new rate limiter helps to avoid thundering herd when sampling strategies are updated.
Click to show internal directories.
Click to hide internal directories.