-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuring different Sampler in Django App (#252)
Extended aws_xray_sdk.ext.django app to be able to select Sampler, and avoid being stuck with the DefaultSampler Co-authored-by: Prashant Srivastava <[email protected]>
- Loading branch information
1 parent
f4a3fb4
commit f86e7db
Showing
4 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from unittest import mock | ||
|
||
import django | ||
from aws_xray_sdk import global_sdk_config | ||
from django.test import TestCase, override_settings | ||
from django.conf import settings | ||
from django.apps import apps | ||
|
||
from aws_xray_sdk.core import xray_recorder | ||
from aws_xray_sdk.core.sampling.sampler import LocalSampler | ||
|
||
|
||
class XRayConfigurationTestCase(TestCase): | ||
def test_sampler_can_be_configured(self): | ||
assert isinstance(settings.XRAY_RECORDER['SAMPLER'], LocalSampler) | ||
assert isinstance(xray_recorder.sampler, LocalSampler) |