DanielLeens commented on code in PR #11215:
URL: https://github.com/apache/seatunnel/pull/11215#discussion_r3765808305
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/telemetry/metrics/exports/ClusterMetricExports.java:
##########
@@ -43,6 +47,14 @@ public List<MetricFamilySamples> collect() {
clusterTime(mfs);
Review Comment:
Thanks for the question. Looking at the current head
(`ClusterMetricExports.java:41-58`), `nodeCount()` (along with
`clusterInfo()`/`clusterTime()`) is intentionally exported unconditionally from
every member, while only `clusterHealth()`/`clusterTopology()` are gated by
`isMaster()`.
The reason for the split: `clusterHealth`/`clusterTopology` are the
master-authoritative, cluster-wide narrative signals (safe/migration state,
topology-change counters), and gating those to the active master avoids
duplicate or conflicting series when scraping multiple members. `nodeCount`, on
the other hand, is each member's own local view of cluster size, and that
per-node view is itself a useful signal: if a node can't see the full
membership (cluster not fully formed, or a partition/split-brain), its reported
`node_count` will diverge from what the master reports - which is exactly the
kind of thing an operator wants visible.
If `nodeCount` were folded into the `isMaster()` gate as in your example, a
scrape hitting a non-master (or a node stuck before master election completes)
would emit no cluster-size signal at all instead of a divergent one - strictly
less observable during exactly the "cluster not fully formed" scenario you're
describing.
So the current split looks deliberate rather than an oversight, but happy to
dig further if you have a concrete failure scenario in mind where the
unconditional `nodeCount()` produces a misleading reading.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]