Commit 968ef25
committed
feat(site-health-probe): synthetic monitoring component for NICo APIs
Adds nico-site-health-probe (#5360, sub-issue of #3723): a Go service that
runs configurable probes against NICo APIs concurrently and exposes
latency/outcome metrics for the standard collector.
Architecture (dev/k8s/site-health-probe, Go 1.26.4 / toolchain 1.26.7):
- Channel pipeline: one goroutine per probe (per-probe configurable
interval/timeout, immediate first fire, panic recovery) produces Result
events on a buffered channel; a Collector consumes them into a Sink.
Probes are pure measurement (return Observations, never touch metrics),
so future consumers — site-stats aggregation for host ingestion, instance
creation, firmware updates (see TODOs) — attach at the Sink seam.
- Per-API packages: internal/probes/nicoapi (gRPC + SPIFFE mTLS machinery)
and internal/probes/restapi (HTTP + Keycloak client-credentials) are
distinct; adding a probe to one API never touches the other.
- v1 probes: gRPC machines (FindMachineIds + first-page FindMachinesByIds,
rotation-safe cert reload), REST machines/instances (cached token,
secrets re-read from mounted files, never logged). Every probe toggles
independently (nico-api without REST and vice versa).
- Go stubs generated from the canonical crates/rpc/proto definitions
(committed; Makefile proto-gen disambiguates two oneof-vs-enum-value
name collisions Go cannot compile).
- Metrics: carbide_site_health_probe_{request_duration_milliseconds,
requests_total,up} labeled by api (nico-api | nico-rest-api), probe,
operation/outcome.
Security/hardening (audited: gosec 0, govulncheck clean, tests -race):
- Toolchain pinned to 1.26.7 (1.26.4's stdlib has seven reachable CVEs;
the Grype image-scan gate reads the Go version from the binary).
- REST client refuses redirects (Go replays POST bodies on 307/308 to any
host; the token body carries the Keycloak client_secret).
- Full TLS verification everywhere (no insecure mode exists); metrics
server fully timeout-bounded; distroless nonroot image, digest-pinned.
Core RBAC: new SiteHealthProbe principal (nico-site-health-probe) granted
FindMachineIds + FindMachinesByIds only.
Helm: nico-site-health-probe subchart under nico-machine-a-tron (enabled by
default with the MAT chart; REST probes off until site inputs exist). The
SPIFFE Certificate and its volume render only when the gRPC probe is
enabled, so REST-only deployments don't depend on the core cert issuer.
Hardened pod (nonroot, read-only rootfs, no capabilities, seccomp
RuntimeDefault), metrics Service + gated ServiceMonitor, helm-unittest
coverage incl. per-probe toggle combinations.
CI: build-site-health-probe image job (mat-k8s-controller pattern), wired
into the aggregate jobs. Docs: metric rows in core_metrics.md; MAT README
section incl. the stale-TLS-secret reinstall note.
TODO(#5360-followup): active lifecycle probes (machine_count: 1=canary,
all=scale test) and progress p50/p95/p99 reporting.
Signed-off-by: Milad Noori <mnoori@nvidia.com>1 parent e3c10af commit 968ef25
45 files changed
Lines changed: 121959 additions & 2 deletions
File tree
- .github/workflows
- crates/api-core/src/auth
- dev/k8s/site-health-probe
- cmd/site-health-probe
- internal
- config
- forgepb
- codegenv1
- common
- dns
- forge
- health
- machine_discovery
- measured_boot
- mlx_device
- scout_firmware_upgrade
- site_explorer
- framework
- metrics
- probes
- nicoapi
- restapi
- docs/observability
- helm/charts/nico-machine-a-tron
- charts/nico-site-health-probe
- templates
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
900 | 901 | | |
901 | 902 | | |
902 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
903 | 958 | | |
904 | 959 | | |
905 | 960 | | |
| |||
1725 | 1780 | | |
1726 | 1781 | | |
1727 | 1782 | | |
| 1783 | + | |
1728 | 1784 | | |
1729 | 1785 | | |
1730 | 1786 | | |
| |||
2098 | 2154 | | |
2099 | 2155 | | |
2100 | 2156 | | |
| 2157 | + | |
| 2158 | + | |
2101 | 2159 | | |
2102 | 2160 | | |
2103 | 2161 | | |
| |||
2161 | 2219 | | |
2162 | 2220 | | |
2163 | 2221 | | |
| 2222 | + | |
2164 | 2223 | | |
2165 | 2224 | | |
2166 | 2225 | | |
| |||
2205 | 2264 | | |
2206 | 2265 | | |
2207 | 2266 | | |
| 2267 | + | |
| 2268 | + | |
2208 | 2269 | | |
2209 | 2270 | | |
2210 | 2271 | | |
| |||
2282 | 2343 | | |
2283 | 2344 | | |
2284 | 2345 | | |
| 2346 | + | |
| 2347 | + | |
2285 | 2348 | | |
2286 | 2349 | | |
2287 | 2350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| 256 | + | |
254 | 257 | | |
255 | 258 | | |
256 | 259 | | |
| |||
1064 | 1067 | | |
1065 | 1068 | | |
1066 | 1069 | | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1067 | 1075 | | |
1068 | 1076 | | |
1069 | 1077 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments