Skip to content

Commit 7a93c1a

Browse files
Add documentation for ignoring httplib requests
1 parent f1b2989 commit 7a93c1a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,27 @@ XRayMiddleware(app, xray_recorder)
473473
db = XRayFlaskSqlAlchemy(app)
474474

475475
```
476+
477+
### Ignoring httplib requests
478+
479+
If you want to ignore certain httplib requests you can do so based on the hostname or URL that is being requsted.
480+
481+
```python
482+
from aws_xray_sdk.ext.httplib import add_ignored as xray_add_ignored
483+
484+
# ignore requests to test.myapp.com
485+
xray_add_ignored(hostname='test.myapp.com')
486+
487+
# ignore requests to a subdomain of myapp.com with a glob pattern
488+
xray_add_ignored(hostname='*.myapp.com')
489+
490+
# ignore requests to /test-url and /other-test-url
491+
xray_add_ignored(urls=['/test-path', '/other-test-path'])
492+
493+
# ignore requests to myapp.com for /test-url
494+
xray_add_ignored(hostname='myapp.com', urls=['/test-url'])
495+
```
496+
476497
## License
477498

478499
The AWS X-Ray SDK for Python is licensed under the Apache 2.0 License. See LICENSE and NOTICE.txt for more information.

0 commit comments

Comments
 (0)