2017-10-24 20:49:30 +00:00
# OpenTracing
2017-10-13 13:55:03 +00:00
2017-10-24 20:49:30 +00:00
Using the third party module [opentracing-contrib/nginx-opentracing ](https://github.com/opentracing-contrib/nginx-opentracing ) the NGINX ingress controller can configure NGINX to enable [OpenTracing ](http://opentracing.io ) instrumentation.
2017-10-13 13:55:03 +00:00
By default this feature is disabled.
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.
2017-10-24 20:49:30 +00:00
In the [rnburn/zipkin-date-server ](https://github.com/rnburn/zipkin-date-server )
github repository is an example of a dockerized date service. To install the example and zipkin collector run:
2017-10-13 13:55:03 +00:00
```
2017-10-24 20:49:30 +00:00
kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/zipkin.yaml
kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/deployment.yaml
2017-10-13 13:55:03 +00:00
```
Also we need to configure the NGINX controller configmap with the required values:
2017-10-24 20:49:30 +00:00
```
$ echo '
2017-10-13 13:55:03 +00:00
apiVersion: v1
2017-10-24 20:49:30 +00:00
kind: ConfigMap
2017-10-13 13:55:03 +00:00
data:
enable-opentracing: "true"
zipkin-collector-host: zipkin.default.svc.cluster.local
metadata:
2017-10-24 20:49:30 +00:00
name: nginx-configuration
namespace: ingress-nginx
2017-10-13 13:55:03 +00:00
labels:
2017-10-24 20:49:30 +00:00
app: ingress-nginx
' | kubectl replace -f -
2017-10-13 13:55:03 +00:00
```
Using curl we can generate some traces:
```console
2017-10-24 20:49:30 +00:00
$ curl -v http://$(minikube ip)
$ curl -v http://$(minikube ip)
2017-10-13 13:55:03 +00:00
```
2017-11-19 17:25:50 +00:00
In the zipkin interface we can see the details:
2017-10-13 13:55:03 +00:00
