You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,6 +16,21 @@ xtcp2 is built to run as a long-lived daemon, so it ships first-class observabil
15
16
16
17
`pkg/xtcp/prometheus.go` registers the daemon's metrics and serves them over HTTP. By default they are exposed at `:9088/metrics` (`-promListen`, `-promPath`). Metrics cover the collection pipeline — netlink reads, deserialization, envelope rows flushed, destination sends, and namespace counts — which is what you scrape to alarm on a stalled collector or a destination backpressure problem. The `metrics-audit` tool/check (`nix build .#test-tools-metrics-audit`) guards metric registration.
17
18
19
+
## Health & readiness
20
+
21
+
For container / Kubernetes deployment the metrics HTTP server also serves two
22
+
probe endpoints (same `-promListen` address):
23
+
24
+
-**`/healthz`** — liveness. Returns `200` as soon as the HTTP server is up. Use
25
+
it for a Docker `HEALTHCHECK` or a k8s `livenessProbe`.
26
+
-**`/readyz`** — readiness. Returns `200` only once the daemon has initialised
27
+
its destination and netlinkers and started polling; `503` until then and again
28
+
during shutdown. Use it for a k8s `readinessProbe` / `startupProbe` so traffic
29
+
and rollouts wait until xtcp2 is actually collecting.
30
+
31
+
The gRPC port additionally serves the standard `grpc.health.v1` service, which
32
+
reports `SERVING` on the same readiness condition (for native k8s gRPC probes).
33
+
18
34
## pprof
19
35
20
36
The standard Go `net/http/pprof` endpoints are mounted on the metrics HTTP server, so `/debug/pprof/*` is available on the same `-promListen` address for live CPU, heap, goroutine, mutex, and block profiles. For one-shot file-based profiling, `-profile.mode` enables a profiling session of mode `cpu`, `mem`, `mutex`, or `block`.
0 commit comments