Masking
Protect your sensitive information from traces using the masking feature
Overview
Masking allows you to automatically redact or transform sensitive data in your traces before they’re sent to the observatory. Masking is essential for several reasons:
- Security: Prevent exposure of credentials or sensitive business data
- Regulatory Compliance: Meet requirements like GDPR, HIPAA, or CCPA
Configure Masking
To implement masking, you need to define a masking function and configure the trace manager to use it.
Python
TypeScript
main.py
The masking function is automatically applied to:
- Span attributes: Any attributes passed to span decorators or wrappers
- Observed function I/O: all input parameters and return values of functions with
@observedecorator.
Since the masking function is applied to an observed function’s inputs, outputs, and span attributes, it must handle the various data types defined for each field as necessary.
Example Masking functions
Credit card number
Python
TypeScript
main.py
Email address
Python
TypeScript
main.py
Bank account number
Python
TypeScript
main.py
Passport number
Python
TypeScript
main.py