File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,32 @@ def handler(event, context):
221
221
raise ValueError (" some sensitive info in the stack trace..." )
222
222
```
223
223
224
+ ### Ignoring certain HTTP endpoints
225
+
226
+ You might have endpoints you don't want requests to be traced, perhaps due to the volume of calls or sensitive URLs.
227
+
228
+ You can use ` ignore_endpoint ` method with the hostname and/or URLs you'd like it to be ignored - globs (` * ` ) are allowed.
229
+
230
+ ``` python title="Ignoring certain HTTP endpoints from being traced"
231
+ from aws_lambda_powertools import Tracer
232
+
233
+ tracer = Tracer()
234
+ # ignore all calls to `ec2.amazon.com`
235
+ tracer.ignore_endpoint(hostname = " ec2.amazon.com" )
236
+ # ignore calls to `*.sensitive.com/password` and `*.sensitive.com/credit-card`
237
+ tracer.ignore_endpoint(hostname = " *.sensitive.com" , urls = [" /password" , " /credit-card" ])
238
+
239
+
240
+ def ec2_api_calls ():
241
+ return " suppress_api_responses"
242
+
243
+ @tracer.capture_lambda_handler
244
+ def handler (event , context ):
245
+ for x in long_list:
246
+ ec2_api_calls()
247
+ ```
248
+
249
+
224
250
### Tracing aiohttp requests
225
251
226
252
???+ info
You can’t perform that action at this time.
0 commit comments