Skip to content

Commit bab4359

Browse files
committed
feat(span-streaming): Add experimental trace_lifecycle switch
1 parent e061eb1 commit bab4359

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sentry_sdk/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class CompressionAlgo(Enum):
8282
"before_send_log": Optional[Callable[[Log, Hint], Optional[Log]]],
8383
"enable_metrics": Optional[bool],
8484
"before_send_metric": Optional[Callable[[Metric, Hint], Optional[Metric]]],
85+
"trace_lifecycle": Optional[Literal["static", "stream"]],
8586
},
8687
total=False,
8788
)

sentry_sdk/tracing_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def has_tracing_enabled(options: "Optional[Dict[str, Any]]") -> bool:
106106
)
107107

108108

109+
def has_span_streaming_enabled(options: "Optional[dict[str, Any]]") -> bool:
110+
if options is None:
111+
return False
112+
113+
return (options.get("_experiments") or {}).get("trace_lifecycle") == "stream"
114+
115+
109116
@contextlib.contextmanager
110117
def record_sql_queries(
111118
cursor: "Any",

0 commit comments

Comments
 (0)