diff --git a/conf/defaults.ini b/conf/defaults.ini index f685e0cf2ce..8e3c09d78ca 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -706,6 +706,8 @@ sampler_type = const # and indicates the initial sampling rate before the actual one # is received from the mothership sampler_param = 1 +# sampling_server_url is the URL of a sampling manager providing a sampling strategy. +sampling_server_url = # Whether or not to use Zipkin span propagation (x-b3- HTTP headers). zipkin_propagation = false # Setting this to true disables shared RPC spans. diff --git a/conf/sample.ini b/conf/sample.ini index d34edede275..838cb501e6f 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -698,6 +698,8 @@ # and indicates the initial sampling rate before the actual one # is received from the mothership ;sampler_param = 1 +# sampling_server_url is the URL of a sampling manager providing a sampling strategy. +;sampling_server_url = # Whether or not to use Zipkin propagation (x-b3- HTTP headers). ;zipkin_propagation = false # Setting this to true disables shared RPC spans. diff --git a/docs/sources/administration/configuration.md b/docs/sources/administration/configuration.md index 4e2a9b9906a..794e2c43746 100644 --- a/docs/sources/administration/configuration.md +++ b/docs/sources/administration/configuration.md @@ -1154,6 +1154,10 @@ This is the sampler configuration parameter. Depending on the value of `sampler_ May be set with the environment variable `JAEGER_SAMPLER_PARAM`. +### sampling_server_url + +sampling_server_url is the URL of a sampling manager providing a sampling strategy. + ### zipkin_propagation Default value is `false`. diff --git a/pkg/infra/tracing/tracing.go b/pkg/infra/tracing/tracing.go index 923459786b6..249234d17d2 100644 --- a/pkg/infra/tracing/tracing.go +++ b/pkg/infra/tracing/tracing.go @@ -25,6 +25,7 @@ type TracingService struct { customTags map[string]string samplerType string samplerParam float64 + samplingServerURL string log log.Logger closer io.Closer zipkinPropagation bool @@ -60,6 +61,7 @@ func (ts *TracingService) parseSettings() { ts.samplerParam = section.Key("sampler_param").MustFloat64(1) ts.zipkinPropagation = section.Key("zipkin_propagation").MustBool(false) ts.disableSharedZipkinSpans = section.Key("disable_shared_zipkin_spans").MustBool(false) + ts.samplingServerURL = section.Key("sampling_server_url").MustString("") } func (ts *TracingService) initJaegerCfg() (jaegercfg.Configuration, error) { @@ -67,8 +69,9 @@ func (ts *TracingService) initJaegerCfg() (jaegercfg.Configuration, error) { ServiceName: "grafana", Disabled: !ts.enabled, Sampler: &jaegercfg.SamplerConfig{ - Type: ts.samplerType, - Param: ts.samplerParam, + Type: ts.samplerType, + Param: ts.samplerParam, + SamplingServerURL: ts.samplingServerURL, }, Reporter: &jaegercfg.ReporterConfig{ LogSpans: false,