Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion sentry_sdk/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def add_profile_chunk(
):
# type: (...) -> None
self.add_item(
Item(payload=PayloadRef(json=profile_chunk), type="profile_chunk")
Item(
payload=PayloadRef(json=profile_chunk),
type="profile_chunk",
headers={"platform": profile_chunk.get("platform", "python")},
)
)

def add_checkin(
Expand Down
21 changes: 13 additions & 8 deletions tests/profiler/test_continuous_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ def assert_single_transaction_with_profile_chunks(
if max_chunks is not None:
assert len(items["profile_chunk"]) <= max_chunks

for chunk_item in items["profile_chunk"]:
chunk = chunk_item.payload.json
headers = chunk_item.headers
assert chunk["platform"] == headers["platform"]

transaction = items["transaction"][0].payload.json

trace_context = transaction["contexts"]["trace"]
Expand Down Expand Up @@ -215,12 +220,12 @@ def assert_single_transaction_without_profile_chunks(envelopes):
pytest.param(
start_profile_session,
stop_profile_session,
id="start_profile_session/stop_profile_session",
id="start_profile_session/stop_profile_session (deprecated)",
),
pytest.param(
start_profiler,
stop_profiler,
id="start_profiler/stop_profiler (deprecated)",
id="start_profiler/stop_profiler",
),
],
)
Expand Down Expand Up @@ -292,12 +297,12 @@ def test_continuous_profiler_auto_start_and_manual_stop(
pytest.param(
start_profile_session,
stop_profile_session,
id="start_profile_session/stop_profile_session",
id="start_profile_session/stop_profile_session (deprecated)",
),
pytest.param(
start_profiler,
stop_profiler,
id="start_profiler/stop_profiler (deprecated)",
id="start_profiler/stop_profiler",
),
],
)
Expand Down Expand Up @@ -374,12 +379,12 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
pytest.param(
start_profile_session,
stop_profile_session,
id="start_profile_session/stop_profile_session",
id="start_profile_session/stop_profile_session (deprecated)",
),
pytest.param(
start_profiler,
stop_profiler,
id="start_profiler/stop_profiler (deprecated)",
id="start_profiler/stop_profiler",
),
],
)
Expand Down Expand Up @@ -544,12 +549,12 @@ def test_continuous_profiler_auto_start_and_stop_unsampled(
pytest.param(
start_profile_session,
stop_profile_session,
id="start_profile_session/stop_profile_session",
id="start_profile_session/stop_profile_session (deprecated)",
),
pytest.param(
start_profiler,
stop_profiler,
id="start_profiler/stop_profiler (deprecated)",
id="start_profiler/stop_profiler",
),
],
)
Expand Down
Loading