Installing Subtrace on Kubernetes
Monitor requests in your Kubernetes clusters, pods and deployments with Subtrace.
If you use a Kubernetes cluster and you need to monitor your app’s requests in production, Subtrace is a great fit.
Start by making the following change to your Dockerfile
to install Subtrace
in your app’s Docker image:
Build and push the new Docker image just like you used to before changing your
Dockerfile to install Subtrace. Then update your Kubernetes pod spec to point
to the new image. Here is an example deployment.yaml
for reference:
Make sure the container has the SUBTRACE_TOKEN
environment variable in your
deployment YAML. Typically, this is done with a Kubernetes secret, but if your
app uses an external secret manager, consult its documentation. If you don’t
have a Subtrace token yet, go to the Tokens page on the
dashboard to create one.
Don’t forget to set the securityContext
field in the container spec. Subtrace
needs the SYS_PTRACE
capability in order to trace your app’s requests.
Finish by applying your changes to the cluster:
And that’s it! Send a HTTP request to the Kubernetes service corresponding to this deployment and you should see it automatically appear in the Subtrace dashboard.