Conservative, PII-safe extraction of metadata from an arbitrary input object.
For plain objects, keeps primitive (string/number/boolean) values whose key passes
isSafeKey (ids, pagination/sort keys, enum-ish Type/Status suffixes). Free-text
strings (e.g. question, answer, names) and non-allowlisted keys are dropped so nothing
sensitive lands on a trace facet. Returns {} for non-plain-object input (arrays, null,
primitives).
Deliberately returns a flat, unprefixed Record and does NOT inject any deployment
environment — callers compose those concerns so this stays dependency-free.
Conservative, PII-safe extraction of metadata from an arbitrary input object.
For plain objects, keeps primitive (
string/number/boolean) values whose key passesisSafeKey(ids, pagination/sort keys, enum-ishType/Statussuffixes). Free-text strings (e.g.question,answer, names) and non-allowlisted keys are dropped so nothing sensitive lands on a trace facet. Returns{}for non-plain-object input (arrays, null, primitives).Deliberately returns a flat, unprefixed
Recordand does NOT inject any deploymentenvironment— callers compose those concerns so this stays dependency-free.