-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[aws-xray-sdk] Annotate more #15004
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
[aws-xray-sdk] Annotate more #15004
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,13 +1,21 @@ | ||
| from asyncio.events import AbstractEventLoop | ||
| from asyncio.tasks import Task, _TaskCompatibleCoro | ||
| from typing import Any, TypeVar | ||
|
|
||
| from .context import Context as _Context | ||
|
|
||
| _T_co = TypeVar("_T_co", covariant=True) | ||
|
|
||
| class AsyncContext(_Context): | ||
| def __init__(self, *args, loop=None, use_task_factory: bool = True, **kwargs) -> None: ... | ||
| def __init__( | ||
| self, context_missing: str = "LOG_ERROR", loop: AbstractEventLoop | None = None, use_task_factory: bool = True | ||
| ) -> None: ... | ||
| def clear_trace_entities(self) -> None: ... | ||
|
|
||
| class TaskLocalStorage: | ||
| def __init__(self, loop=None) -> None: ... | ||
| def __init__(self, loop: AbstractEventLoop | None = None) -> None: ... | ||
| def __setattr__(self, name: str, value) -> None: ... | ||
| def __getattribute__(self, item: str): ... | ||
| def __getattribute__(self, item: str) -> Any: ... | ||
| def clear(self) -> None: ... | ||
|
|
||
| def task_factory(loop, coro): ... | ||
| def task_factory(loop: AbstractEventLoop | None, coro: _TaskCompatibleCoro[_T_co]) -> Task[_T_co]: ... | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,24 +1,43 @@ | ||
| from _typeshed import Incomplete | ||
| from collections.abc import Awaitable, Callable, Iterable, Mapping | ||
| from types import TracebackType | ||
| from typing import TypeVar | ||
|
|
||
| from .models.segment import SegmentContextManager | ||
| from .models.subsegment import SubsegmentContextManager | ||
| from .models.dummy_entities import DummySegment, DummySubsegment | ||
| from .models.segment import Segment, SegmentContextManager | ||
| from .models.subsegment import Subsegment, SubsegmentContextManager | ||
| from .recorder import AWSXRayRecorder | ||
|
|
||
| _T = TypeVar("_T") | ||
|
|
||
| class AsyncSegmentContextManager(SegmentContextManager): | ||
| async def __aenter__(self): ... | ||
| async def __aenter__(self) -> DummySegment | Segment: ... | ||
| async def __aexit__( | ||
| self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None | ||
| ) -> None: ... | ||
|
|
||
| class AsyncSubsegmentContextManager(SubsegmentContextManager): | ||
| async def __call__(self, wrapped, instance, args, kwargs): ... | ||
| async def __aenter__(self): ... | ||
| async def __call__( | ||
| self, wrapped: Callable[..., Awaitable[_T]], instance, args: Iterable[Incomplete], kwargs: Mapping[str, Incomplete] | ||
| ) -> _T: ... | ||
| async def __aenter__(self) -> DummySubsegment | Subsegment | None: ... | ||
| async def __aexit__( | ||
| self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None | ||
| ) -> None: ... | ||
|
|
||
| class AsyncAWSXRayRecorder(AWSXRayRecorder): | ||
| def capture_async(self, name=None): ... | ||
| def in_segment_async(self, name=None, **segment_kwargs): ... | ||
| def in_subsegment_async(self, name=None, **subsegment_kwargs): ... | ||
| async def record_subsegment_async(self, wrapped, instance, args, kwargs, name, namespace, meta_processor): ... | ||
| def capture_async(self, name: str | None = None) -> AsyncSubsegmentContextManager: ... | ||
| def in_segment_async( | ||
| self, name: str | None = None, *, traceid: str | None = None, parent_id: str | None = None, sampling: bool | None = None | ||
| ) -> AsyncSegmentContextManager: ... | ||
| def in_subsegment_async(self, name: str | None = None, *, namespace: str = "local") -> AsyncSubsegmentContextManager: ... | ||
| async def record_subsegment_async( | ||
| self, | ||
| wrapped: Callable[..., Awaitable[_T]], | ||
| instance, | ||
| args: Iterable[Incomplete], | ||
| kwargs: Mapping[str, Incomplete], | ||
| name: str, | ||
| namespace: str, | ||
| meta_processor: Callable[..., object] | None, | ||
| ) -> _T: ... |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,27 +1,27 @@ | ||
| import time | ||
| from logging import Logger | ||
| from typing import Any | ||
| from typing import Final | ||
|
|
||
| from .models.entity import Entity | ||
| from .models.segment import Segment | ||
| from .models.subsegment import Subsegment | ||
|
|
||
| log: Logger | ||
| SUPPORTED_CONTEXT_MISSING: Any | ||
| MISSING_SEGMENT_MSG: str | ||
| CXT_MISSING_STRATEGY_KEY: str | ||
| MISSING_SEGMENT_MSG: Final[str] | ||
| SUPPORTED_CONTEXT_MISSING: Final = ("RUNTIME_ERROR", "LOG_ERROR", "IGNORE_ERROR") | ||
| CXT_MISSING_STRATEGY_KEY: Final = "AWS_XRAY_CONTEXT_MISSING" | ||
|
|
||
| class Context: | ||
| def __init__(self, context_missing: str = "LOG_ERROR") -> None: ... | ||
| def put_segment(self, segment: Segment) -> None: ... | ||
| def end_segment(self, end_time: time.struct_time | None = None) -> None: ... | ||
| def put_subsegment(self, subsegment: Subsegment) -> None: ... | ||
| def end_subsegment(self, end_time: time.struct_time | None = None): ... | ||
| def get_trace_entity(self): ... | ||
| def end_subsegment(self, end_time: time.struct_time | None = None) -> bool: ... | ||
| def get_trace_entity(self) -> Entity: ... | ||
| def set_trace_entity(self, trace_entity: Entity) -> None: ... | ||
| def clear_trace_entities(self) -> None: ... | ||
| def handle_context_missing(self) -> None: ... | ||
| @property | ||
| def context_missing(self): ... | ||
| def context_missing(self) -> str: ... | ||
| @context_missing.setter | ||
| def context_missing(self, value: str) -> None: ... |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| DAEMON_ADDRESS_KEY: str | ||
| DEFAULT_ADDRESS: str | ||
| from typing import Final | ||
|
|
||
| DAEMON_ADDRESS_KEY: Final = "AWS_XRAY_DAEMON_ADDRESS" | ||
| DEFAULT_ADDRESS: Final = "127.0.0.1:2000" | ||
|
|
||
| class DaemonConfig: | ||
| def __init__(self, daemon_address="127.0.0.1:2000") -> None: ... | ||
| def __init__(self, daemon_address: str | None = "127.0.0.1:2000") -> None: ... | ||
| @property | ||
| def udp_ip(self): ... | ||
| def udp_ip(self) -> str: ... | ||
| @property | ||
| def udp_port(self): ... | ||
| def udp_port(self) -> int: ... | ||
| @property | ||
| def tcp_ip(self): ... | ||
| def tcp_ip(self) -> str: ... | ||
| @property | ||
| def tcp_port(self): ... | ||
| def tcp_port(self) -> int: ... |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,23 +1,19 @@ | ||
| from logging import Logger | ||
| from typing import Final | ||
|
|
||
| from .context import Context | ||
|
|
||
| log: Logger | ||
| LAMBDA_TRACE_HEADER_KEY: str | ||
| LAMBDA_TASK_ROOT_KEY: str | ||
| TOUCH_FILE_DIR: str | ||
| TOUCH_FILE_PATH: str | ||
| LAMBDA_TRACE_HEADER_KEY: Final = "_X_AMZN_TRACE_ID" | ||
| LAMBDA_TASK_ROOT_KEY: Final = "LAMBDA_TASK_ROOT" | ||
| TOUCH_FILE_DIR: Final = "/tmp/.aws-xray/" | ||
| TOUCH_FILE_PATH: Final = "/tmp/.aws-xray/initialized" | ||
|
|
||
| def check_in_lambda(): ... | ||
| def check_in_lambda() -> LambdaContext | None: ... | ||
|
|
||
| class LambdaContext(Context): | ||
| def __init__(self) -> None: ... | ||
| def put_segment(self, segment) -> None: ... | ||
| def end_segment(self, end_time=None) -> None: ... | ||
| def put_subsegment(self, subsegment) -> None: ... | ||
| def get_trace_entity(self): ... | ||
| @property | ||
| @property # type: ignore[override] | ||
| def context_missing(self) -> None: ... | ||
| @context_missing.setter | ||
| def context_missing(self, value) -> None: ... | ||
| def handle_context_missing(self) -> None: ... | ||
| def context_missing(self, value: str) -> None: ... |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| from typing import Final | ||
|
|
||
| URL: Final[str] | ||
| METHOD: Final[str] | ||
| USER_AGENT: Final[str] | ||
| CLIENT_IP: Final[str] | ||
| X_FORWARDED_FOR: Final[str] | ||
| STATUS: Final[str] | ||
| CONTENT_LENGTH: Final[str] | ||
| XRAY_HEADER: Final[str] | ||
| ALT_XRAY_HEADER: Final[str] | ||
| URL: Final = "url" | ||
| METHOD: Final = "method" | ||
| USER_AGENT: Final = "user_agent" | ||
| CLIENT_IP: Final = "client_ip" | ||
| X_FORWARDED_FOR: Final = "x_forwarded_for" | ||
| STATUS: Final = "status" | ||
| CONTENT_LENGTH: Final = "content_length" | ||
| XRAY_HEADER: Final = "X-Amzn-Trace-Id" | ||
| ALT_XRAY_HEADER: Final = "HTTP_X_AMZN_TRACE_ID" | ||
| request_keys: tuple[str, ...] | ||
| response_keys: tuple[str, ...] |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.