diff --git a/conf/defaults.ini b/conf/defaults.ini index 74ae209ac9a..2098edf40a3 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -705,6 +705,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 23691037135..b1e5ac0a7d5 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -697,6 +697,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 f417b95e5f8..2a1c500ff5f 100644 --- a/docs/sources/administration/configuration.md +++ b/docs/sources/administration/configuration.md @@ -1159,6 +1159,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,