Skip to content

Commit 34394f1

Browse files
committed
Opentracing docs
1 parent cb77efe commit 34394f1

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

controllers/nginx/README.md

+39
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This is an nginx Ingress controller that uses [ConfigMap](https://kubernetes.io/
1717
* [TCP Services](#exposing-tcp-services)
1818
* [UDP Services](#exposing-udp-services)
1919
* [Proxy Protocol](#proxy-protocol)
20+
* [Opentracing](#opentracing)
2021
* [NGINX customization](configuration.md)
2122
* [Custom errors](#custom-errors)
2223
* [NGINX status page](#nginx-status-page)
@@ -378,6 +379,44 @@ Amongst others [ELBs in AWS](http://docs.aws.amazon.com/ElasticLoadBalancing/lat
378379

379380
Please check the [proxy-protocol](examples/proxy-protocol/) example
380381

382+
### Opentracing
383+
384+
Using the third party module [rnburn/nginx-opentracing](https://github.com/rnburn/nginx-opentracing) the NGINX ingress controller can configure NGINX to enable [OpenTracing](http://opentracing.io) instrumentation.
385+
By default this feature is disabled.
386+
387+
To enable the instrumentation we just need to enable the instrumentation in the configuration configmap and set the host where we should send the traces.
388+
389+
In the [aledbf/zipkin-js-example](https://github.com/aledbf/zipkin-js-example) github repository is possible to see a dockerized version of zipkin-js-example with the required Kubernetes descriptors.
390+
To install the example and the zipkin collector we just need to run:
391+
392+
```
393+
$ kubectl create -f https://raw.githubusercontent.com/aledbf/zipkin-js-example/kubernetes/kubernetes/zipkin.yaml
394+
$ kubectl create -f https://raw.githubusercontent.com/aledbf/zipkin-js-example/kubernetes/kubernetes/deployment.yaml
395+
```
396+
397+
Also we need to configure the NGINX controller configmap with the required values:
398+
399+
```
400+
apiVersion: v1
401+
data:
402+
enable-opentracing: "true"
403+
zipkin-collector-host: zipkin.default.svc.cluster.local
404+
kind: ConfigMap
405+
metadata:
406+
labels:
407+
k8s-app: nginx-ingress-controller
408+
name: nginx-custom-configuration
409+
```
410+
411+
Using curl we can generate some traces:
412+
```
413+
$ curl -v http://$(minikube ip)/api -H 'Host: zipkin-js-example'
414+
$ curl -v http://$(minikube ip)/api -H 'Host: zipkin-js-example'
415+
```
416+
417+
In the zipkin inteface we can see the details:
418+
419+
![zipkin screenshot](docs/images/zipkin-demo.png "zipkin collector screenshot")
381420

382421
### Custom errors
383422

controllers/nginx/configuration.md

+11
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,17 @@ The default mime type list to compress is: `application/atom+xml application/jav
487487

488488
**bind-address:** Sets the addresses on which the server will accept requests instead of *. It should be noted that these addresses must exist in the runtime environment or the controller will crash loop.
489489

490+
**enable-opentracing:** enables the nginx Opentracing extension https://github.com/rnburn/nginx-opentracing
491+
Default is "false"
492+
493+
**zipkin-collector-host:** specifies the host to use when uploading traces. It must be a valid URL
494+
495+
**zipkin-collector-port:** specifies the port to use when uploading traces
496+
Default: 9411
497+
498+
**zipkin-service-name:** specifies the service name to use for any traces created
499+
Default: nginx
500+
490501
### Default configuration options
491502

492503
The following table shows the options, the default value and a description.
18 KB
Loading

0 commit comments

Comments
 (0)