Education › Forward Deployed › Stage 4: Deploying in customer environments

Operating and debugging at customer sites

Observability you can ship, support bundles, remote debugging without direct access, and incident communication.

Intermediate to advanced ~45 min read Module 16 of 20

Once your software runs in the customer's environment, problems arrive without you being there: a call at 8 a.m. saying "it's not working", a screen share with someone who is not allowed to give you access, logs you cannot see. Debugging at a customer site is a distinct skill: you design observability that plugs into their stack, ship tools that collect evidence safely, diagnose through other people's hands, and communicate clearly during incidents. This lesson covers all four.

After this module you can
  • Build health checks, metrics, structured logs and traces that fit the customer's tooling
  • Ship a support-bundle command that collects evidence without leaking secrets
  • Debug systematically through screen shares and customer operators
  • Run incident communication with severity, cadence and clear updates
  • Turn every incident into a runbook entry and a product improvement

Observability that plugs into their stack

Customers already have monitoring: Prometheus and Grafana, Datadog, Splunk, Elastic, a cloud vendor's tools. Your software should emit standard signals they can collect, rather than requiring yet another dashboard: health endpoints for their orchestrator, Prometheus-format metrics, JSON logs to stdout, and OpenTelemetry traces they can route anywhere through a Collector.

  • Liveness (/healthz): the process is alive. Readiness (/readyz): dependencies (database, model endpoint, index) are reachable, so traffic should be sent.
  • Metrics: request rate, errors, latency histograms, queue depth, and business counters (documents indexed, answers served, actions drafted).
  • Logs: one JSON object per line with request IDs that also appear in traces and in error messages users see.
  • Traces: spans for each external call (retrieval, model, integrations), so slow requests show where time went.
Readiness that checks dependencies, plus Prometheus metrics
python
from fastapi import FastAPI, Response
from prometheus_client import Counter, Histogram, make_asgi_app

app = FastAPI()
app.mount("/metrics", make_asgi_app())
REQUESTS = Counter("assistant_requests_total", "Requests", ["route", "status"])
LATENCY = Histogram("assistant_request_seconds", "Request latency", ["route"])


@app.get("/healthz")
def healthz() -> dict:
    return {"ok": True}


@app.get("/readyz")
def readyz(response: Response) -> dict:
    checks = {"index": index.ping(), "model": model_client.ping(), "db": db.ping()}
    if not all(checks.values()):
        response.status_code = 503
    return checks

The support bundle

When you cannot access the environment, ask the customer to run one command that collects everything you need into an archive they can inspect before sending. Build it into the product: versions, configuration with secrets redacted, recent logs, Kubernetes resource states and events, and the results of connectivity checks.

A minimal Kubernetes support bundle with redaction
bash
#!/usr/bin/env bash
set -euo pipefail
NS="${1:-assistant}"
OUT="support-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$OUT"
kubectl version -o yaml > "$OUT/versions.yaml" 2>&1 || true
helm list -n "$NS" > "$OUT/helm.txt" 2>&1 || true
kubectl get all,ingress,pvc -n "$NS" -o wide > "$OUT/resources.txt"
kubectl get events -n "$NS" --sort-by=.lastTimestamp > "$OUT/events.txt"
for p in $(kubectl get pods -n "$NS" -o name); do
  kubectl logs -n "$NS" "$p" --all-containers --since=6h > "$OUT/$(basename "$p").log" 2>&1 || true
done
kubectl get configmap -n "$NS" -o yaml > "$OUT/configmaps.yaml"
sed -i -E 's/(password|token|secret|apikey|api_key)(["]?[:=][ ]*)[^ ,"]+/\1\2REDACTED/Ig' "$OUT"/*
tar -czf "$OUT.tar.gz" "$OUT" && echo "Review $OUT/ then send $OUT.tar.gz"
Watch out

Never collect Kubernetes Secrets, environment dumps or prompt contents in a support bundle. Redaction by pattern is a safety net, not a guarantee: tell the customer to review the archive before it leaves their network.

Debugging through someone else's hands

Often the customer's operator drives the keyboard while you watch on a screen share. Your job is to make every minute count: be systematic, ask for one command at a time with a clear reason, and keep notes the operator can reuse.

signalsalertsone command at a timerunssendYour apphealth, metrics, logsTheir monitoringPrometheus / SIEMTheir operatordrives keyboardSupport bundleredacted, reviewedYou (FDE)hypotheses
Without direct access, debugging runs through the customer's operator and a reviewed support bundle, while your signals flow into their existing monitoring.
  1. Define the symptom precisely: what fails, for whom, since when, what changed (deploys, certificates, network, data).
  2. Check from the outside in: can users reach the app (DNS, ingress, TLS)? Is the app ready? Are its dependencies reachable from inside the pod?
  3. Look at recent events and logs first: crash loops, OOM kills, failed pulls and probe failures explain most outages.
  4. Form one hypothesis at a time and choose the command that would confirm or reject it.
  5. Change one thing, with the customer's approval and a rollback, then verify.
  6. Write it down: symptom, cause, fix, and the check that would have caught it earlier.
The first five commands to ask an operator for
bash
kubectl get pods -n assistant -o wide
kubectl describe pod -n assistant -l app=assistant | sed -n '/Events:/,$p'
kubectl logs -n assistant deploy/assistant --since=30m | tail -100
kubectl exec -n assistant deploy/assistant -- \
  curl -s -o /dev/null -w '%{http_code}\n' localhost:8000/readyz
kubectl get events -n assistant --sort-by=.lastTimestamp | tail -20

Incident communication

During an outage the customer needs confidence more than technical detail. Agree severity levels and contacts before go-live, and when something breaks, follow a rhythm.

  • Acknowledge fast with what you know and when the next update is coming.
  • Update on a fixed cadence (every 30 or 60 minutes for serious incidents) even if the update is "still investigating, current hypothesis is X".
  • One channel and one incident lead on your side, so the customer is not hearing different stories.
  • Separate mitigation from root cause: restore service first (roll back, fail over, disable a feature flag), investigate after.
  • Close with a written summary and, for significant incidents, a blameless post-incident review with action items and owners.
Tip

A good update template: what is affected, what we know, what we are doing, what you can do meanwhile, next update at TIME.

From incident to improvement

Every incident is information. Add a runbook entry the customer's operators can follow next time without you. Add the missing check to the preflight script, the support bundle, or a readiness probe. Add an alert if the failure was detectable. And when the cause was a product weakness rather than this customer's environment, file it with your product team with the evidence; fixing it once in the product protects every customer.

Hands-on practice

Break it, then debug it through someone else

  1. Deploy the chart from the packaging lesson to a local cluster with /healthz, /readyz and /metrics implemented.
  2. Write the support-bundle script and run it; review the output and confirm no secret values appear.
  3. Ask a friend to break the deployment secretly (wrong database password, a NetworkPolicy blocking egress, an image tag that does not exist, too little memory).
  4. Diagnose it while they drive the keyboard and you may only ask for one command at a time, following the six steps.
  5. Send incident updates in the template format at 15-minute intervals during the exercise.
  6. Write the runbook entry and the preflight or readiness check that would have caught the problem earlier.
Cheat sheet

Operating and debugging at customer sites — at a glance

Main things to focus on

  • Emit standard signals: health endpoints, Prometheus metrics, JSON logs, OTel traces.
  • Readiness checks dependencies; liveness only checks the process.
  • Ship a support-bundle command; customers review before sending; never collect secrets.
  • Debug outside-in, events and logs first, one hypothesis at a time.
  • Incidents: acknowledge fast, fixed update cadence, mitigate before root cause.
  • Every incident becomes a runbook entry, a check and possibly a product fix.

kubectl triage

kubectl get pods -n NS -o wideState, restarts, node
kubectl describe pod POD -n NSEvents: pull errors, OOM, probes
kubectl logs deploy/APP -n NS --since=30mRecent logs
kubectl logs POD --previousLogs of the crashed container
kubectl get events -n NS --sort-by=.lastTimestampTimeline
kubectl exec deploy/APP -- curl localhost:PORT/readyzCheck from inside

Health and metrics

/healthzLiveness: process alive
/readyzReadiness: dependencies reachable
/metricsPrometheus exposition
request ID in logs, traces and user errorsCorrelate everything
support-bundle.sh NAMESPACECollect redacted evidence for review

Incident update template

AffectedWho and what
Known / DoingFacts and current actions
WorkaroundWhat users can do meanwhile
Next update at TIMECommit to cadence

Common pitfalls

  • A readiness probe that always returns OK even when the database is down.
  • Support bundles that include Secrets or environment dumps.
  • Asking the operator to run ten commands at once with no explanation.
  • Hunting root cause while the service stays down instead of rolling back.
  • Fixing the same incident manually at every customer instead of in the product.
Quiz

Check your understanding

5 questions · 4 to pass · answers are explained as you go. Your best score is saved on this device only.

Progress and quiz scores are saved in this browser only. Back up or restore on the hub.

Was this lesson useful? Tell me what to improve →