swarm-otel: delete a sender-set sender and hive from datapoints and log records
This commit is contained in:
parent
ded017953b
commit
90a1e523fb
1 changed files with 75 additions and 18 deletions
|
|
@ -751,10 +751,41 @@ let
|
|||
"logs/authenticated"
|
||||
"metrics/authenticated"
|
||||
]
|
||||
&& lib.all (p: p.processors == [ "resource/sender" ]) (lib.attrValues authed)
|
||||
&& lib.all (p: lib.head p.processors == "resource/sender") (lib.attrValues authed)
|
||||
&& !(anyOtlp unauthed)
|
||||
&& unauthed != { };
|
||||
}
|
||||
{
|
||||
# `resource/sender` only rewrites resource attributes. A `sender` or
|
||||
# `hive` a sender sets on a datapoint or a log record reaches the store
|
||||
# as a label beside the stamped one unless `attributes/sender` deletes
|
||||
# it, so each authenticated pipeline must carry it. The unauthenticated
|
||||
# pipelines are the control: they carry neither processor.
|
||||
# 🔬 Invert-proof: drop `attributes/sender` from either pipeline, or
|
||||
# either delete from the processor.
|
||||
name = "every authenticated pipeline deletes a sender-set sender and hive from datapoints and log records";
|
||||
ok =
|
||||
let
|
||||
s = otelSettings otelTwoHives;
|
||||
authed = lib.filterAttrs (_: p: lib.elem "resource/sender" p.processors) s.service.pipelines;
|
||||
unauthed = lib.filterAttrs (_: p: !(lib.elem "resource/sender" p.processors)) s.service.pipelines;
|
||||
deleted = map (a: a.key) (
|
||||
lib.filter (a: a.action == "delete") s.processors."attributes/sender".actions
|
||||
);
|
||||
in
|
||||
lib.attrNames authed == [
|
||||
"logs/authenticated"
|
||||
"metrics/authenticated"
|
||||
]
|
||||
&& lib.all (p: lib.elem "attributes/sender" p.processors) (lib.attrValues authed)
|
||||
&& !(lib.any (p: lib.elem "attributes/sender" p.processors) (lib.attrValues unauthed))
|
||||
&&
|
||||
lib.sort lib.lessThan deleted == [
|
||||
"hive"
|
||||
"sender"
|
||||
]
|
||||
&& lib.length s.processors."attributes/sender".actions == 2;
|
||||
}
|
||||
{
|
||||
# The same split as the metrics case above — defining an exporter and
|
||||
# naming it are two lists — plus the half one shared list cannot have:
|
||||
|
|
|
|||
Loading…
Reference in a new issue