aws / aws/aws-xray-sdk-python

disable xray at runtime

Open
#172 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
338
Forks
147
PR merge metrics
No merged PRs in 30d

Description

On my django project, xray is configured to trace db queries.

In this use casem is it possible to disable / re-enable xray at runtime? What I want to do is,

```
from aws_xray_sdk import global_sdk_config

global_sdk_config.set_sdk_enabled(False) # Disable xray

## Do stuff with xray disabled

del os.environ['AWS_XRAY_SDK_ENABLED'] # Re-enable xray
global_sdk_config.set_sdk_enabled(True)
```

When I run the code like this, I still get error logs from xray (and my main problem is addressed here: https://github.com/aws/aws-xray-sdk-python/issues/21 , but the suggested solution did not solve the issue for me)

And I could not understand from the docs whether
`global_sdk_config.set_sdk_enabled(False)`
would disable xray at runtime or if it was designed to disable xray before running an application.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.