Skip to content

Commit e175a11

Browse files
ref: Make stream_gen_ai_spans opt out
1 parent e7262e9 commit e175a11

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ def __init__(
13281328
before_send_metric: "Optional[Callable[[Metric, Hint], Optional[Metric]]]" = None,
13291329
org_id: "Optional[str]" = None,
13301330
strict_trace_continuation: bool = False,
1331-
stream_gen_ai_spans: bool = False,
1331+
stream_gen_ai_spans: bool = True,
13321332
) -> None:
13331333
"""Initialize the Sentry SDK with the given parameters. All parameters described here can be used in a call to `sentry_sdk.init()`.
13341334

sentry_sdk/tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def finish(
10421042

10431043
finished_spans = []
10441044
has_gen_ai_span = False
1045-
if client.options.get("stream_gen_ai_spans", False):
1045+
if client.options.get("stream_gen_ai_spans", True):
10461046
for span in self._span_recorder.spans:
10471047
if span.timestamp is None:
10481048
continue

sentry_sdk/tracing_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def should_truncate_gen_ai_input(options: "Optional[dict[str, Any]]") -> bool:
121121
return True
122122

123123
return not options.get(
124-
"stream_gen_ai_spans", False
124+
"stream_gen_ai_spans", True
125125
) and not has_span_streaming_enabled(options)
126126

127127

0 commit comments

Comments
 (0)