Merge pull request #4105 from reynaldiwijaya/master

UPT: Add variable to define custom sampler host and port
This commit is contained in:
Kubernetes Prow Robot 2019-05-21 05:56:45 -07:00 committed by GitHub
commit 9ee0b5a795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 1 deletions

View file

@ -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.

View file

@ -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

View file

@ -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",

View file

@ -1044,7 +1044,8 @@ const jaegerTmpl = `{
"service_name": "{{ .JaegerServiceName }}",
"sampler": {
"type": "{{ .JaegerSamplerType }}",
"param": {{ .JaegerSamplerParam }}
"param": {{ .JaegerSamplerParam }},
"samplingServerURL": "{{ .JaegerSamplerHost }}:{{ .JaegerSamplerPort }}/sampling"
},
"reporter": {
"localAgentHostPort": "{{ .JaegerCollectorHost }}:{{ .JaegerCollectorPort }}"