diff --git a/bin/mock-replay b/bin/mock-replay index 0f4822906480d0..4d6ad03a3fc5f5 100755 --- a/bin/mock-replay +++ b/bin/mock-replay @@ -16,7 +16,9 @@ from sentry.replays.testutils import mock_replay def store_replay(replay): - response = requests.post(settings.SENTRY_SNUBA + "/tests/replays/insert", json=[replay]) + response = requests.post( + settings.SENTRY_SNUBA + "/tests/entities/replays/insert", json=[replay] + ) assert response.status_code == 200 diff --git a/src/sentry/eventstream/snuba.py b/src/sentry/eventstream/snuba.py index a20d6dfdd07b75..b1a35a29ea6a68 100644 --- a/src/sentry/eventstream/snuba.py +++ b/src/sentry/eventstream/snuba.py @@ -392,13 +392,13 @@ def _send( data = (self.EVENT_PROTOCOL_VERSION, _type) + extra_data - dataset = "events" + entity = "events" if is_transaction_event: - dataset = "transactions" + entity = "transactions" try: resp = snuba._snuba_pool.urlopen( "POST", - f"/tests/{dataset}/eventstream", + f"/tests/{entity}/eventstream", body=json.dumps(data), headers={f"X-Sentry-{k}": v for k, v in headers.items()}, ) diff --git a/src/sentry/testutils/cases.py b/src/sentry/testutils/cases.py index 589184105def40..0f46b893649661 100644 --- a/src/sentry/testutils/cases.py +++ b/src/sentry/testutils/cases.py @@ -949,7 +949,7 @@ def wait_for_event_count(self, project_id, total, attempts=2): def bulk_store_sessions(self, sessions): assert ( requests.post( - settings.SENTRY_SNUBA + "/tests/sessions/insert", data=json.dumps(sessions) + settings.SENTRY_SNUBA + "/tests/entities/sessions/insert", data=json.dumps(sessions) ).status_code == 200 ) @@ -988,7 +988,8 @@ def store_group(self, group): data = [self.__wrap_group(group)] assert ( requests.post( - settings.SENTRY_SNUBA + "/tests/groupedmessage/insert", data=json.dumps(data) + settings.SENTRY_SNUBA + "/tests/entities/groupedmessage/insert", + data=json.dumps(data), ).status_code == 200 ) @@ -997,7 +998,7 @@ def store_outcome(self, group): data = [self.__wrap_group(group)] assert ( requests.post( - settings.SENTRY_SNUBA + "/tests/outcomes/insert", data=json.dumps(data) + settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert", data=json.dumps(data) ).status_code == 200 ) @@ -1065,7 +1066,7 @@ def snuba_insert(self, events): assert ( requests.post( - settings.SENTRY_SNUBA + "/tests/events/insert", data=json.dumps(events) + settings.SENTRY_SNUBA + "/tests/entities/events/insert", data=json.dumps(events) ).status_code == 200 ) @@ -1337,7 +1338,7 @@ def store_outcomes(self, outcome, num_times=1): assert ( requests.post( - settings.SENTRY_SNUBA + "/tests/outcomes/insert", data=json.dumps(outcomes) + settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert", data=json.dumps(outcomes) ).status_code == 200 ) @@ -1351,7 +1352,9 @@ def setUp(self): assert requests.post(settings.SENTRY_SNUBA + "/tests/replays/drop").status_code == 200 def store_replays(self, replay): - response = requests.post(settings.SENTRY_SNUBA + "/tests/replays/insert", json=[replay]) + response = requests.post( + settings.SENTRY_SNUBA + "/tests/entities/replays/insert", json=[replay] + ) assert response.status_code == 200 diff --git a/tests/acceptance/test_project_settings_sampling.py b/tests/acceptance/test_project_settings_sampling.py index b099506556f78e..f5955796a7ea63 100644 --- a/tests/acceptance/test_project_settings_sampling.py +++ b/tests/acceptance/test_project_settings_sampling.py @@ -93,7 +93,7 @@ def store_outcomes(self, outcome, num_times=1): assert ( requests.post( - settings.SENTRY_SNUBA + "/tests/outcomes/insert", data=json.dumps(outcomes) + settings.SENTRY_SNUBA + "/tests/entities/outcomes/insert", data=json.dumps(outcomes) ).status_code == 200 )