Merge pull request #4105 from reynaldiwijaya/master
UPT: Add variable to define custom sampler host and port
This commit is contained in:
commit
9ee0b5a795
4 changed files with 30 additions and 1 deletions
|
@ -124,6 +124,8 @@ The following table shows a configuration option's name, type, and the default v
|
|||
|[jaeger-service-name](#jaeger-service-name)|string|"nginx"|
|
||||
|[jaeger-sampler-type](#jaeger-sampler-type)|string|"const"|
|
||||
|[jaeger-sampler-param](#jaeger-sampler-param)|string|"1"|
|
||||
|[jaeger-sampler-host](#jaeger-sampler-host)|string|"http://127.0.0.1"|
|
||||
|[jaeger-sampler-port](#jaeger-sampler-port)|int|5778|
|
||||
|[main-snippet](#main-snippet)|string|""|
|
||||
|[http-snippet](#http-snippet)|string|""|
|
||||
|[server-snippet](#server-snippet)|string|""|
|
||||
|
@ -735,6 +737,15 @@ Specifies the sampler to be used when sampling traces. The available samplers ar
|
|||
Specifies the argument to be passed to the sampler constructor. Must be a number.
|
||||
For const this should be 0 to never sample and 1 to always sample. _**default:**_ 1
|
||||
|
||||
## jaeger-sampler-host
|
||||
|
||||
Specifies the custom remote sampler host to be passed to the sampler constructor. Must be a valid URL.
|
||||
Leave blank to use default value (localhost). _**default:**_ http://127.0.0.1
|
||||
|
||||
## jaeger-sampler-port
|
||||
|
||||
Specifies the custom remote sampler port to be passed to the sampler constructor. Must be a number. _**default:**_ 5778
|
||||
|
||||
## main-snippet
|
||||
|
||||
Adds custom configuration to the main section of the nginx configuration.
|
||||
|
|
|
@ -52,6 +52,13 @@ jaeger-sampler-type
|
|||
# specifies the argument to be passed to the sampler constructor, Default: 1
|
||||
jaeger-sampler-param
|
||||
|
||||
# Specifies the custom remote sampler host to be passed to the sampler constructor. Must be a valid URL.
|
||||
# Default: http://127.0.0.1
|
||||
jaeger-sampler-host
|
||||
|
||||
# Specifies the custom remote sampler port to be passed to the sampler constructor. Must be a number. Default: 5778
|
||||
jaeger-sampler-port
|
||||
|
||||
# specifies the port to use when uploading traces, Default 8126
|
||||
datadog-collector-port
|
||||
|
||||
|
|
|
@ -495,6 +495,14 @@ type Configuration struct {
|
|||
// Default: 1
|
||||
JaegerSamplerParam string `json:"jaeger-sampler-param"`
|
||||
|
||||
// JaegerSamplerHost specifies the host used for remote sampling consultation
|
||||
// Default: http://127.0.0.1
|
||||
JaegerSamplerHost string `json:"jaeger-sampler-host"`
|
||||
|
||||
// JaegerSamplerHost specifies the host used for remote sampling consultation
|
||||
// Default: 5778
|
||||
JaegerSamplerPort int `json:"jaeger-sampler-port"`
|
||||
|
||||
// DatadogCollectorHost specifies the datadog agent host to use when uploading traces
|
||||
DatadogCollectorHost string `json:"datadog-collector-host"`
|
||||
|
||||
|
@ -714,6 +722,8 @@ func NewDefault() Configuration {
|
|||
JaegerServiceName: "nginx",
|
||||
JaegerSamplerType: "const",
|
||||
JaegerSamplerParam: "1",
|
||||
JaegerSamplerPort: 5778,
|
||||
JaegerSamplerHost: "http://127.0.0.1",
|
||||
DatadogServiceName: "nginx",
|
||||
DatadogCollectorPort: 8126,
|
||||
DatadogOperationNameOverride: "nginx.handle",
|
||||
|
|
|
@ -1044,7 +1044,8 @@ const jaegerTmpl = `{
|
|||
"service_name": "{{ .JaegerServiceName }}",
|
||||
"sampler": {
|
||||
"type": "{{ .JaegerSamplerType }}",
|
||||
"param": {{ .JaegerSamplerParam }}
|
||||
"param": {{ .JaegerSamplerParam }},
|
||||
"samplingServerURL": "{{ .JaegerSamplerHost }}:{{ .JaegerSamplerPort }}/sampling"
|
||||
},
|
||||
"reporter": {
|
||||
"localAgentHostPort": "{{ .JaegerCollectorHost }}:{{ .JaegerCollectorPort }}"
|
||||
|
|
Loading…
Reference in a new issue