Skip to content

Commit f6f3525

Browse files
authored
ref: Remove traceparent_v2 flag (#795)
1 parent 4e6a88b commit f6f3525

File tree

5 files changed

+3
-13
lines changed

5 files changed

+3
-13
lines changed

examples/tracing/tracing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def write_event(event):
2626
sentry_sdk.init(
2727
integrations=[FlaskIntegration(), RqIntegration()],
2828
traces_sample_rate=1.0,
29-
traceparent_v2=True,
3029
debug=True,
3130
transport=write_event,
3231
)

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"record_sql_params": Optional[bool],
2828
"auto_enabling_integrations": Optional[bool],
2929
"auto_session_tracking": Optional[bool],
30+
"smart_transaction_trimming": Optional[bool],
3031
},
3132
total=False,
3233
)
@@ -63,7 +64,6 @@ def __init__(
6364
ca_certs=None, # type: Optional[str]
6465
propagate_traces=True, # type: bool
6566
traces_sample_rate=0.0, # type: float
66-
traceparent_v2=True, # type: bool
6767
_experiments={}, # type: Experiments # noqa: B006
6868
):
6969
# type: (...) -> None

sentry_sdk/hub.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,12 +685,7 @@ def iter_trace_propagation_headers(self):
685685
if not propagate_traces:
686686
return
687687

688-
if client and client.options["traceparent_v2"]:
689-
traceparent = span.to_traceparent()
690-
else:
691-
traceparent = span.to_legacy_traceparent()
692-
693-
yield "sentry-trace", traceparent
688+
yield "sentry-trace", span.to_traceparent()
694689

695690

696691
GLOBAL_HUB = Hub()

sentry_sdk/tracing.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,6 @@ def to_traceparent(self):
304304
sampled = "0"
305305
return "%s-%s-%s" % (self.trace_id, self.span_id, sampled)
306306

307-
def to_legacy_traceparent(self):
308-
# type: () -> str
309-
return "00-%s-%s-00" % (self.trace_id, self.span_id)
310-
311307
def set_tag(self, key, value):
312308
# type: (str, Any) -> None
313309
self._tags[key] = value

tests/test_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_start_span_to_start_transaction(sentry_init, capture_events):
6565

6666
@pytest.mark.parametrize("sampled", [True, False, None])
6767
def test_continue_from_headers(sentry_init, capture_events, sampled):
68-
sentry_init(traces_sample_rate=1.0, traceparent_v2=True)
68+
sentry_init(traces_sample_rate=1.0)
6969
events = capture_events()
7070

7171
with start_transaction(name="hi"):

0 commit comments

Comments
 (0)