Skip to content

Commit 82b5065

Browse files
committed
Update docs
1 parent ea9644f commit 82b5065

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

CHANGELOG.rst

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
CHANGELOG
33
=========
44

5+
unreleased
6+
==========
7+
feature: Stream dbapi2 SQL queries and add flag to toggle their streaming
8+
59
2.2.0
610
=====
711
* feature: Added context managers on segment/subsegment capture. `PR97 <https://github.com/aws/aws-xray-sdk-python/pull/97>`_.
@@ -32,11 +36,11 @@ CHANGELOG
3236
* **Breaking**: The original sampling modules for local defined rules are moved from `models.sampling` to `models.sampling.local`.
3337
* **Breaking**: The default behavior of `patch_all` changed to selectively patches libraries to avoid double patching. You can use `patch_all(double_patch=True)` to force it to patch ALL supported libraries. See more details on `ISSUE63 <https://github.com/aws/aws-xray-sdk-python/issues/63>`_
3438
* **Breaking**: The latest `botocore` that has new X-Ray service API `GetSamplingRules` and `GetSamplingTargets` are required.
35-
* **Breaking**: Version 2.x doesn't support pynamodb and aiobotocore as it requires botocore >= 1.11.3 which isn’t currently supported by the pynamodb and aiobotocore libraries. Please continue to use version 1.x if you’re using pynamodb or aiobotocore until those haven been updated to use botocore > = 1.11.3.
39+
* **Breaking**: Version 2.x doesn't support pynamodb and aiobotocore as it requires botocore >= 1.11.3 which isn’t currently supported by the pynamodb and aiobotocore libraries. Please continue to use version 1.x if you’re using pynamodb or aiobotocore until those haven been updated to use botocore > = 1.11.3.
3640
* feature: Environment variable `AWS_XRAY_DAEMON_ADDRESS` now takes an additional notation in `tcp:127.0.0.1:2000 udp:127.0.0.2:2001` to set TCP and UDP destination separately. By default it assumes a X-Ray daemon listening to both UDP and TCP traffic on `127.0.0.1:2000`.
3741
* feature: Added MongoDB python client support. `PR65 <https://github.com/aws/aws-xray-sdk-python/pull/65>`_.
38-
* bugfix: Support binding connection in sqlalchemy as well as engine. `PR78 <https://github.com/aws/aws-xray-sdk-python/pull/78>`_.
39-
* bugfix: Flask middleware safe request teardown. `ISSUE75 <https://github.com/aws/aws-xray-sdk-python/issues/75>`_.
42+
* bugfix: Support binding connection in sqlalchemy as well as engine. `PR78 <https://github.com/aws/aws-xray-sdk-python/pull/78>`_.
43+
* bugfix: Flask middleware safe request teardown. `ISSUE75 <https://github.com/aws/aws-xray-sdk-python/issues/75>`_.
4044

4145

4246
1.1.2
@@ -68,7 +72,7 @@ CHANGELOG
6872
* bugfix: Fixed an issue where arbitrary fields in trace header being dropped when calling downstream.
6973
* bugfix: Fixed a compatibility issue between botocore and httplib patcher. `ISSUE48 <https://github.com/aws/aws-xray-sdk-python/issues/48>`_.
7074
* bugfix: Fixed a typo in sqlalchemy decorators. `PR50 <https://github.com/aws/aws-xray-sdk-python/pull/50>`_.
71-
* Updated `README` with more usage examples.
75+
* Updated `README` with more usage examples.
7276

7377
0.97
7478
====

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,20 @@ with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
251251
pass
252252
```
253253

254+
### Trace SQL queries
255+
By default, if no other value is provided to `.configure()`, SQL trace streaming is enabled
256+
for all the supported DB engines. Those currently are:
257+
- Any engine attached to the Django ORM.
258+
- Any engine attached to SQLAlchemy.
259+
- SQLite3.
260+
261+
The behaviour can be toggled by sending the appropriate `stream_sql` value, for example:
262+
```python
263+
from aws_xray_sdk.core import xray_recorder
264+
265+
xray_recorder.configure(service='fallback_name', stream_sql=True)
266+
```
267+
254268
### Patch third-party libraries
255269

256270
```python
@@ -260,7 +274,8 @@ libs_to_patch = ('boto3', 'mysql', 'requests')
260274
patch(libs_to_patch)
261275
```
262276

263-
### Add Django middleware
277+
### Django
278+
#### Add middleware
264279

265280
In django settings.py, use the following.
266281

@@ -275,6 +290,10 @@ MIDDLEWARE = [
275290
# ... other middlewares
276291
]
277292
```
293+
#### SQL tracing
294+
If Django's ORM is patched - either using the `AUTO_INSTRUMENT = True` in your settings file
295+
or explicitly calling `patch_db()` - the SQL query trace streaming can be enabled or disabled
296+
updating the `STREAM_SQL` variable in your settings file.
278297

279298
### Add Flask middleware
280299

0 commit comments

Comments
 (0)