Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sentry_sdk/_batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ def _add_to_envelope(self, envelope: "Envelope") -> None:
},
payload=PayloadRef(
json={
"version": 2,
"items": [
self._to_transport_format(item) for item in self._buffer
]
],
Comment thread
cursor[bot] marked this conversation as resolved.
}
),
)
Expand Down
3 changes: 2 additions & 1 deletion sentry_sdk/_span_batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ def _flush(self, only_pending: bool = False) -> None:
},
payload=PayloadRef(
json={
"version": 2,
"items": [
self._to_transport_format(spans[j])
for j in range(start, end)
]
],
}
),
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def test_transport_format(sentry_init, capture_envelopes):
"content_type": "application/vnd.sentry.items.log+json",
}
assert item.payload.json == {
"version": 2,
"items": [
{
"body": "This is a log...",
Expand Down Expand Up @@ -504,7 +505,7 @@ def test_transport_format(sentry_init, capture_envelopes):
},
},
}
]
],
}


Expand Down
3 changes: 2 additions & 1 deletion tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def test_transport_format(sentry_init, capture_envelopes):
"content_type": "application/vnd.sentry.items.trace-metric+json",
}
assert item.payload.json == {
"version": 2,
"items": [
{
"name": "test.counter",
Expand Down Expand Up @@ -297,7 +298,7 @@ def test_transport_format(sentry_init, capture_envelopes):
},
},
}
]
],
}


Expand Down
3 changes: 2 additions & 1 deletion tests/tracing/test_span_batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def test_transport_format(sentry_init, capture_envelopes):
"content_type": "application/vnd.sentry.items.span.v2+json",
}
assert item.payload.json == {
"version": 2,
"items": [
{
"trace_id": mock.ANY,
Expand All @@ -417,7 +418,7 @@ def test_transport_format(sentry_init, capture_envelopes):
"end_timestamp": mock.ANY,
"attributes": mock.ANY,
}
]
],
}
for attribute, value in item.payload.json["items"][0]["attributes"].items():
assert isinstance(attribute, str)
Expand Down
Loading