Skip to content

Commit 6199770

Browse files
committed
feat: Return default operation breakdown list from project options
1 parent 7ae184e commit 6199770

File tree

8 files changed

+349
-13
lines changed

8 files changed

+349
-13
lines changed

src/sentry/api/serializers/models/project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ class DetailedProjectSerializer(ProjectWithTeamSerializer):
567567
"sentry:fingerprinting_rules",
568568
"sentry:relay_pii_config",
569569
"sentry:dynamic_sampling",
570+
"sentry:breakdowns",
570571
"feedback:branding",
571572
"digests:mail:minimum_delay",
572573
"digests:mail:maximum_delay",
@@ -698,6 +699,7 @@ def get_value_with_default(key):
698699
"builtinSymbolSources": get_value_with_default("sentry:builtin_symbol_sources"),
699700
"symbolSources": attrs["options"].get("sentry:symbol_sources"),
700701
"dynamicSampling": get_value_with_default("sentry:dynamic_sampling"),
702+
"breakdowns": get_value_with_default("sentry:breakdowns"),
701703
}
702704
)
703705
return data

src/sentry/projectoptions/defaults.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,16 @@
6262

6363
# Default dynamic sampling rules
6464
register(key="sentry:dynamicSampling", epoch_defaults={1: []})
65+
66+
# Default breakdowns config
67+
register(
68+
key="sentry:breakdowns",
69+
epoch_defaults={
70+
1: {
71+
"span_ops": {
72+
"type": "span_operations",
73+
"matches": ["http", "db", "browser", "resource"],
74+
}
75+
},
76+
},
77+
)

src/sentry/relay/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ def get_project_config(project, full_config=True, project_keys=None):
138138
if dynamic_sampling is not None:
139139
cfg["config"]["dynamicSampling"] = dynamic_sampling
140140

141+
if features.has("organizations:performance-ops-breakdown", project.organization):
142+
breakdowns_config = project.get_option("sentry:breakdowns")
143+
if breakdowns_config is not None:
144+
cfg["config"]["breakdowns"] = breakdowns_config
145+
141146
if not full_config:
142147
# This is all we need for external Relay processors
143148
return ProjectConfig(project, **cfg)
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
created: '2021-03-24T22:52:16.803444Z'
3+
creator: sentry
4+
source: tests/sentry/relay/test_config.py
5+
---
6+
config:
7+
allowedDomains:
8+
- '*'
9+
breakdowns:
10+
span_ops:
11+
matches:
12+
- http
13+
- db
14+
- browser
15+
- resource
16+
type: span_operations
17+
datascrubbingSettings:
18+
excludeFields: []
19+
scrubData: true
20+
scrubDefaults: true
21+
scrubIpAddresses: false
22+
sensitiveFields: []
23+
eventRetention: null
24+
filterSettings:
25+
browserExtensions:
26+
isEnabled: false
27+
csp:
28+
disallowedSources:
29+
- about
30+
- ms-browser-extension
31+
- chrome://*
32+
- chrome-extension://*
33+
- chromeinvokeimmediate://*
34+
- chromenull://*
35+
- data:text/html,chromewebdata
36+
- safari-extension://*
37+
- mxaddon-pkg://*
38+
- jar://*
39+
- webviewprogressproxy://*
40+
- ms-browser-extension://*
41+
- tmtbff://*
42+
- mbinit://*
43+
- symres://*
44+
- resource://*
45+
- moz-extension://*
46+
- '*.metrext.com'
47+
- static.image2play.com
48+
- '*.tlscdn.com'
49+
- 73a5b0806e464be8bd4e694c744624f0.com
50+
- 020dfefc4ac745dab7594f2f771c1ded.com
51+
- '*.superfish.com'
52+
- addons.mozilla.org
53+
- v.zilionfast.in
54+
- widgets.amung.us
55+
- '*.superfish.com'
56+
- xls.searchfun.in
57+
- istatic.datafastguru.info
58+
- v.zilionfast.in
59+
- localhost
60+
- resultshub-a.akamaihd.net
61+
- pulseadnetwork.com
62+
- gateway.zscalertwo.net
63+
- www.passpack.com
64+
- middlerush-a.akamaihd.net
65+
- www.websmartcenter.com
66+
- a.linkluster.com
67+
- saveyoutime.ru
68+
- cdncache-a.akamaihd.net
69+
- x.rafomedia.com
70+
- savingsslider-a.akamaihd.net
71+
- injections.adguard.com
72+
- icontent.us
73+
- amiok.org
74+
- connectionstrenth.com
75+
- siteheart.net
76+
- netanalitics.space
77+
- printapplink.com
78+
- godlinkapp.com
79+
- devappstor.com
80+
- hoholikik.club
81+
- smartlink.cool
82+
- promfflinkdev.com
83+
legacyBrowsers:
84+
isEnabled: false
85+
localhost:
86+
isEnabled: false
87+
webCrawlers:
88+
isEnabled: false
89+
groupingConfig:
90+
enhancements: eJybzDhxY3J-bm5-npWRgaGlroGxrpHxBABcTQcY
91+
id: newstyle:2019-10-29
92+
piiConfig:
93+
applications:
94+
$string:
95+
- organization:remove_ips_and_macs
96+
- project:remove_ips_and_macs
97+
rules:
98+
organization:remove_ips_and_macs:
99+
hide_rule: false
100+
redaction:
101+
method: remove
102+
rules:
103+
- '@ip'
104+
- '@mac'
105+
type: multiple
106+
project:remove_ips_and_macs:
107+
hide_rule: false
108+
redaction:
109+
method: remove
110+
rules:
111+
- '@ip'
112+
- '@mac'
113+
type: multiple
114+
quotas: []
115+
trustedRelays: []
116+
disabled: false
117+
slug: bar
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
created: '2021-03-24T22:52:16.674401Z'
3+
creator: sentry
4+
source: tests/sentry/relay/test_config.py
5+
---
6+
config:
7+
allowedDomains:
8+
- '*'
9+
breakdowns:
10+
span_ops:
11+
matches:
12+
- http
13+
- db
14+
- browser
15+
- resource
16+
type: span_operations
17+
datascrubbingSettings:
18+
excludeFields: []
19+
scrubData: true
20+
scrubDefaults: true
21+
scrubIpAddresses: false
22+
sensitiveFields: []
23+
piiConfig:
24+
applications:
25+
$string:
26+
- organization:remove_ips_and_macs
27+
- project:remove_ips_and_macs
28+
rules:
29+
organization:remove_ips_and_macs:
30+
hide_rule: false
31+
redaction:
32+
method: remove
33+
rules:
34+
- '@ip'
35+
- '@mac'
36+
type: multiple
37+
project:remove_ips_and_macs:
38+
hide_rule: false
39+
redaction:
40+
method: remove
41+
rules:
42+
- '@ip'
43+
- '@mac'
44+
type: multiple
45+
trustedRelays: []
46+
disabled: false
47+
slug: bar
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
created: '2021-03-24T22:52:16.551136Z'
3+
creator: sentry
4+
source: tests/sentry/relay/test_config.py
5+
---
6+
config:
7+
allowedDomains:
8+
- '*'
9+
datascrubbingSettings:
10+
excludeFields: []
11+
scrubData: true
12+
scrubDefaults: true
13+
scrubIpAddresses: false
14+
sensitiveFields: []
15+
eventRetention: null
16+
filterSettings:
17+
browserExtensions:
18+
isEnabled: false
19+
csp:
20+
disallowedSources:
21+
- about
22+
- ms-browser-extension
23+
- chrome://*
24+
- chrome-extension://*
25+
- chromeinvokeimmediate://*
26+
- chromenull://*
27+
- data:text/html,chromewebdata
28+
- safari-extension://*
29+
- mxaddon-pkg://*
30+
- jar://*
31+
- webviewprogressproxy://*
32+
- ms-browser-extension://*
33+
- tmtbff://*
34+
- mbinit://*
35+
- symres://*
36+
- resource://*
37+
- moz-extension://*
38+
- '*.metrext.com'
39+
- static.image2play.com
40+
- '*.tlscdn.com'
41+
- 73a5b0806e464be8bd4e694c744624f0.com
42+
- 020dfefc4ac745dab7594f2f771c1ded.com
43+
- '*.superfish.com'
44+
- addons.mozilla.org
45+
- v.zilionfast.in
46+
- widgets.amung.us
47+
- '*.superfish.com'
48+
- xls.searchfun.in
49+
- istatic.datafastguru.info
50+
- v.zilionfast.in
51+
- localhost
52+
- resultshub-a.akamaihd.net
53+
- pulseadnetwork.com
54+
- gateway.zscalertwo.net
55+
- www.passpack.com
56+
- middlerush-a.akamaihd.net
57+
- www.websmartcenter.com
58+
- a.linkluster.com
59+
- saveyoutime.ru
60+
- cdncache-a.akamaihd.net
61+
- x.rafomedia.com
62+
- savingsslider-a.akamaihd.net
63+
- injections.adguard.com
64+
- icontent.us
65+
- amiok.org
66+
- connectionstrenth.com
67+
- siteheart.net
68+
- netanalitics.space
69+
- printapplink.com
70+
- godlinkapp.com
71+
- devappstor.com
72+
- hoholikik.club
73+
- smartlink.cool
74+
- promfflinkdev.com
75+
legacyBrowsers:
76+
isEnabled: false
77+
localhost:
78+
isEnabled: false
79+
webCrawlers:
80+
isEnabled: false
81+
groupingConfig:
82+
enhancements: eJybzDhxY3J-bm5-npWRgaGlroGxrpHxBABcTQcY
83+
id: newstyle:2019-10-29
84+
piiConfig:
85+
applications:
86+
$string:
87+
- organization:remove_ips_and_macs
88+
- project:remove_ips_and_macs
89+
rules:
90+
organization:remove_ips_and_macs:
91+
hide_rule: false
92+
redaction:
93+
method: remove
94+
rules:
95+
- '@ip'
96+
- '@mac'
97+
type: multiple
98+
project:remove_ips_and_macs:
99+
hide_rule: false
100+
redaction:
101+
method: remove
102+
rules:
103+
- '@ip'
104+
- '@mac'
105+
type: multiple
106+
quotas: []
107+
trustedRelays: []
108+
disabled: false
109+
slug: bar
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
created: '2021-03-24T22:52:16.337094Z'
3+
creator: sentry
4+
source: tests/sentry/relay/test_config.py
5+
---
6+
config:
7+
allowedDomains:
8+
- '*'
9+
datascrubbingSettings:
10+
excludeFields: []
11+
scrubData: true
12+
scrubDefaults: true
13+
scrubIpAddresses: false
14+
sensitiveFields: []
15+
piiConfig:
16+
applications:
17+
$string:
18+
- organization:remove_ips_and_macs
19+
- project:remove_ips_and_macs
20+
rules:
21+
organization:remove_ips_and_macs:
22+
hide_rule: false
23+
redaction:
24+
method: remove
25+
rules:
26+
- '@ip'
27+
- '@mac'
28+
type: multiple
29+
project:remove_ips_and_macs:
30+
hide_rule: false
31+
redaction:
32+
method: remove
33+
rules:
34+
- '@ip'
35+
- '@mac'
36+
type: multiple
37+
trustedRelays: []
38+
disabled: false
39+
slug: bar

0 commit comments

Comments
 (0)