Skip to main content

MetricAttributeSettingsinterface

Controls the publishing of a specific metric attribute.

Properties (2)

Property Type Default Required Description
mode⚓︎ "allow" | "drop" | "mask" x x

What to do with the attribute: "drop" never publishes it; "mask" publishes its value masked - a keyed hash (HMAC-SHA-256, keyed per maskingSettings) truncated to 16 characters (reduceModality of them for a metric) - so that the value stays out of the telemetry while distinct values stay distinguishable and nobody without the secret can hash their way back to it; "allow" publishes it: in a block list (the default, see attributeSettingsMode) that is the exception to a broader "drop" entry, in an allow list only the attributes with an "allow" or a "mask" entry are published.

reduceModality⚓︎ number x x

With mode: "mask": the length of the masked value - the keyed hash is truncated to this many characters (16 without it).

Without a mode, what it has always meant: set to 0 to drop the attribute entirely, to a positive length to publish the value hashed and cut to that many characters - to reduce the modality of the published metrics - or to -1 to override any defaults (the mode alone decides then). The hash is the one it has always been: the 32-bit FNV-1a hash of the value in hex (repeated when the length is longer than the hash), not keyed - the same value gives the same string in every process and every session, so the series published so far keep their values. It does not hide the value: anyone can hash a candidate and compare, and such a value is not reported to maskingSettings.mappingURL. Use mode: "mask" for a value that has to stay private.