Skip to main content

strip_reserved_properties

Function strip_reserved_properties 

Source
pub fn strip_reserved_properties(properties: Vec<Property>) -> Vec<Property>
Expand description

Drops every client-supplied property whose key starts with the reserved micromegas. namespace (RESERVED_PROPERTY_PREFIX), so that namespace can never be asserted from the payload. A dropped key is warn!-logged once per call, naming the key – a native client setting e.g. micromegas.audience is either attempting a client-side self-stamp or probing, and both are worth seeing. Stripping rather than rejecting the request with 400 keeps such a producer’s telemetry flowing, even though the self-stamp attempt has no effect.

pub, not private: tests/write_audience_tests.rs asserts this directly (see handler::build_webhook_request’s doc comment for the identical precedent in micromegas-otel-ingestion).