Repository navigation
Description
Four more config fields that are declared, documented, defaulted, and read by nothing. Same class as #176 (performance.read_ahead) and the eight inert top-level blocks that strict YAML decoding caught in v0.10.1 — but these survive strict decoding, because they are in the schema. They just have no consumer.
| field | declared | read by |
|---|---|---|
monitoring.metrics_addr |
internal/config/config.go:266 |
nothing |
monitoring.enable_pprof |
internal/config/config.go:267 |
nothing (pkg/profiling/memory.go:49 declares its own, separate field) |
monitoring.health_check_addr |
internal/config/config.go:268 |
nothing |
Global.ProfilePort |
internal/config/config.go:45, defaulted to 6060 at :431 |
nothing |
internal/config/doc.go:230 already admits the last one: "Global.ProfilePort is 6060 but is read by nothing — no pprof listener is started at any port." Honest, and better than silence, but a doc comment is not where a dead setting gets resolved.
Why it matters more than the field count suggests: metrics_addr and health_check_addr are the two settings an operator uses to put the metrics and health endpoints somewhere other than the default. #192 is open about the health endpoint binding the wildcard on an unvalidated port — these are the same problem from the other end. The endpoint binds a hardcoded address and the setting that would change it is inert, so an operator who correctly sets health_check_addr: 127.0.0.1:8081 gets a wildcard bind and no warning.
Do:
- Wire
metrics_addrandhealth_check_addrthrough to the listeners, and resolve them together with health: HTTP endpoint binds the wildcard on an unvalidated port, and neither is documented #192 — the validation that issue asks for is the same code path. - For
enable_pprof/ProfilePort: either start a pprof listener (opt-in, off by default, bound to loopback — pprof on a wildcard is a remote profiling endpoint) or delete both and the doc note with them. - Add the assertion shape v0.10.1 established for
buildS3Config: assert the value the consumer received, not that the mapping function was called. A test that recomputes the mapping cannot fail.
Verification: set each to a non-default value, start the adapter, assert the listener is on the configured address — over a socket, not by inspecting a struct field. A collector with no listener gathers identically to one with a listener, which is why internal/metrics went 79→85 when its tests started scraping.
Activity