From 2e3013c3e3804fdbd701173bdbef818d61256a60 Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Wed, 5 May 2021 12:37:15 -0400 Subject: [PATCH 1/7] feat: Emit breakdowns for all transactions --- src/sentry/relay/config.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sentry/relay/config.py b/src/sentry/relay/config.py index fe101ba175a534..fdb4a51f97ca95 100644 --- a/src/sentry/relay/config.py +++ b/src/sentry/relay/config.py @@ -162,10 +162,9 @@ def get_project_config(project, full_config=True, project_keys=None): if dynamic_sampling is not None: cfg["config"]["dynamicSampling"] = dynamic_sampling - if features.has("organizations:performance-ops-breakdown", project.organization): - breakdowns_config = project.get_option("sentry:breakdowns") - if breakdowns_config is not None: - cfg["config"]["breakdowns"] = breakdowns_config + breakdowns_config = project.get_option("sentry:breakdowns") + if breakdowns_config is not None: + cfg["config"]["breakdowns"] = breakdowns_config if not full_config: # This is all we need for external Relay processors From 9c2ca0fa24a6f977dda9dc9a4517f79d01b016ee Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Wed, 5 May 2021 15:20:17 -0400 Subject: [PATCH 2/7] update snapshots --- .../ops_breakdown/full_config.pysnap | 10 +++++++++- .../ops_breakdown/slim_config.pysnap | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap index 40c28a5c65fe90..a923ce1d1b8ff1 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap @@ -1,11 +1,19 @@ --- -created: '2021-04-26T06:44:48.376070Z' +created: '2021-05-05T19:19:39.085628Z' creator: sentry source: tests/sentry/relay/test_config.py --- config: allowedDomains: - '*' + breakdowns: + span_ops: + matches: + - http + - db + - browser + - resource + type: span_operations datascrubbingSettings: excludeFields: [] scrubData: true diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap index f8ce5412baeb65..ac252915cbbdb3 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap @@ -1,11 +1,19 @@ --- -created: '2021-04-26T06:44:48.135605Z' +created: '2021-05-05T19:19:38.878795Z' creator: sentry source: tests/sentry/relay/test_config.py --- config: allowedDomains: - '*' + breakdowns: + span_ops: + matches: + - http + - db + - browser + - resource + type: span_operations datascrubbingSettings: excludeFields: [] scrubData: true From a227ac5ad5c9bc7190328ba829e342d53a8a8e17 Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Tue, 11 May 2021 17:42:58 -0400 Subject: [PATCH 3/7] modify relay project config tests to bypass span_ops within breakdowns dictionary --- .../sentry/api/endpoints/test_relay_projectconfigs.py | 11 +++++++---- .../api/endpoints/test_relay_projectconfigs_v2.py | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/sentry/api/endpoints/test_relay_projectconfigs.py b/tests/sentry/api/endpoints/test_relay_projectconfigs.py index 185c705664d0bc..72ae1fae73fd3d 100644 --- a/tests/sentry/api/endpoints/test_relay_projectconfigs.py +++ b/tests/sentry/api/endpoints/test_relay_projectconfigs.py @@ -16,10 +16,13 @@ def _get_all_keys(config): - for key in config: - yield key - if isinstance(config[key], dict): - for key in _get_all_keys(config[key]): + for config_key in config: + yield config_key + if isinstance(config[config_key], dict): + for key in _get_all_keys(config[config_key]): + # Bypass operations breakdown key + if config_key == 'breakdowns' and key == 'span_ops': + continue yield key diff --git a/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py b/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py index e721d91d9fe745..bfe17d9a45ca77 100644 --- a/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py +++ b/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py @@ -16,10 +16,13 @@ def _get_all_keys(config): - for key in config: - yield key - if isinstance(config[key], dict): - for key in _get_all_keys(config[key]): + for config_key in config: + yield config_key + if isinstance(config[config_key], dict): + for key in _get_all_keys(config[config_key]): + # Bypass operations breakdown key + if config_key == 'breakdowns' and key == 'span_ops': + continue yield key From 648e48ae01afe0349db8821122d6bffc8c3188bb Mon Sep 17 00:00:00 2001 From: "sentry-internal-tools[bot]" <66042841+sentry-internal-tools[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 21:44:00 +0000 Subject: [PATCH 4/7] style(lint): Auto commit lint changes --- tests/sentry/api/endpoints/test_relay_projectconfigs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sentry/api/endpoints/test_relay_projectconfigs.py b/tests/sentry/api/endpoints/test_relay_projectconfigs.py index 72ae1fae73fd3d..d37d66c32e803e 100644 --- a/tests/sentry/api/endpoints/test_relay_projectconfigs.py +++ b/tests/sentry/api/endpoints/test_relay_projectconfigs.py @@ -21,7 +21,7 @@ def _get_all_keys(config): if isinstance(config[config_key], dict): for key in _get_all_keys(config[config_key]): # Bypass operations breakdown key - if config_key == 'breakdowns' and key == 'span_ops': + if config_key == "breakdowns" and key == "span_ops": continue yield key From 0c4afa724267da2a57272da050a0a5f238b67209 Mon Sep 17 00:00:00 2001 From: "sentry-internal-tools[bot]" <66042841+sentry-internal-tools[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 21:44:58 +0000 Subject: [PATCH 5/7] style(lint): Auto commit lint changes --- tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py b/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py index bfe17d9a45ca77..0696b4751a4b26 100644 --- a/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py +++ b/tests/sentry/api/endpoints/test_relay_projectconfigs_v2.py @@ -21,7 +21,7 @@ def _get_all_keys(config): if isinstance(config[config_key], dict): for key in _get_all_keys(config[config_key]): # Bypass operations breakdown key - if config_key == 'breakdowns' and key == 'span_ops': + if config_key == "breakdowns" and key == "span_ops": continue yield key From 58734577795e66d3216f2043cdece4c03ce71061 Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Thu, 13 May 2021 18:13:13 -0400 Subject: [PATCH 6/7] rename span_operations to spanOperations --- src/sentry/projectoptions/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/projectoptions/defaults.py b/src/sentry/projectoptions/defaults.py index d48f334e756246..d42ce4ed0c7571 100644 --- a/src/sentry/projectoptions/defaults.py +++ b/src/sentry/projectoptions/defaults.py @@ -70,7 +70,7 @@ epoch_defaults={ 1: { "span_ops": { - "type": "span_operations", + "type": "spanOperations", "matches": ["http", "db", "browser", "resource"], } }, From a32e32c6395e948e3a8995d262f661153d890c4a Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Thu, 13 May 2021 18:17:10 -0400 Subject: [PATCH 7/7] update pysnap --- .../no_ops_breakdown/full_config.pysnap | 4 ++-- .../no_ops_breakdown/slim_config.pysnap | 4 ++-- .../test_get_project_config/ops_breakdown/full_config.pysnap | 4 ++-- .../test_get_project_config/ops_breakdown/slim_config.pysnap | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/full_config.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/full_config.pysnap index c49e536af0d696..ec5eed04b49c7c 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/full_config.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/full_config.pysnap @@ -1,5 +1,5 @@ --- -created: '2021-04-26T06:44:48.641788Z' +created: '2021-05-13T22:16:37.531016Z' creator: sentry source: tests/sentry/relay/test_config.py --- @@ -13,7 +13,7 @@ config: - db - browser - resource - type: span_operations + type: spanOperations datascrubbingSettings: excludeFields: [] scrubData: true diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/slim_config.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/slim_config.pysnap index 759723d139e5b3..c715b3eb926c06 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/slim_config.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/no_ops_breakdown/slim_config.pysnap @@ -1,5 +1,5 @@ --- -created: '2021-04-26T06:44:48.504933Z' +created: '2021-05-13T22:16:37.389823Z' creator: sentry source: tests/sentry/relay/test_config.py --- @@ -13,7 +13,7 @@ config: - db - browser - resource - type: span_operations + type: spanOperations datascrubbingSettings: excludeFields: [] scrubData: true diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap index a923ce1d1b8ff1..0354cff4a3e8c0 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/full_config.pysnap @@ -1,5 +1,5 @@ --- -created: '2021-05-05T19:19:39.085628Z' +created: '2021-05-13T22:16:37.268371Z' creator: sentry source: tests/sentry/relay/test_config.py --- @@ -13,7 +13,7 @@ config: - db - browser - resource - type: span_operations + type: spanOperations datascrubbingSettings: excludeFields: [] scrubData: true diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap index ac252915cbbdb3..210b14e50f95e8 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/ops_breakdown/slim_config.pysnap @@ -1,5 +1,5 @@ --- -created: '2021-05-05T19:19:38.878795Z' +created: '2021-05-13T22:16:37.059214Z' creator: sentry source: tests/sentry/relay/test_config.py --- @@ -13,7 +13,7 @@ config: - db - browser - resource - type: span_operations + type: spanOperations datascrubbingSettings: excludeFields: [] scrubData: true