Skip to content

Commit e618c0b

Browse files
committed
is_segment, remove prints
1 parent edaf05d commit e618c0b

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

sentry_sdk/_span_batcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def _span_to_transport_format(span):
128128
# type: (Span) -> SpanV2
129129
from sentry_sdk.utils import attribute_value_to_transport_format, safe_repr
130130

131-
is_segment = isinstance(span, Transaction)
131+
is_segment = span.containing_transaction == span
132132

133133
res = {
134134
"trace_id": span.trace_id,
@@ -137,7 +137,7 @@ def _span_to_transport_format(span):
137137
"status": SPANSTATUS.OK
138138
if span.status in (SPANSTATUS.OK, SPANSTATUS.UNSET)
139139
else SPANSTATUS.ERROR,
140-
"is_segment": span.containing_transaction == span,
140+
"is_segment": is_segment,
141141
"start_timestamp": span.start_timestamp.timestamp(), # TODO[span-first]
142142
"end_timestamp": span.timestamp.timestamp(),
143143
}

sentry_sdk/transport.py

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -471,30 +471,12 @@ def _send_envelope(self, envelope):
471471
if content_encoding:
472472
headers["Content-Encoding"] = content_encoding
473473

474-
print("ENVELOPE")
475-
print(envelope.headers)
476-
for i, item in enumerate(envelope.items):
477-
print("Item", i, item.type)
478-
print("Headers")
479-
print(item.headers)
480-
print("Attributes")
481-
if item.payload.json.get("items"):
482-
for i in item.payload.json["items"]:
483-
for attribute, value in i["attributes"].items():
484-
print(attribute, value)
485-
print("Payload")
486-
print(item.payload.json)
487-
print()
488-
489-
print("-----------------------------------")
490-
print()
491-
492-
# self._send_request(
493-
# body.getvalue(),
494-
# headers=headers,
495-
# endpoint_type=EndpointType.ENVELOPE,
496-
# envelope=envelope,
497-
# )
474+
self._send_request(
475+
body.getvalue(),
476+
headers=headers,
477+
endpoint_type=EndpointType.ENVELOPE,
478+
envelope=envelope,
479+
)
498480
return None
499481

500482
def _serialize_envelope(self, envelope):

0 commit comments

Comments
 (0)