Skip to content

Commit aeefd28

Browse files
author
Andrii Soldatenko
committed
feat: add new bias toggle to project details for prioritise by tx name
1 parent 483ac3d commit aeefd28

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+
PRIORITISE_BY_TX_NAME_RULE = "prioritiseByTxName"
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.PRIORITISE_BY_TX_NAME_RULE.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.PRIORITISE_BY_TX_NAME_RULE: 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": "prioritiseByTxName", "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": "prioritiseByTxName", "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": "prioritiseByTxName", "active": False},
14711474
]
14721475
with Feature(
14731476
{

0 commit comments

Comments
 (0)