module documentation
Undocumented
| Function | sanitize |
Sanitize event properties before emitting telemetry. |
| Constant | DEFAULT |
Undocumented |
| Constant | DEFAULT |
Undocumented |
| Constant | MAX |
Undocumented |
| Constant | MAX |
Undocumented |
| Function | _safe |
Serialize a mapping while redacting nested secrets. |
| Function | _safe |
Convert values into a safe, JSON-friendly representation. |
| Function | _safe |
Keep enum-like strings while redacting risky free-form values. |
| Function | _should |
Return True for keys that are forbidden in coarse telemetry. |
| Function | _should |
Return True if the key should be redacted. |
| Function | _truncate |
Truncate long strings to keep payload size reasonable. |
| Constant | _EMAIL |
Undocumented |
| Constant | _PATH |
Undocumented |
| Constant | _URL |
Undocumented |
def sanitize_properties(properties:
Mapping[ str, Any] | None, *, allowlist: set[ str] | None = None, redact_keys: set[ str] | None = None) -> dict[ str, Any]:
¶
Sanitize event properties before emitting telemetry.
Applies an allowlist, redacts secret-like keys, and converts values to JSON-friendly types.
| Parameters | |
properties:Mapping[ | Input properties to sanitize. |
allowlist:set[ | If set, only these keys are included. |
redactset[ | Key substrings that should be redacted. |
| Returns | |
dict[ | The sanitized property mapping. |
Undocumented
| Value |
|