docs(swarm-otel): scrapeTargets constrains the target, not the scraper
The option's description claimed declaring an entry from the service's own module put 'the scraper and the target on the same host by construction rather than by luck'. It does not. It constrains where the target is; nothing in it places the collector, and the two enable flags are co-located by a shared lib.mkDefault rather than by construction. Split across hosts, a target is silently never scraped — the service's host declares an entry no local collector reads, the collector's host never enabled the service. No error surfaces, and no assertion can catch it: separate hosts are separate evaluations with no shared context, so the doc telling the truth is the only mechanism there is. The same paragraph already warned co-location was not a guarantee, four lines below the sentence claiming it was; a reader arriving for permission stopped at the permission. This one did. swarm-nats carries the concrete caveat for its own contribution.
This commit is contained in:
parent
e5c44f835a
commit
d2de3e8a2a
2 changed files with 39 additions and 20 deletions
|
|
@ -243,12 +243,26 @@ in
|
|||
`<job name> = "<host>:<port>"`.
|
||||
|
||||
**A service declares its own entry, from its own module, under its
|
||||
own `enable`.** That is what puts the scraper and the target on the
|
||||
same host by construction rather than by luck: an entry exists only
|
||||
where the service that named it runs. Do not assemble the list here.
|
||||
Every swarm service being co-located is a property of the all-local
|
||||
deployment, not a guarantee — and that is precisely the case where
|
||||
the difference is invisible until a swarm splits across hosts.
|
||||
own `enable`.** Do not assemble the list here: an entry then exists
|
||||
only where the service that named it runs, so a target is never
|
||||
declared on a host that does not serve it.
|
||||
|
||||
⚠️ **That constrains the TARGET, not the SCRAPER, and the difference
|
||||
is a silent gap.** Nothing here puts the collector on the same host.
|
||||
Services are co-located by *default* — `swarm-required-services.nix`
|
||||
derives their `enable` flags from one `lib.mkDefault` — not by
|
||||
construction, and an operator may split them.
|
||||
|
||||
When they are split the target is simply never scraped: the
|
||||
service's host declares an entry no local collector reads, and the
|
||||
collector's host never enabled that service so has no entry at all.
|
||||
No error, no eval failure, no warning.
|
||||
|
||||
**No assertion can catch this.** Two hosts are separate NixOS
|
||||
evaluations with no shared context, so neither can see what the
|
||||
other runs. A service that would be seriously wrong to lose should
|
||||
say so in its own contribution, because saying it is the only
|
||||
mechanism available.
|
||||
|
||||
Samples land in a swarm-level pipeline that stamps `swarm` and
|
||||
**never** `hive`: a swarm service does not belong to a hive, and
|
||||
|
|
|
|||
Loading…
Reference in a new issue