- Introduce Jaeger and the minimal configuration used in this lab.
- Install Jaeger (all-in-one, in-memory) and KAgent.
- Configure KAgent to export OpenTelemetry (OTEL) traces to Jaeger.
- Generate agent traffic and inspect the traces in the Jaeger UI.
This lesson uses Jaeger in all-in-one (development) mode with in-memory storage. Traces are transient and will be lost if the Jaeger pod restarts.
1. Jaeger configuration (all-in-one, in-memory)
The Helm values below run Jaeger in all-in-one mode with in-memory storage — suitable for development and short-lived labs. Because storage ismemory, traces are not persisted across restarts.
- Jaeger UI (query): port 16686.
- Jaeger collector OTLP: port 4317 (gRPC) and 4318 (HTTP/protobuf). In this lab we point KAgent to the OTLP gRPC endpoint (4317).
2. KAgent values (enable OTEL tracing)
The trimmed KAgent values file below enables a minimal set of agents and configures OTEL tracing to send data to the Jaeger collector via OTLP gRPC. The critical section isotel.tracing.exporter.otlp.endpoint.
3. Patch the KAgent UI service for external (lab) access
In the lab environment we expose the KAgent UI externally by changing the service type toNodePort and mapping port 8080 to node port 30080. The JSON payload contains curly braces and is provided as a code block to avoid MDX parsing issues.
kagent namespace:
kubectl describe and kubectl logs.
4. Generate agent traffic and inspect traces in Jaeger
With KAgent exporting OTEL traces to Jaeger, exercise the agent (for example: list pods, query deployments, or perform model calls via the KAgent UI). These activities generate traces that appear in Jaeger. Steps to inspect traces:- Open the KAgent UI and use the built-in link to the Jaeger UI (or open Jaeger at the cluster-exposed query endpoint).
- In Jaeger:
- Select the
kagentservice (orKAgentdepending on naming). - Filter by operation (e.g.,
openai.chat) and choose an appropriate time range. - Open individual traces to expand spans and view tags.
- Select the
- Services involved and span hierarchy.
- Start timestamps and durations per span.
- Tags containing LLM prompt content and token usage (e.g.,
genai.usage.prompt_tokens). - OTEL instrumentation metadata (e.g.,
otel.library.name,otel.library.version).
genai.usage.prompt_tokens, genai.usage.completion_tokens, etc.) are useful for cost analysis and assessing how much context is being sent to the model.
This lab uses in-memory Jaeger storage. For production systems, do not use in-memory storage — switch to a persistent backend (e.g., Cassandra, Elasticsearch) or a managed OTEL backend to retain traces and ensure availability.
5. Inspect Jaeger services and endpoints
You can validate the services created by the Helm chart to confirm the collector and query endpoints:
If you need details on any specific service or endpoint:
Wrap-up and recommendations
- This lesson demonstrated configuring Jaeger (all-in-one, in-memory) and KAgent to export OTEL traces to Jaeger.
- Use the KAgent UI and Jaeger UI to inspect agent traces, including LLM prompts and token usage for debugging and cost analysis.
- For production:
- Replace in-memory Jaeger storage with a persistent backend (Cassandra, Elasticsearch) or a managed OTEL backend.
- Deploy Jaeger (or OTEL collector) in a highly available configuration.
- Secure OTLP endpoints with TLS and authentication where supported.
Links and references
- Jaeger: https://www.jaegertracing.io/
- OpenTelemetry: https://opentelemetry.io/
- KAgent (KAgent course): https://learn.kodekloud.com/user/courses/kagents-host-your-ai-agents-on-kubernetes
- Jaeger Helm charts: https://jaegertracing.github.io/helm-charts