Merge pull request #4491 from containers/dependabot/go_modules/github.com/uber/jaeger-client-go-2.20.1+incompatible

build(deps): bump github.com/uber/jaeger-client-go from 2.20.0+incompatible to 2.20.1+incompatible
This commit is contained in:
OpenShift Merge Robot 2019-12-12 16:23:50 +01:00 committed by GitHub
commit 16de498f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 71 additions and 35 deletions

2
go.mod
View File

@ -59,7 +59,7 @@ require (
github.com/stretchr/testify v1.4.0 github.com/stretchr/testify v1.4.0
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
github.com/uber-go/atomic v1.4.0 // indirect github.com/uber-go/atomic v1.4.0 // indirect
github.com/uber/jaeger-client-go v2.20.0+incompatible github.com/uber/jaeger-client-go v2.20.1+incompatible
github.com/uber/jaeger-lib v0.0.0-20190122222657-d036253de8f5 // indirect github.com/uber/jaeger-lib v0.0.0-20190122222657-d036253de8f5 // indirect
github.com/varlink/go v0.0.0-20190502142041-0f1d566d194b github.com/varlink/go v0.0.0-20190502142041-0f1d566d194b
github.com/vishvananda/netlink v1.0.0 github.com/vishvananda/netlink v1.0.0

2
go.sum
View File

@ -466,6 +466,8 @@ github.com/uber/jaeger-client-go v2.19.0+incompatible h1:pbwbYfHUoaase0oPQOdZ1Gc
github.com/uber/jaeger-client-go v2.19.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.19.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.20.0+incompatible h1:ttG9wKdl2ikV/BGOtu+eb+VPp+R7jMeuM177Ihs5Fdc= github.com/uber/jaeger-client-go v2.20.0+incompatible h1:ttG9wKdl2ikV/BGOtu+eb+VPp+R7jMeuM177Ihs5Fdc=
github.com/uber/jaeger-client-go v2.20.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.20.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.20.1+incompatible h1:HgqpYBng0n7tLJIlyT4kPCIv5XgCsF+kai1NnnrJzEU=
github.com/uber/jaeger-client-go v2.20.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v0.0.0-20190122222657-d036253de8f5 h1:CwmGyzHTzCqCdZJkWR0A7ucZXgrCY7spRcpvm7ci//s= github.com/uber/jaeger-lib v0.0.0-20190122222657-d036253de8f5 h1:CwmGyzHTzCqCdZJkWR0A7ucZXgrCY7spRcpvm7ci//s=
github.com/uber/jaeger-lib v0.0.0-20190122222657-d036253de8f5/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/uber/jaeger-lib v0.0.0-20190122222657-d036253de8f5/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=

View File

@ -1,6 +1,16 @@
Changes by Version Changes by Version
================== ==================
2.20.1 (2019-11-08)
-------------------
Minor patch via https://github.com/jaegertracing/jaeger-client-go/pull/468
- Make `AdaptiveSamplerUpdater` usable with default values; Resolves #467
- Create `OperationNameLateBinding` sampler option and config option
- Make `SamplerOptions` var of public type, so that its functions are discoverable via godoc
2.20.0 (2019-11-06) 2.20.0 (2019-11-06)
------------------- -------------------

View File

@ -76,17 +76,26 @@ type SamplerConfig struct {
// Can be set by exporting an environment variable named JAEGER_SAMPLER_MANAGER_HOST_PORT // Can be set by exporting an environment variable named JAEGER_SAMPLER_MANAGER_HOST_PORT
SamplingServerURL string `yaml:"samplingServerURL"` SamplingServerURL string `yaml:"samplingServerURL"`
// MaxOperations is the maximum number of operations that the sampler
// will keep track of. If an operation is not tracked, a default probabilistic
// sampler will be used rather than the per operation specific sampler.
// Can be set by exporting an environment variable named JAEGER_SAMPLER_MAX_OPERATIONS
MaxOperations int `yaml:"maxOperations"`
// SamplingRefreshInterval controls how often the remotely controlled sampler will poll // SamplingRefreshInterval controls how often the remotely controlled sampler will poll
// jaeger-agent for the appropriate sampling strategy. // jaeger-agent for the appropriate sampling strategy.
// Can be set by exporting an environment variable named JAEGER_SAMPLER_REFRESH_INTERVAL // Can be set by exporting an environment variable named JAEGER_SAMPLER_REFRESH_INTERVAL
SamplingRefreshInterval time.Duration `yaml:"samplingRefreshInterval"` SamplingRefreshInterval time.Duration `yaml:"samplingRefreshInterval"`
// MaxOperations is the maximum number of operations that the PerOperationSampler
// will keep track of. If an operation is not tracked, a default probabilistic
// sampler will be used rather than the per operation specific sampler.
// Can be set by exporting an environment variable named JAEGER_SAMPLER_MAX_OPERATIONS.
MaxOperations int `yaml:"maxOperations"`
// Opt-in feature for applications that require late binding of span name via explicit
// call to SetOperationName when using PerOperationSampler. When this feature is enabled,
// the sampler will return retryable=true from OnCreateSpan(), thus leaving the sampling
// decision as non-final (and the span as writeable). This may lead to degraded performance
// in applications that always provide the correct span name on trace creation.
//
// For backwards compatibility this option is off by default.
OperationNameLateBinding bool `yaml:"operationNameLateBinding"`
// Options can be used to programmatically pass additional options to the Remote sampler. // Options can be used to programmatically pass additional options to the Remote sampler.
Options []jaeger.SamplerOption Options []jaeger.SamplerOption
} }
@ -335,7 +344,7 @@ func (sc *SamplerConfig) NewSampler(
return jaeger.NewProbabilisticSampler(sc.Param) return jaeger.NewProbabilisticSampler(sc.Param)
} }
return nil, fmt.Errorf( return nil, fmt.Errorf(
"Invalid Param for probabilistic sampler: %v. Expecting value between 0 and 1", "invalid Param for probabilistic sampler; expecting value between 0 and 1, received %v",
sc.Param, sc.Param,
) )
} }
@ -353,17 +362,14 @@ func (sc *SamplerConfig) NewSampler(
jaeger.SamplerOptions.Metrics(metrics), jaeger.SamplerOptions.Metrics(metrics),
jaeger.SamplerOptions.InitialSampler(initSampler), jaeger.SamplerOptions.InitialSampler(initSampler),
jaeger.SamplerOptions.SamplingServerURL(sc.SamplingServerURL), jaeger.SamplerOptions.SamplingServerURL(sc.SamplingServerURL),
} jaeger.SamplerOptions.MaxOperations(sc.MaxOperations),
if sc.MaxOperations != 0 { jaeger.SamplerOptions.OperationNameLateBinding(sc.OperationNameLateBinding),
options = append(options, jaeger.SamplerOptions.MaxOperations(sc.MaxOperations)) jaeger.SamplerOptions.SamplingRefreshInterval(sc.SamplingRefreshInterval),
}
if sc.SamplingRefreshInterval != 0 {
options = append(options, jaeger.SamplerOptions.SamplingRefreshInterval(sc.SamplingRefreshInterval))
} }
options = append(options, sc.Options...) options = append(options, sc.Options...)
return jaeger.NewRemotelyControlledSampler(serviceName, options...), nil return jaeger.NewRemotelyControlledSampler(serviceName, options...), nil
} }
return nil, fmt.Errorf("Unknown sampler type %v", sc.Type) return nil, fmt.Errorf("unknown sampler type (%s)", sc.Type)
} }
// NewReporter instantiates a new reporter that submits spans to the collector // NewReporter instantiates a new reporter that submits spans to the collector

View File

@ -22,7 +22,7 @@ import (
const ( const (
// JaegerClientVersion is the version of the client library reported as Span tag. // JaegerClientVersion is the version of the client library reported as Span tag.
JaegerClientVersion = "Go-2.20.0" JaegerClientVersion = "Go-2.20.1"
// JaegerClientVersionTagKey is the name of the tag used to report client version. // JaegerClientVersionTagKey is the name of the tag used to report client version.
JaegerClientVersionTagKey = "jaeger.version" JaegerClientVersionTagKey = "jaeger.version"

View File

@ -363,6 +363,9 @@ type PerOperationSamplerParams struct {
// NewPerOperationSampler returns a new PerOperationSampler. // NewPerOperationSampler returns a new PerOperationSampler.
func NewPerOperationSampler(params PerOperationSamplerParams) *PerOperationSampler { func NewPerOperationSampler(params PerOperationSamplerParams) *PerOperationSampler {
if params.MaxOperations <= 0 {
params.MaxOperations = defaultMaxOperations
}
samplers := make(map[string]*GuaranteedThroughputProbabilisticSampler) samplers := make(map[string]*GuaranteedThroughputProbabilisticSampler)
for _, strategy := range params.Strategies.PerOperationStrategies { for _, strategy := range params.Strategies.PerOperationStrategies {
sampler := newGuaranteedThroughputProbabilisticSampler( sampler := newGuaranteedThroughputProbabilisticSampler(

View File

@ -258,8 +258,9 @@ func (u *RateLimitingSamplerUpdater) Update(sampler SamplerV2, strategy interfac
// ----------------------- // -----------------------
// AdaptiveSamplerUpdater is used by RemotelyControlledSampler to parse sampling configuration. // AdaptiveSamplerUpdater is used by RemotelyControlledSampler to parse sampling configuration.
// Fields have the same meaning as in PerOperationSamplerParams.
type AdaptiveSamplerUpdater struct { type AdaptiveSamplerUpdater struct {
MaxOperations int // required MaxOperations int
OperationNameLateBinding bool OperationNameLateBinding bool
} }

View File

@ -23,12 +23,17 @@ import (
// SamplerOption is a function that sets some option on the sampler // SamplerOption is a function that sets some option on the sampler
type SamplerOption func(options *samplerOptions) type SamplerOption func(options *samplerOptions)
// SamplerOptions is a factory for all available SamplerOption's // SamplerOptions is a factory for all available SamplerOption's.
var SamplerOptions samplerOptions var SamplerOptions SamplerOptionsFactory
// SamplerOptionsFactory is a factory for all available SamplerOption's.
// The type acts as a namespace for factory functions. It is public to
// make the functions discoverable via godoc. Recommended to be used
// via global SamplerOptions variable.
type SamplerOptionsFactory struct{}
type samplerOptions struct { type samplerOptions struct {
metrics *Metrics metrics *Metrics
maxOperations int
sampler SamplerV2 sampler SamplerV2
logger Logger logger Logger
samplingServerURL string samplingServerURL string
@ -36,11 +41,12 @@ type samplerOptions struct {
samplingFetcher SamplingStrategyFetcher samplingFetcher SamplingStrategyFetcher
samplingParser SamplingStrategyParser samplingParser SamplingStrategyParser
updaters []SamplerUpdater updaters []SamplerUpdater
posParams PerOperationSamplerParams
} }
// Metrics creates a SamplerOption that initializes Metrics on the sampler, // Metrics creates a SamplerOption that initializes Metrics on the sampler,
// which is used to emit statistics. // which is used to emit statistics.
func (samplerOptions) Metrics(m *Metrics) SamplerOption { func (SamplerOptionsFactory) Metrics(m *Metrics) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.metrics = m o.metrics = m
} }
@ -48,22 +54,30 @@ func (samplerOptions) Metrics(m *Metrics) SamplerOption {
// MaxOperations creates a SamplerOption that sets the maximum number of // MaxOperations creates a SamplerOption that sets the maximum number of
// operations the sampler will keep track of. // operations the sampler will keep track of.
func (samplerOptions) MaxOperations(maxOperations int) SamplerOption { func (SamplerOptionsFactory) MaxOperations(maxOperations int) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.maxOperations = maxOperations o.posParams.MaxOperations = maxOperations
}
}
// OperationNameLateBinding creates a SamplerOption that sets the respective
// field in the PerOperationSamplerParams.
func (SamplerOptionsFactory) OperationNameLateBinding(enable bool) SamplerOption {
return func(o *samplerOptions) {
o.posParams.OperationNameLateBinding = enable
} }
} }
// InitialSampler creates a SamplerOption that sets the initial sampler // InitialSampler creates a SamplerOption that sets the initial sampler
// to use before a remote sampler is created and used. // to use before a remote sampler is created and used.
func (samplerOptions) InitialSampler(sampler Sampler) SamplerOption { func (SamplerOptionsFactory) InitialSampler(sampler Sampler) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.sampler = samplerV1toV2(sampler) o.sampler = samplerV1toV2(sampler)
} }
} }
// Logger creates a SamplerOption that sets the logger used by the sampler. // Logger creates a SamplerOption that sets the logger used by the sampler.
func (samplerOptions) Logger(logger Logger) SamplerOption { func (SamplerOptionsFactory) Logger(logger Logger) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.logger = logger o.logger = logger
} }
@ -71,7 +85,7 @@ func (samplerOptions) Logger(logger Logger) SamplerOption {
// SamplingServerURL creates a SamplerOption that sets the sampling server url // SamplingServerURL creates a SamplerOption that sets the sampling server url
// of the local agent that contains the sampling strategies. // of the local agent that contains the sampling strategies.
func (samplerOptions) SamplingServerURL(samplingServerURL string) SamplerOption { func (SamplerOptionsFactory) SamplingServerURL(samplingServerURL string) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.samplingServerURL = samplingServerURL o.samplingServerURL = samplingServerURL
} }
@ -79,28 +93,28 @@ func (samplerOptions) SamplingServerURL(samplingServerURL string) SamplerOption
// SamplingRefreshInterval creates a SamplerOption that sets how often the // SamplingRefreshInterval creates a SamplerOption that sets how often the
// sampler will poll local agent for the appropriate sampling strategy. // sampler will poll local agent for the appropriate sampling strategy.
func (samplerOptions) SamplingRefreshInterval(samplingRefreshInterval time.Duration) SamplerOption { func (SamplerOptionsFactory) SamplingRefreshInterval(samplingRefreshInterval time.Duration) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.samplingRefreshInterval = samplingRefreshInterval o.samplingRefreshInterval = samplingRefreshInterval
} }
} }
// SamplingStrategyFetcher creates a SamplerOption that initializes sampling strategy fetcher. // SamplingStrategyFetcher creates a SamplerOption that initializes sampling strategy fetcher.
func (samplerOptions) SamplingStrategyFetcher(fetcher SamplingStrategyFetcher) SamplerOption { func (SamplerOptionsFactory) SamplingStrategyFetcher(fetcher SamplingStrategyFetcher) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.samplingFetcher = fetcher o.samplingFetcher = fetcher
} }
} }
// SamplingStrategyParser creates a SamplerOption that initializes sampling strategy parser. // SamplingStrategyParser creates a SamplerOption that initializes sampling strategy parser.
func (samplerOptions) SamplingStrategyParser(parser SamplingStrategyParser) SamplerOption { func (SamplerOptionsFactory) SamplingStrategyParser(parser SamplingStrategyParser) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.samplingParser = parser o.samplingParser = parser
} }
} }
// Updaters creates a SamplerOption that initializes sampler updaters. // Updaters creates a SamplerOption that initializes sampler updaters.
func (samplerOptions) Updaters(updaters ...SamplerUpdater) SamplerOption { func (SamplerOptionsFactory) Updaters(updaters ...SamplerUpdater) SamplerOption {
return func(o *samplerOptions) { return func(o *samplerOptions) {
o.updaters = updaters o.updaters = updaters
} }
@ -116,9 +130,6 @@ func (o *samplerOptions) applyOptionsAndDefaults(opts ...SamplerOption) *sampler
if o.logger == nil { if o.logger == nil {
o.logger = log.NullLogger o.logger = log.NullLogger
} }
if o.maxOperations <= 0 {
o.maxOperations = defaultMaxOperations
}
if o.samplingServerURL == "" { if o.samplingServerURL == "" {
o.samplingServerURL = DefaultSamplingServerURL o.samplingServerURL = DefaultSamplingServerURL
} }
@ -139,7 +150,10 @@ func (o *samplerOptions) applyOptionsAndDefaults(opts ...SamplerOption) *sampler
} }
if o.updaters == nil { if o.updaters == nil {
o.updaters = []SamplerUpdater{ o.updaters = []SamplerUpdater{
&AdaptiveSamplerUpdater{MaxOperations: o.maxOperations}, &AdaptiveSamplerUpdater{
MaxOperations: o.posParams.MaxOperations,
OperationNameLateBinding: o.posParams.OperationNameLateBinding,
},
new(ProbabilisticSamplerUpdater), new(ProbabilisticSamplerUpdater),
new(RateLimitingSamplerUpdater), new(RateLimitingSamplerUpdater),
} }

2
vendor/modules.txt vendored
View File

@ -451,7 +451,7 @@ github.com/stretchr/testify/require
github.com/syndtr/gocapability/capability github.com/syndtr/gocapability/capability
# github.com/tchap/go-patricia v2.3.0+incompatible # github.com/tchap/go-patricia v2.3.0+incompatible
github.com/tchap/go-patricia/patricia github.com/tchap/go-patricia/patricia
# github.com/uber/jaeger-client-go v2.20.0+incompatible # github.com/uber/jaeger-client-go v2.20.1+incompatible
github.com/uber/jaeger-client-go github.com/uber/jaeger-client-go
github.com/uber/jaeger-client-go/config github.com/uber/jaeger-client-go/config
github.com/uber/jaeger-client-go/internal/baggage github.com/uber/jaeger-client-go/internal/baggage