Setup Distributed Tracing in Grey Matter on Kubernetes
Last updated
Was this helpful?
Last updated
Was this helpful?
An existing Grey Matter deployment.
See if you don't already have a deployment running
kubectl
access to the k8s cluster
The CLI with access to the Fabric mesh.
Install the trace server
Configure a Sidecar to emit traces
Verify traces are collected
For this walkthrough we'll use as the trace backend. For convenience, we'll use their provided all-in-one Docker image. This image provides a simple server and web UI that is useful for small deployments. Larger production deployments should use a more resilient deployment strategy.
We'll launch the server with the configuration below. The Jaeger server is going to be exposed through a k8s service, so it can be directly addressed by all Sidecars, and the trace port is 9411, which we'll need to set on the Sidecar.
Write the above Kubernetes deployment to a file (jaeger.yaml
) and create the resources:
Now that the trace server is up and running, we can configure a service to send out traces for each request. To do this, we do need to restart the Sidecar with new runtime options. This is due to how the Sidecar needs to address the trace server. It must be defined at runtime, and cannot be defined through the service mesh later.
We can setup the sidecar with the traceserver by editing the current deployment:
And adding in the following lines to the Sidecar's environment variables:
After editing the deployment, we're now ready to turn on tracing on the edge Sidecar using the greymatter
cli. Edit the ingress listener for the edge Sidecar:
And add in the following config. This will turn on tracing for all requests that pass through this listener.
At this point everything is setup. Sending more requests through the edge (such as refreshing the browser or calling a service), will trigger a trace to be collected.
We can watch this in the logs of the trace server.
We can also view this in the provided Jaegar UI. To quickly view the UI, port-forward your local shell to the UI port of the Jaegar pod.
Using your browser, navigate to localhost:16686
NOTE: The trace UI can also be setup as a Service in the mesh and routed through the Edge like all other services. See the guide for for a walkthrough on those steps.