Skip to content

docs(tracer): Fix Tracer typing hinting for Pycharm #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions aws_lambda_powertools/tracing/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ class Tracer:
`Env POWERTOOLS_TRACE_DISABLED="true"`
patch_modules: Tuple[str]
Tuple of modules supported by tracing provider to patch, by default all modules are patched
provider: BaseProvider
Tracing provider, by default it is aws_xray_sdk.core.xray_recorder

Returns
-------
Tracer
Tracer instance with imported modules patched

Example
-------
Expand Down Expand Up @@ -123,17 +130,12 @@ def handler(event: dict, context: Any) -> Dict:
tracer = Tracer()
...

Returns
-------
Tracer
Tracer instance with imported modules patched

Limitations
-----------
* Async handler not supported
"""

_default_config = {
_default_config: Dict[str, Any] = {
"service": "service_undefined",
"disabled": False,
"auto_patch": True,
Expand All @@ -153,7 +155,7 @@ def __init__(
self.__build_config(
service=service, disabled=disabled, auto_patch=auto_patch, patch_modules=patch_modules, provider=provider
)
self.provider = self._config["provider"]
self.provider: BaseProvider = self._config["provider"]
self.disabled = self._config["disabled"]
self.service = self._config["service"]
self.auto_patch = self._config["auto_patch"]
Expand Down