This is Part 6, the last part of the build in the Sprint 6 project overview. Parts 1 to 5 built, served, protected and shipped the ERP. This part is how you keep it running and how you prove it can recover: Prometheus and OpenTelemetry for signals, Jaeger and Loki for traces and logs, Perses for dashboards, HolmesGPT to investigate alerts, Litmus for game days, Velero and Kanister for restore tests, and Karpenter with OpenCost for capacity and cost per tenant.
Where this part fits. This part builds the operate layer (marked Part 6 on the overall diagram). Open the zoomable Sprint 6 architecture or read the Overview.
What this is and is not. This is engineering guidance, not legal or financial advice. It is a reference blueprint: the intended flow and the wiring between the tools. Versions, chart keys and resource fields change between releases, so each section gives a check to confirm them on your version. If you hit a bug or a mismatch, use the “Suggest a correction” link on this page.
What you build, and in what order
One image, the layers of this part. Open the zoomable diagram, or download it as SVG or PNG. Velero also backs up the ERP namespaces themselves; that arrow is left off the picture to keep it readable.
- Metrics and SLO alerts
- One OpenTelemetry collector
- Traces in Jaeger, logs in Loki
- Dashboards in Git with Perses
- HolmesGPT on an alert
- A Litmus game day
- Backups and a restore test
- Karpenter and OpenCost
- Teardown order, troubleshooting, cost, checklist
Prerequisites
Everything from Parts 1 to 5 is running. New here: a monitoring namespace, an S3 bucket for Loki chunks and another for backups (versioned, encrypted with the Part 1 KMS key), and Pod Identity roles for Loki, Velero and Kanister. Install the Prometheus stack first, because OpenCost and the alerts depend on it:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm upgrade --install kps prometheus-community/kube-prometheus-stack -n monitoring --create-namespace \
--set grafana.enabled=false --set prometheus.prometheusSpec.retention=15d \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false
Grafana is switched off because dashboards go through Perses below. Check: kubectl -n monitoring get pods shows Prometheus, Alertmanager and the operator ready, and the Targets page lists the Istio, Karpenter and Kafka exporters from earlier parts as up.
1. Metrics and SLO alerts
Istio already reports request counts and latency for every ERP service, labelled with the destination namespace, which is the tenant. One rule per promise turns those into an alert per tenant:
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata: { name: erp-slo, namespace: monitoring }
spec:
groups:
- name: erp-api
rules:
- record: tenant:erp_errors:ratio_rate5m
expr: |
sum by (destination_workload_namespace) (rate(istio_requests_total{destination_service_name="erp-api",response_code=~"5.."}[5m]))
/ sum by (destination_workload_namespace) (rate(istio_requests_total{destination_service_name="erp-api"}[5m]))
- alert: ErpErrorBudgetBurn
expr: tenant:erp_errors:ratio_rate5m > 0.02
for: 10m
labels: { severity: page }
annotations:
summary: "ERP API errors above 2% for {{ $labels.destination_workload_namespace }}"
Two percent for ten minutes is a starting point, not a measured objective; set it from real traffic. Add a latency rule on istio_request_duration_milliseconds_bucket the same way. Check: the rule shows as healthy under Rules, and a deliberate burst of 500 responses in one tenant fires the alert for that namespace only.
2. One OpenTelemetry collector
Services send everything over OTLP to one collector, which sorts it. Install the OpenTelemetry Operator, then:
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata: { name: erp, namespace: monitoring }
spec:
mode: deployment
config:
receivers:
otlp: { protocols: { grpc: {}, http: {} } }
processors:
batch: {}
k8sattributes: {}
exporters:
prometheus: { endpoint: "0.0.0.0:8889" }
otlp/jaeger: { endpoint: jaeger-collector.monitoring:4317, tls: { insecure: true } }
otlphttp/loki: { endpoint: http://loki.monitoring:3100/otlp }
service:
pipelines:
metrics: { receivers: [otlp], processors: [k8sattributes, batch], exporters: [prometheus] }
traces: { receivers: [otlp], processors: [k8sattributes, batch], exporters: [otlp/jaeger] }
logs: { receivers: [otlp], processors: [k8sattributes, batch], exporters: [otlphttp/loki] }
Point each service’s OTEL_EXPORTER_OTLP_ENDPOINT at erp-collector.monitoring:4317, and add a ServiceMonitor for port 8889 so Prometheus scrapes the converted metrics. Pod log files need a node-level collector with a filelog receiver; that second collector (a DaemonSet) is the usual pattern and is not written out here. The LLM traces from Part 4 stay in Langfuse, which understands model calls; this collector carries the rest. Check: make one ERP request; a trace with the same trace id appears in Jaeger and a log line for it in Loki.
3. Traces in Jaeger, logs in Loki
Install both from their Helm charts. Jaeger accepts OTLP directly. Its storage is the decision: for the lab, a single replica with local disk storage is enough; for anything shared you need a search backend (OpenSearch, Elasticsearch or Cassandra), which this part does not build. Loki runs in single-binary mode here, with chunks and index in S3 through Pod Identity, and a retention period you set deliberately:
# values for the grafana/loki chart (sketch)
deploymentMode: SingleBinary
loki:
commonConfig: { replication_factor: 1 }
storage: { type: s3, s3: { region: ap-south-1 }, bucketNames: { chunks: erp-loki-chunks } }
limits_config: { retention_period: 336h }
compactor: { retention_enabled: true }
Logs hold tenant data, so do not put raw request bodies in them, and keep Loki reachable only inside the cluster. The chart keys change between releases (the storage block especially); compare with the chart’s own values file. Check: query {namespace="acme-erp"} and see only that tenant’s pods, then confirm objects are appearing in the S3 bucket.
4. Dashboards in Git with Perses
Perses keeps dashboards as code: a project, a Prometheus datasource, and dashboards you review in a pull request like any other change. Deploy it from its chart, define the datasource to http://kps-kube-prometheus-stack-prometheus.monitoring:9090, and keep the dashboard files in the GitOps repository so Argo CD from Part 5 delivers them. Start with three: request rate, errors and latency per tenant; Kafka consumer lag; and GPU and node usage. The dashboard format and the Kubernetes custom resources are still moving; export a dashboard from the UI once and commit that file rather than writing JSON by hand. Check: change a panel in a pull request, merge, and see it appear after the Argo CD sync without touching the UI.
5. HolmesGPT on an alert
HolmesGPT is an agent that investigates: it takes an alert or a question, then queries Kubernetes, Prometheus and Loki to find a probable cause. Its README describes it as a CNCF SRE agent; check its maturity level on the CNCF page. The command-line forms it documents are holmes ask "what pods are unhealthy and why?" and holmes investigate alertmanager --alertmanager-url http://localhost:9093, and its Helm configuration lists toolsets for Kubernetes, Prometheus and Loki with a URL each:
# values sketch, from HolmesGPT's Helm configuration page
toolsets:
- name: kubernetes
enabled: true
- name: prometheus
enabled: true
config: { url: "http://kps-kube-prometheus-stack-prometheus.monitoring:9090" }
- name: loki
enabled: true
config: { url: "http://loki.monitoring:3100" }
Three decisions. Model: it needs a model that is good at calling tools; the small CPU model from Part 3 will probably not manage it, so use a hosted model (its configuration lists providers including Bedrock), which sends cluster data to that provider, so choose the provider and Region with that in mind. Reach: limit its toolsets to platform namespaces first; tenant logs may contain tenant data. Trigger: I did not confirm a documented in-cluster path that starts an investigation from every alert except the Robusta integration, so this build runs it on demand and from a scheduled job that calls the investigate alertmanager form. It reads and reasons; it does not fix anything here, and the remediation toolset stays off. Check: take the alert from section 1, run the investigation, and compare its answer with what you know caused the burst. Treat its answer as a lead, not a verdict.
6. A Litmus game day
Chaos testing asks one question: when this breaks, does the promise from section 1 still hold? Install Litmus, give the experiment a service account scoped to one tenant namespace, then run a pod-delete against the ERP API while a probe watches the steady state:
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata: { name: erp-api-pod-delete, namespace: acme-erp }
spec:
engineState: active
appinfo: { appns: acme-erp, applabel: "app=erp-api", appkind: deployment }
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
env:
- { name: TOTAL_CHAOS_DURATION, value: "60" }
- { name: CHAOS_INTERVAL, value: "10" }
- { name: FORCE, value: "false" }
probe:
- name: api-stays-up
type: httpProbe
mode: Continuous
httpProbe/inputs:
url: http://erp-api.acme-erp.svc/healthz
method: { get: { criteria: "==", responseCode: "200" } }
runProperties: { probeTimeout: 5s, interval: 2s, retry: 1 }
Repeat with a network-latency experiment toward the database and a node drain on a Karpenter node. Run game days in a staging copy first, in working hours, with a named person watching, and write down what you learned. Litmus has moved from its older engine model to a ChaosCenter with its own experiment format; the engine form above is the long-standing one, and your install may prefer the newer one, so confirm in its docs. Check: the ChaosResult verdict is Pass, the ErpErrorBudgetBurn alert stayed quiet, and the Jaeger traces during the minute show retries, not failures.
7. Backups and a restore test
A backup you have not restored is a hope. Two tools split the work. Velero protects cluster objects and volumes to S3:
velero install --provider aws --plugins velero/velero-plugin-for-aws:<version> \
--bucket erp-backups --backup-location-config region=ap-south-1 \
--use-node-agent --features=EnableCSI
velero schedule create erp-nightly --schedule "0 20 * * *" \
--include-namespaces acme-erp,globex-erp,platform --ttl 168h
Check the plugin version and how it takes credentials (Pod Identity or IAM roles for service accounts) in Velero’s AWS plugin page for your release. Kanister protects the data in the databases with a logical dump, driven by three objects: a Profile (the S3 location), a Blueprint (the steps) and an ActionSet (one run). Kanister’s repository ships a PostgreSQL logical-backup blueprint, and the Kasten documentation has an RDS variant that dumps to S3:
kanctl create profile s3compliant --bucket erp-backups --region ap-south-1 --namespace kanister \
--access-key <KEY> --secret-key <SECRET> # prefer a role over keys; see the profile docs
kubectl apply -n kanister -f postgres-blueprint.yaml # from the Kanister examples, adapted for RDS
kanctl create actionset --action backup --namespace kanister \
--blueprint postgres-bp --profile kanister/<profile-name> --objects <your target object>
The ERP data lives in RDS, where AWS also takes automated snapshots; the logical dump is the second, portable copy that lets you restore into a different database. The restore test is the point:
- Restore the Velero backup of
acme-erpinto a scratch namespace:velero restore create --from-backup <name> --namespace-mappings acme-erp:restore-test. - Restore the Kanister dump into a scratch database (
erp_restore), never into the live one. - Compare row counts for
purchase_orders,invoicesandstock_movesagainst the source, and run one tenant’s read path against the restored copy. - Write down the elapsed time. That is your measured recovery time, and it is the only honest number you have.
Kanister, ClickHouse and Kafka are separate stories: ClickHouse can be rebuilt from Kafka and the source tables within the retention window, and Kafka topics are not backed up here at all (MSK keeps data per its retention setting). Say that out loud in your recovery plan. Check: counts match, the read path works, and the scratch namespace and database are deleted afterwards.
8. Karpenter and OpenCost
Karpenter already provisions nodes. Operating it means two choices: how aggressively it consolidates, and how much it may disrupt at once.
apiVersion: karpenter.sh/v1
kind: NodePool
metadata: { name: general }
spec:
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 5m
budgets:
- nodes: "10%"
- nodes: "0"
schedule: "0 8 * * mon-fri" # no voluntary disruption in the morning peak
duration: 4h
Spot nodes save money and can be reclaimed, so keep stateful and single-replica workloads on on-demand capacity. Then install OpenCost against the Prometheus from section 1:
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm upgrade --install opencost opencost/opencost -n opencost --create-namespace \
--set opencost.prometheus.internal.serviceName=kps-kube-prometheus-stack-prometheus \
--set opencost.prometheus.internal.namespaceName=monitoring
kubectl -n opencost port-forward svc/opencost 9003:9003 &
curl -G http://localhost:9003/allocation -d window=7d -d aggregate=namespace -d shareIdle=true
Because every tenant is a Capsule namespace set, aggregate=namespace is already cost per tenant; add a tenant label to the tenant namespaces from Part 1 and aggregate on label:tenant to roll several namespaces into one line. The chart value names above are the ones to confirm against the OpenCost chart for your version, and the figures use on-demand list pricing unless you configure the AWS cost integration. Check: the response lists acme and globex with CPU, memory and storage cost, and the shared idle share is visible.
9. Teardown order
Tear down in the reverse of how it was built, so nothing is left billing or half-deleted:
# 1. Stop traffic and delivery
kubectl delete applicationset -n argocd erp-tenants
# 2. Part 5 edge: gateway (removes the NLB), then tofu destroy for CloudFront, VPC origin, WAF (us-east-1)
# 3. Part 4 and Part 3: agent, Langfuse, KServe, GPU NodePool; delete model volumes
# 4. Operate: Litmus, OpenCost, HolmesGPT, Perses, Jaeger, Loki (empty the S3 buckets), OTel, kube-prometheus-stack
helm -n opencost uninstall opencost; helm -n monitoring uninstall kps
# 5. Part 2: Kafka (MSK), ClickHouse, Cadence, then RDS (take a final snapshot only if you want one)
# 6. Part 1: Capsule tenants, Karpenter NodePools (wait for nodes to go), EKS, then the VPC, KMS key schedule, Route 53 zone
# 7. Last: empty and delete S3 buckets (versioned: delete all versions), ECR repositories, then check the bill and Cost Explorer
The usual leftovers: load balancers and their network interfaces blocking VPC deletion, EBS volumes and snapshots, NAT gateways, CloudWatch log groups, and versioned buckets. Check: a tag-based search for the project tag returns nothing, and the next day’s cost shows only the small tail you expect.
10. Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Prometheus does not scrape a service | ServiceMonitor selector or label mismatch |
Check the Targets page; set the selector value from the install |
| Alert never fires | Metric labels differ from the rule (destination_workload_namespace) |
Run the expression in the Prometheus UI and adjust labels |
| No traces in Jaeger | Wrong collector endpoint or insecure TLS setting | Check the collector logs and the exporter endpoint |
| Loki rejects logs | Wrong OTLP path or ingestion limits | Check the /otlp path and the limits_config values |
| Loki fills S3 faster than expected | No retention or compactor | Enable the compactor and set a retention period |
| HolmesGPT answers vaguely | Toolset URL wrong, or the model is weak at tools | Test each toolset URL; try a stronger model |
| Chaos run does nothing | Service account lacks permission, or the label selector matches no pod | kubectl describe chaosengine; check the runner logs |
| Velero restore leaves pods pending | Volumes not restored, or storage class missing in the target | Check the node agent and the storage class of the restore |
| Kanister action fails | Profile or blueprint reference wrong, or database credentials missing | kubectl describe actionset; check the Profile and the Secret |
| OpenCost shows no cost | Prometheus address wrong or missing node metrics | Check the exporter logs and the Prometheus service name |
| Karpenter churns nodes | Consolidation too eager for the workload | Raise consolidateAfter; tighten disruption budgets |
Cost note
New lines in this part: S3 for Loki and backups (storage plus requests), the extra cluster pods for Prometheus, Loki, Jaeger and the collectors (the largest is Prometheus retention and Loki), and any hosted model used by HolmesGPT (per call). I did not read current prices for these today, so none are quoted; use the AWS calculator and your model provider’s page. The point of OpenCost in section 8 is to replace the guesses in earlier cost notes with measured numbers for your own cluster.
Design notes and version checks
- Nothing here was run on AWS, a cluster or a GPU. The likeliest differences: the Loki and Jaeger chart values, the OpenTelemetry collector config for your version, HolmesGPT’s chart keys and how it is triggered, Litmus’s engine format, Velero’s AWS credentials method, the Kanister blueprint for RDS, and the OpenCost chart values.
- Traces for LLM calls stay in Langfuse. The general collector does not replace it.
- Backups cover databases and cluster objects, not everything. Kafka topics and rebuildable analytics are named as gaps above.
- A game day needs a human. The chaos tool starts the fault; deciding that it is safe to start is yours.
- HolmesGPT is an assistant. It can be wrong, and it sends data to a model provider.
- Cost figures are list-price estimates unless you wire in your real AWS billing data.
- Synthetic data only in this build.
Setup checklist
- 1. Metrics: done when the SLO rule is healthy and a burst in one tenant alerts for that tenant only.
- 2. Collector: done when one request leaves a trace, a metric and a log line.
- 3. Stores: done when Jaeger shows the trace and Loki shows only the tenant’s logs.
- 4. Dashboards: done when a dashboard change merged in Git appears after sync.
- 5. Investigator: done when HolmesGPT’s answer for a test alert is checked against the real cause.
- 6. Game day: done when the pod-delete result is Pass and the alert stayed quiet.
- 7. Restore: done when row counts match in the scratch copy and the time is written down.
- 8. Cost: done when OpenCost lists each tenant and Karpenter’s consolidation is tuned.
- 9. Teardown: done when a tag search finds nothing left.
Tools used
Prometheus, OpenTelemetry, Jaeger, Loki, Perses, HolmesGPT, Litmus, Kanister, Velero (covered inside the Longhorn brief), Karpenter, OpenCost.
What comes next
This closes the Sprint 6 project. Back to the Overview for the whole picture and the full checklist.


