From 31ffad8fa161ea7535a2c76658a1f529aa778431 Mon Sep 17 00:00:00 2001 From: "reynaldi.wijaya" Date: Tue, 21 May 2019 11:06:41 +0800 Subject: [PATCH 1/3] UPT: Add variable to define custom sampler host and port, add commituser --- internal/ingress/controller/config/config.go | 10 ++++++++++ internal/ingress/controller/nginx.go | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/ingress/controller/config/config.go b/internal/ingress/controller/config/config.go index f06856406..71ba36fd0 100755 --- a/internal/ingress/controller/config/config.go +++ b/internal/ingress/controller/config/config.go @@ -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", diff --git a/internal/ingress/controller/nginx.go b/internal/ingress/controller/nginx.go index 34c23ad50..fa461d1b5 100755 --- a/internal/ingress/controller/nginx.go +++ b/internal/ingress/controller/nginx.go @@ -1044,7 +1044,8 @@ const jaegerTmpl = `{ "service_name": "{{ .JaegerServiceName }}", "sampler": { "type": "{{ .JaegerSamplerType }}", - "param": {{ .JaegerSamplerParam }} + "param": {{ .JaegerSamplerParam }}, + "samplingServerURL": "{{ .JaegerSamplerHost }}:{{ .JaegerSamplerPort }}/sampling" }, "reporter": { "localAgentHostPort": "{{ .JaegerCollectorHost }}:{{ .JaegerCollectorPort }}" From d468cd5ec5a6bbd10e7348a343481d4656565fbe Mon Sep 17 00:00:00 2001 From: "reynaldi.wijaya" Date: Tue, 21 May 2019 17:54:29 +0800 Subject: [PATCH 2/3] UPT: Modify configmap to include jaeger sampler host and jaeger sampler port --- docs/user-guide/nginx-configuration/configmap.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/user-guide/nginx-configuration/configmap.md b/docs/user-guide/nginx-configuration/configmap.md index 825a03928..19d16f1b4 100755 --- a/docs/user-guide/nginx-configuration/configmap.md +++ b/docs/user-guide/nginx-configuration/configmap.md @@ -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. From 616b1e239a5e8b204258c12c0431c1b6040c2d1f Mon Sep 17 00:00:00 2001 From: "reynaldi.wijaya" Date: Tue, 21 May 2019 18:14:33 +0800 Subject: [PATCH 3/3] UPT: Opentracing configmap documentation --- docs/user-guide/third-party-addons/opentracing.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user-guide/third-party-addons/opentracing.md b/docs/user-guide/third-party-addons/opentracing.md index dc530c2ae..18b41b00c 100644 --- a/docs/user-guide/third-party-addons/opentracing.md +++ b/docs/user-guide/third-party-addons/opentracing.md @@ -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