Skip to content

Commit a56d65b

Browse files
Andrii SoldatenkopriscilawebdevRaduW
authored
feat(dyn-sampling): add new bias toggle to project details for prioritise by tx name [TET-717] (#44944)
This PR adds new toggle for project details for prioritise by tx name Tested locally: <img width="758" alt="image" src="https://user-images.githubusercontent.com/1374633/220940820-5cd7f09a-dc69-439a-8742-540f1e5b9770.png"> --------- Co-authored-by: Priscila Oliveira <[email protected]> Co-authored-by: Radu Woinaroski <[email protected]>
1 parent a4a6c4a commit a56d65b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/sentry/dynamic_sampling/rules/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class RuleType(Enum):
3131
BOOST_LATEST_RELEASES_RULE = "boostLatestRelease"
3232
IGNORE_HEALTH_CHECKS_RULE = "ignoreHealthChecks"
3333
BOOST_KEY_TRANSACTIONS_RULE = "boostKeyTransactions"
34+
BOOST_LOW_VOLUME_TRANSACTIONS = "boostLowVolumeTransactions"
3435

3536

3637
DEFAULT_BIASES: List[ActivatableBias] = [
@@ -41,12 +42,14 @@ class RuleType(Enum):
4142
},
4243
{"id": RuleType.IGNORE_HEALTH_CHECKS_RULE.value, "active": True},
4344
{"id": RuleType.BOOST_KEY_TRANSACTIONS_RULE.value, "active": True},
45+
{"id": RuleType.BOOST_LOW_VOLUME_TRANSACTIONS.value, "active": False},
4446
]
4547
RESERVED_IDS = {
4648
RuleType.UNIFORM_RULE: 1000,
4749
RuleType.BOOST_ENVIRONMENTS_RULE: 1001,
4850
RuleType.IGNORE_HEALTH_CHECKS_RULE: 1002,
4951
RuleType.BOOST_KEY_TRANSACTIONS_RULE: 1003,
52+
RuleType.BOOST_LOW_VOLUME_TRANSACTIONS: 1400,
5053
RuleType.BOOST_LATEST_RELEASES_RULE: 1500,
5154
}
5255
REVERSE_RESERVED_IDS = {value: key for key, value in RESERVED_IDS.items()}

tests/sentry/api/endpoints/test_project_details.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,7 @@ def test_get_dynamic_sampling_biases_manually_set_biases(self):
13251325
},
13261326
{"id": "ignoreHealthChecks", "active": True},
13271327
{"id": "boostKeyTransactions", "active": True},
1328+
{"id": "boostLowVolumeTransactions", "active": False},
13281329
]
13291330

13301331
def test_get_dynamic_sampling_biases_with_previously_assigned_biases(self):
@@ -1351,6 +1352,7 @@ def test_get_dynamic_sampling_biases_with_previously_assigned_biases(self):
13511352
},
13521353
{"id": "ignoreHealthChecks", "active": True},
13531354
{"id": "boostKeyTransactions", "active": True},
1355+
{"id": "boostLowVolumeTransactions", "active": False},
13541356
]
13551357

13561358
def test_dynamic_sampling_bias_activation(self):
@@ -1468,6 +1470,7 @@ def test_put_new_dynamic_sampling_rules_with_correct_flags(self):
14681470
},
14691471
{"id": "ignoreHealthChecks", "active": False},
14701472
{"id": "boostKeyTransactions", "active": False},
1473+
{"id": "boostLowVolumeTransactions", "active": False},
14711474
]
14721475
with Feature(
14731476
{

0 commit comments

Comments
 (0)