Expand description
Datadog-Agent-normative DogStatsD payload classification.
is_malformed is a predicate on the SERIALIZED datagram bytes a driver emits. It re-parses the
datagram the way the Datadog Agent’s DogStatsD parser at comp/dogstatsd/server/impl does. It
splits on \n and routes each message by prefix: _e{ to event, _sc to service check, else
metric. Then it applies that message type’s drop rules, and returns Ok(()) when the Agent
forwards every message, or the first PayloadError it drops on.
The Agent is the differential’s reference lane, so a message it drops produces no context even on
the normative side. Malformed is the Agent’s behavior, NOT ADP’s and NOT the backend intake’s. The
Agent does no UTF-8 or charset validation. It forwards non-UTF-8 and exotic names, tags, titles,
and text verbatim, so PayloadError covers only the hard structural and numeric-parse failures,
never content bytes.
The PayloadError variants are the contract the load generators are written against: the clean
generator emits only payloads for which this returns Ok(()), and a later malformed generator
induces exactly one variant and asserts the Agent drops for it.
Enums§
- Payload
Error - The first drop rule a serialized
DogStatsDpayload violates, tagged with the 0-based index of the offending message among the payload’s\n-split segments. Blank segments are counted in the index but are never malformed.
Functions§
- is_
malformed - Whether the Datadog Agent would forward the whole serialized
DogStatsDpayload.