Prerequisites
- kind for creating and running a local Kubernetes cluster
- Helm - for installing the kagent chart
- kubectl - for interacting with your cluster
This guide will walk you through all the steps you need to get started with tracing your kagent agents. However, we recommend starting with the other getting-started guides first to get a better understanding of how kagent works.
To run the AI agents you'll also need an OpenAI API key. You can get one here.
- kubectl - for interacting with your cluster
Installing Jaeger
In order to demonstrate tracing, we'll first need to install Jaeger. We will use the Jaeger all in one mode to demonstrate the tracing capabilities without needing to install any other components.
Firstly create a file called jaeger.yaml
with the following content:
provisionDataStore:cassandra: falseallInOne:enabled: truestorage:type: memoryagent:enabled: falsecollector:enabled: falsequery:enabled: false
Then install Jaeger using the following command:
helm repo add jaegertracing https://jaegertracing.github.io/helm-chartshelm repo updatehelm upgrade --install jaeger jaegertracing/jaeger \--namespace jaeger \--create-namespace \--history-max 3 \--values jaeger.yaml
Installing kagent
- Set the OpenAI API key as an environment variable:
export OPENAI_API_KEY="your-api-key-here"
- Install the Helm chart with CRDs:
helm install kagent-crds oci://ghcr.io/kagent-dev/kagent/helm/kagent-crds \--namespace kagent \--create-namespace \
- Create a file called
kagent-tracing.yaml
with the following content:
otel:tracing:enabled: trueexporter:otlp:endpoint: http://jaeger-collector.jaeger.svc.cluster.local:4317
- Install the kagent Helm chart:
helm install kagent oci://ghcr.io/kagent-dev/kagent/helm/kagent \--namespace kagent \--set providers.openAI.apiKey=$OPENAI_API_KEY \--values kagent-tracing.yaml
Tracing your first agent
Now that we have Jaeger installed and kagent configured to use it, we can start tracing our first agent.
- Download the kagent CLI:
# Download/run the install scriptcurl https://raw.githubusercontent.com/kagent-dev/kagent/refs/heads/main/scripts/get-kagent | bash
Accessing the kagent dashboard (UI)
- To open the kagent dashboard, run the dashboard command from the CLI
kagent dashboard
kagent dashboard is available at http://localhost:8082Press Enter to stop the port-forward...
The CLI will set up the port-forward to the service running inside the cluster and open the dashboard.

Running the k8s-agent
Once you're in the kagent UI, you can start interacting with the pre-configured sample agents. You can click on the agent card to view the agent details and start a conversation. For the purpose of this guide, we'll use the k8s-agent
agent. Specifically we'll use the k8s-agent
agent to get the list of pods in the cluster.
For testing purposes, we'll use the k8s-agent
agent to get the list of pods in the cluster.

Once that query is complete, we can go take a look at the data in Jaeger.
kubectl port-forward svc/jaeger-query -n devops 16686:16686
Once the port-forward is set up, you can open the Jaeger UI in your browser at http://localhost:16686.
From the Jaeger UI, select the kagent
service on the top-left and then hit "search" to see the traces for the k8s-agent
agent.
Specifically the result we're looking for should resemble the following:

Once you've found the trace, you can click on it to see the details.

That's it! You've now traced your first agent.
Next Steps
- Learn about Core Concepts
- Join our Community
Need Help?
- Visit our GitHub repository
- Ask a question on Discord
- Check out the FAQ