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.
- 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.
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 checksThe 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.
#!/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"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.
- Define the symptom precisely: what fails, for whom, since when, what changed (deploys, certificates, network, data).
- 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?
- Look at recent events and logs first: crash loops, OOM kills, failed pulls and probe failures explain most outages.
- Form one hypothesis at a time and choose the command that would confirm or reject it.
- Change one thing, with the customer's approval and a rollback, then verify.
- Write it down: symptom, cause, fix, and the check that would have caught it earlier.
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 -20Incident 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.
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.