Skip to content

Commit

Permalink
Merge pull request #2719 from gugu/master
Browse files Browse the repository at this point in the history
Sample rate configmap option for zipkin in nginx-opentracing
  • Loading branch information
k8s-ci-robot authored Jun 28, 2018
2 parents 29c5d77 + bc53d1e commit 6e68be3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/user-guide/nginx-configuration/configmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The following table shows a configuration option's name, type, and the default v
|[zipkin-collector-host](#zipkin-collector-host)|string|""|
|[zipkin-collector-port](#zipkin-collector-port)|int|9411|
|[zipkin-service-name](#zipkin-service-name)|string|"nginx"|
|[zipkin-sample-rate](#zipkin-sample-rate)|float|1.0|
|[jaeger-collector-host](#jaeger-collector-host)|string|""|
|[jaeger-collector-port](#jaeger-collector-port)|int|6831|
|[jaeger-service-name](#jaeger-service-name)|string|"nginx"|
Expand Down Expand Up @@ -601,6 +602,10 @@ Specifies the port to use when uploading traces. _**default:**_ 9411

Specifies the service name to use for any traces created. _**default:**_ nginx

## zipkin-sample-rate

Specifies sample rate for any traces created. _**default:**_ 1.0

## jaeger-collector-host

Specifies the host to use when uploading traces. It must be a valid URL.
Expand Down
3 changes: 3 additions & 0 deletions docs/user-guide/third-party-addons/opentracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ zipkin-collector-port
# specifies the service name to use for any traces created, Default: nginx
zipkin-service-name
# specifies sample rate for any traces created. Default: 1.0
zipkin-sample-rate
# specifies the port to use when uploading traces
jaeger-collector-port
Expand Down
5 changes: 5 additions & 0 deletions internal/ingress/controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ type Configuration struct {
// Default: nginx
ZipkinServiceName string `json:"zipkin-service-name"`

// ZipkinSampleRate specifies sampling rate for traces
// Default: 1.0
ZipkinSampleRate float32 `json:"zipkin-sample-rate"`

// JaegerCollectorHost specifies the host to use when uploading traces
JaegerCollectorHost string `json:"jaeger-collector-host"`

Expand Down Expand Up @@ -612,6 +616,7 @@ func NewDefault() Configuration {
BindAddressIpv6: defBindAddress,
ZipkinCollectorPort: 9411,
ZipkinServiceName: "nginx",
ZipkinSampleRate: 1.0,
JaegerCollectorPort: 6831,
JaegerServiceName: "nginx",
JaegerSamplerType: "const",
Expand Down
3 changes: 2 additions & 1 deletion internal/ingress/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ func configureDynamically(pcfg *ingress.Configuration, port int) error {
const zipkinTmpl = `{
"service_name": "{{ .ZipkinServiceName }}",
"collector_host": "{{ .ZipkinCollectorHost }}",
"collector_port": {{ .ZipkinCollectorPort }}
"collector_port": {{ .ZipkinCollectorPort }},
"sample_rate": {{ .ZipkinSampleRate }}
}`

const jaegerTmpl = `{
Expand Down

0 comments on commit 6e68be3

Please sign in to comment.