swarm-otel: stamp the swarm on every hive's pipeline
mara on the tracking issue: "we need the swarm label for upstream otel at least (the out of swarm one)." Stamped in the per-hive `resource` processor rather than on a separate upstream-only pipeline, which would double the pipeline count to withhold one constant label from the local store. It is redundant there — one metrics store per swarm, so every series in it already belongs to this swarm — but a constant label multiplies no series, and it means what leaves and what stays have the same shape. Upstream is where it stops being redundant: that is the one hop where several swarms can land in one store, and samples that cannot name their swarm collide there exactly as hives collided here before per-hive receivers existed. `unknown` when unnamed rather than an absent label, copying the agent path so a query never has to handle both "the label is missing" and "the label says unknown".
This commit is contained in:
parent
738cc413e7
commit
7880483b51
1 changed files with 24 additions and 0 deletions
|
|
@ -70,6 +70,12 @@ let
|
||||||
};
|
};
|
||||||
caBundle = caTrust.bundlePathFor cfg.machine;
|
caBundle = caTrust.bundlePathFor cfg.machine;
|
||||||
|
|
||||||
|
# `unknown` rather than omitting the label, copying `agent-modules/otel.nix`
|
||||||
|
# deliberately: a producer that cannot name its swarm should say so in the
|
||||||
|
# same vocabulary as every other producer, so a query never has to handle
|
||||||
|
# both "the label is absent" and "the label says unknown".
|
||||||
|
swarmDisplayName = if hyperhiveCfg.swarm.name == null then "unknown" else hyperhiveCfg.swarm.name;
|
||||||
|
|
||||||
# One list, read by every pipeline: the per-hive pipelines fan out to
|
# One list, read by every pipeline: the per-hive pipelines fan out to
|
||||||
# exactly the same destinations as the single pipeline they replace.
|
# exactly the same destinations as the single pipeline they replace.
|
||||||
# Written once because "which exporters" is a property of this tier, not
|
# Written once because "which exporters" is a property of this tier, not
|
||||||
|
|
@ -489,6 +495,24 @@ in
|
||||||
value = h;
|
value = h;
|
||||||
action = "upsert";
|
action = "upsert";
|
||||||
}
|
}
|
||||||
|
# Stamped here rather than on a separate upstream-only
|
||||||
|
# pipeline, which would double the pipeline count to
|
||||||
|
# withhold one constant label from the local store. It
|
||||||
|
# is redundant there — one VictoriaMetrics per swarm, so
|
||||||
|
# every series in it already belongs to this swarm — but
|
||||||
|
# a constant label multiplies no series, and it means
|
||||||
|
# what LEAVES and what STAYS have the same shape.
|
||||||
|
#
|
||||||
|
# Upstream is where it stops being redundant: that is the
|
||||||
|
# one hop where several swarms can land in one store, and
|
||||||
|
# samples that cannot name their swarm collide there
|
||||||
|
# exactly as hives collided here before per-hive
|
||||||
|
# receivers existed.
|
||||||
|
{
|
||||||
|
key = "swarm";
|
||||||
|
value = swarmDisplayName;
|
||||||
|
action = "upsert";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
) hivePorts;
|
) hivePorts;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue