Skip to content

Commit 10cb3a9

Browse files
committed
docs: make sensitive info more explicit with an example
Signed-off-by: heitorlessa <[email protected]>
1 parent 3faf915 commit 10cb3a9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/content/core/tracer.mdx

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ Tracer is an opinionated thin wrapper for [AWS X-Ray Python SDK](https://github.
1717
* Support tracing async methods, generators, and context managers
1818
* Auto patch supported modules, or a tuple of explicit modules supported by AWS X-Ray
1919

20-
<Note type="warning">
21-
<strong>Returning sensitive information from your Lambda handler or functions, where Tracer is used?</strong>
22-
<br/><br/>
23-
You can disable Tracer from capturing their responses as tracing metadata with <strong><code>capture_response=False</code></strong> parameter in both capture_lambda_handler and capture_method decorators.
24-
</Note><br/>
25-
2620
## Initialization
2721

2822
Your AWS Lambda function must have permission to send traces to AWS X-Ray - Here is an example using AWS Serverless Application Model (SAM)
@@ -69,7 +63,15 @@ def handler(event, context):
6963
charge_id = event.get('charge_id')
7064
payment = collect_payment(charge_id)
7165
...
66+
```
67+
68+
<Note type="warning">
69+
<strong>Returning sensitive information from your Lambda handler or functions, where Tracer is used?</strong>
70+
<br/><br/>
71+
You can disable Tracer from capturing their responses as tracing metadata with <strong><code>capture_response=False</code></strong> parameter in both capture_lambda_handler and capture_method decorators.
72+
</Note><br/>
7273

74+
```python:title=do_not_capture_response_as_metadata.py
7375
# Disables Tracer from capturing response and adding as metadata
7476
# Useful when dealing with sensitive data
7577
@tracer.capture_lambda_handler(capture_response=False) # highlight-line

0 commit comments

Comments
 (0)