-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into brettlangdon/system-tests.all
- Loading branch information
Showing
14 changed files
with
62 additions
and
51 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,55 @@ | ||
from enum import Enum | ||
from typing import Any | ||
from typing import Dict | ||
from typing import NamedTuple | ||
from typing import Optional | ||
|
||
from ddtrace._trace._span_link import SpanLink | ||
from ddtrace._trace._span_link import SpanLinkKind | ||
|
||
|
||
_SPAN_POINTER_SPAN_LINK_TRACE_ID = 0 | ||
_SPAN_POINTER_SPAN_LINK_SPAN_ID = 0 | ||
|
||
|
||
class _SpanPointerDirection(Enum): | ||
UPSTREAM = "u" | ||
DOWNSTREAM = "d" | ||
|
||
|
||
class _SpanPointerDescription(NamedTuple): | ||
# Not to be confused with _SpanPointer. This class describes the parameters | ||
# required to attach a span pointer to a Span. It lets us decouple code | ||
# that calculates span pointers from code that actually attaches them to | ||
# the right Span. | ||
|
||
pointer_kind: str | ||
pointer_direction: _SpanPointerDirection | ||
pointer_hash: str | ||
extra_attributes: Dict[str, Any] | ||
|
||
|
||
class _SpanPointer(SpanLink): | ||
def __init__( | ||
self, | ||
pointer_kind: str, | ||
pointer_direction: _SpanPointerDirection, | ||
pointer_hash: str, | ||
extra_attributes: Optional[Dict[str, Any]] = None, | ||
): | ||
super().__init__( | ||
trace_id=_SPAN_POINTER_SPAN_LINK_TRACE_ID, | ||
span_id=_SPAN_POINTER_SPAN_LINK_SPAN_ID, | ||
attributes={ | ||
"ptr.kind": pointer_kind, | ||
"ptr.dir": pointer_direction.value, | ||
"ptr.hash": pointer_hash, | ||
**(extra_attributes or {}), | ||
}, | ||
) | ||
|
||
self.kind = SpanLinkKind.SPAN_POINTER.value | ||
|
||
def __post_init__(self): | ||
# Do not want to do the trace_id and span_id checks that SpanLink does. | ||
pass |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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