End-to-End Experiment Flow
This document traces a single chaos experiment from the moment an operator clicks Run in the UI to the moment the certifier produces a PDF. Every step references the package or manifest that owns it — use this as the “where do I go to debug step N” map.
For the static system architecture see architecture.md; for individual subsystem details, the per-feature docs (registries, fault studio, observability, MCP).
Prerequisites in the platform
Before a single experiment can run, the operator (or a one-shot bootstrap) needs to have:
- Signed in — UI at
https://localhost:2001, JWT issued byauthentication. - Registered an environment — a Kubernetes target. The subscriber pod is installed there via stages 1–4 of the per-namespace manifests (
mcp-infrastructure.mdcovers stage 4 in detail). - Added a ChaosHub pointing at
chaos-charts— faults appear in the Fault Studio. - Added an AgentHub pointing at
agent-charts— agents appear under Agents. - Added an AppHub pointing at
app-charts— apps appear under Applications. - Registered an Agent — see
agent-registry.md. - Registered an App — see
app-registry.md. - Created a Fault Studio — see
fault-studio.md.
After this the operator can create a Benchmark Project or Experiment that binds: an agent + an app + a fault studio + a schedule.
The runtime flow
experiment_run.Status = QUEUED2. Build Argo Workflow from (agent + app + active fault selections)
3. Call
observability.TraceExperimentExecution → Langfuse: new trace, root span open agentcert/agentcert-install-app:latest · helm upgrade --install <chart> -n <ns>agentcert/agentcert-install-agent:latest · sets AGENT_ID, MCP_URLS, OPENAI_BASE_URL, LANGFUSE_* via HelmChaosEngine → ChaosResult.- Scan/watch loop — no fault visibility
- LLM calls: agent → sidecar :4001 → LiteLLM :4000 → Azure/OpenAI
- Sidecar injects
trace_id = NOTIFY_IDon every call - Langfuse receives: root span, child spans per fault, LLM call spans
ChaosEngine. ChaosResult status updates arrive late (deterministic ID upserts in Langfuse).- → GraphQL
Update - →
observability.EmitFaultSpanAtInjection
COMPLETED / FAILEDClearEmittedFaults(traceID) · ClearWorkflowNodeStates(traceID) POST /api/v1/aggregation-certification — reads Langfuse traces for the run, runs Phase 0–3 pipelineThe trace correlation contract
The single trick that makes every layer’s data joinable: one stable trace_id per experiment run, propagated through every component.
| Component | Where the trace_id comes from |
|---|---|
GraphQL server (observability.TraceExperimentExecution) | Generated when experiment_run is created |
| Subscriber callbacks | Carried as part of the gRPC payload |
| ConfigMap mounted into agent pod | Written by the helm bridge as NOTIFY_ID |
agent-sidecar | Reads NOTIFY_ID from the mounted ConfigMap, stamps it as Langfuse trace_id on every outbound LLM call |
| LiteLLM proxy | Forwards the trace_id to Langfuse |
| Certifier | Joins on trace_id to find every span for the run |
Code-cited summary of each step
| Step | Code |
|---|---|
| Create the run row | pkg/chaos_experiment_run/ |
| Build Argo workflow from fault studio + agent + app | pkg/chaos_experiment/ |
| Open Langfuse trace | pkg/observability/langfuse_tracer.go:129 TraceExperimentExecution |
| Dispatch to subscriber | pkg/grpc/ |
| Subscriber runs Argo workflow | chaoscenter/subscriber |
| Stage-1..4 per-namespace install | graphql/server/manifests/namespace/ |
| Install target app | app-charts/install-app image |
| Install agent + sidecar | agent-charts/install-agent image |
Inject trace_id into agent’s LLM calls | agent-sidecar/proxy.py |
| Fault spans (dedup’d) | langfuse_tracer.go:500 EmitFaultSpanAtInjection, langfuse_tracer.go:386 EmitFaultSpansForTrace |
| Close trace | langfuse_tracer.go:216 CompleteExperimentExecution |
| Generate the report | certifier — POST /api/v1/aggregation-certification |
Failure modes & what they look like
| Symptom | Likely cause | Look at |
|---|---|---|
Run stays QUEUED forever | Subscriber unreachable from control plane | pkg/chaos_infrastructure connection state |
install-app Argo step fails | Bad chart name in App registration or missing chart in AppHub git URL | app-registry.md + pkg/apphub |
install-agent step fails | Image pull / Helm timeout / kubeconfig | agent-registry.md — helm bridge section |
Agent boots but Status stays VALIDATING | Health probe failing — wrong HealthPath, wrong port, app not actually serving readiness | agent-registry.md — health scheduler section |
| No Langfuse spans for the run | Tracer disabled (IsEnabled() == false) — missing LANGFUSE_HOST env | observability.md |
| Spans show up but agent calls are missing | agent-sidecar not wired (OPENAI_BASE_URL points at LiteLLM directly instead of the sidecar) | ../../agent-sidecar/README.md |
| Duplicate fault spans | emittedFaults dedup cache reset / signature collision — unlikely | observability.md — dedup section |
Related docs
architecture.md— static component mapagent-registry.md,app-registry.md,fault-studio.md— the three registries this flow joinsobservability.md— what the tracer does at each stepmcp-infrastructure.md— how agents see the cluster