|
38 | 38 | from typing import Union
|
39 | 39 | from typing import TypeVar
|
40 | 40 |
|
41 |
| - from typing_extensions import TypedDict |
42 |
| - |
43 | 41 | P = ParamSpec("P")
|
44 | 42 | R = TypeVar("R")
|
45 | 43 |
|
|
50 | 48 |
|
51 | 49 | from sentry_sdk.tracing_utils import Baggage
|
52 | 50 |
|
53 |
| - class SpanKwargs(TypedDict, total=False): |
54 |
| - trace_id: str |
55 |
| - """ |
56 |
| - The trace ID of the root span. If this new span is to be the root span, |
57 |
| - omit this parameter, and a new trace ID will be generated. |
58 |
| - """ |
59 |
| - |
60 |
| - span_id: str |
61 |
| - """The span ID of this span. If omitted, a new span ID will be generated.""" |
62 |
| - |
63 |
| - parent_span_id: str |
64 |
| - """The span ID of the parent span, if applicable.""" |
65 |
| - |
66 |
| - same_process_as_parent: bool |
67 |
| - """Whether this span is in the same process as the parent span.""" |
68 |
| - |
69 |
| - sampled: bool |
70 |
| - """ |
71 |
| - Whether the span should be sampled. Overrides the default sampling decision |
72 |
| - for this span when provided. |
73 |
| - """ |
74 |
| - |
75 |
| - op: str |
76 |
| - """ |
77 |
| - The span's operation. A list of recommended values is available here: |
78 |
| - https://develop.sentry.dev/sdk/performance/span-operations/ |
79 |
| - """ |
80 |
| - |
81 |
| - description: str |
82 |
| - """A description of what operation is being performed within the span. This argument is DEPRECATED. Please use the `name` parameter, instead.""" |
83 |
| - |
84 |
| - status: str |
85 |
| - """The span's status. Possible values are listed at https://develop.sentry.dev/sdk/event-payloads/span/""" |
86 |
| - |
87 |
| - containing_transaction: Optional["Span"] |
88 |
| - """The transaction that this span belongs to.""" |
89 |
| - |
90 |
| - start_timestamp: Optional[Union[datetime, float]] |
91 |
| - """ |
92 |
| - The timestamp when the span started. If omitted, the current time |
93 |
| - will be used. |
94 |
| - """ |
95 |
| - |
96 |
| - scope: "sentry_sdk.Scope" |
97 |
| - """The scope to use for this span. If not provided, we use the current scope.""" |
98 |
| - |
99 |
| - origin: Optional[str] |
100 |
| - """ |
101 |
| - The origin of the span. |
102 |
| - See https://develop.sentry.dev/sdk/performance/trace-origin/ |
103 |
| - Default "manual". |
104 |
| - """ |
105 |
| - |
106 |
| - name: str |
107 |
| - """A string describing what operation is being performed within the span/transaction.""" |
108 |
| - |
109 |
| - class TransactionKwargs(SpanKwargs, total=False): |
110 |
| - source: str |
111 |
| - """ |
112 |
| - A string describing the source of the transaction name. This will be used to determine the transaction's type. |
113 |
| - See https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations for more information. |
114 |
| - Default "custom". |
115 |
| - """ |
116 |
| - |
117 |
| - parent_sampled: bool |
118 |
| - """Whether the parent transaction was sampled. If True this transaction will be kept, if False it will be discarded.""" |
119 |
| - |
120 |
| - baggage: "Baggage" |
121 |
| - """The W3C baggage header value. (see https://www.w3.org/TR/baggage/)""" |
122 |
| - |
123 |
| - ProfileContext = TypedDict( |
124 |
| - "ProfileContext", |
125 |
| - { |
126 |
| - "profiler_id": str, |
127 |
| - }, |
128 |
| - ) |
129 |
| - |
130 | 51 | BAGGAGE_HEADER_NAME = "baggage"
|
131 | 52 | SENTRY_TRACE_HEADER_NAME = "sentry-trace"
|
132 | 53 |
|
|
0 commit comments