diff --git a/sentry_sdk/profiler.py b/sentry_sdk/profiler.py index 28ccdb62dc..e983f8367b 100644 --- a/sentry_sdk/profiler.py +++ b/sentry_sdk/profiler.py @@ -574,10 +574,6 @@ def _set_initial_sampling_decision(self, sampling_context): ) ) - def get_profile_context(self): - # type: () -> ProfileContext - return {"profile_id": self.event_id} - def start(self): # type: () -> None if not self.sampled or self.active: diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py index 296fe752bb..a01143a574 100644 --- a/sentry_sdk/tracing.py +++ b/sentry_sdk/tracing.py @@ -631,7 +631,6 @@ def finish(self, hub=None, end_timestamp=None): if self._profile is not None and self._profile.valid(): event["profile"] = self._profile - contexts.update({"profile": self._profile.get_profile_context()}) self._profile = None event["measurements"] = self._measurements diff --git a/tests/test_profiler.py b/tests/test_profiler.py index fabde9fa8a..b0e8925be4 100644 --- a/tests/test_profiler.py +++ b/tests/test_profiler.py @@ -233,37 +233,6 @@ def test_profiles_sampler( assert len(items["profile"]) == profile_count -@mock.patch("sentry_sdk.profiler.PROFILE_MINIMUM_SAMPLES", 0) -def test_profile_context( - sentry_init, - capture_envelopes, - teardown_profiling, -): - sentry_init( - traces_sample_rate=1.0, - _experiments={"profiles_sample_rate": 1.0}, - ) - - envelopes = capture_envelopes() - - with start_transaction(name="profiling"): - pass - - items = defaultdict(list) - for envelope in envelopes: - for item in envelope.items: - items[item.type].append(item) - - assert len(items["transaction"]) == 1 - assert len(items["profile"]) == 1 - - transaction = items["transaction"][0] - profile = items["profile"][0] - assert transaction.payload.json["contexts"]["profile"] == { - "profile_id": profile.payload.json["event_id"], - } - - def test_minimum_unique_samples_required( sentry_init, capture_envelopes,