Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dyn-sampling): add new bias toggle to project details for prioritise by tx name [TET-717] #44944

Merged
merged 8 commits into from
Feb 28, 2023
3 changes: 3 additions & 0 deletions src/sentry/dynamic_sampling/rules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class RuleType(Enum):
BOOST_LATEST_RELEASES_RULE = "boostLatestRelease"
IGNORE_HEALTH_CHECKS_RULE = "ignoreHealthChecks"
BOOST_KEY_TRANSACTIONS_RULE = "boostKeyTransactions"
BOOST_LOW_VOLUME_TRANSACTIONS = "boostLowVolumeTransactions"


DEFAULT_BIASES: List[ActivatableBias] = [
Expand All @@ -41,12 +42,14 @@ class RuleType(Enum):
},
{"id": RuleType.IGNORE_HEALTH_CHECKS_RULE.value, "active": True},
{"id": RuleType.BOOST_KEY_TRANSACTIONS_RULE.value, "active": True},
{"id": RuleType.BOOST_LOW_VOLUME_TRANSACTIONS.value, "active": False},
]
RESERVED_IDS = {
RuleType.UNIFORM_RULE: 1000,
RuleType.BOOST_ENVIRONMENTS_RULE: 1001,
RuleType.IGNORE_HEALTH_CHECKS_RULE: 1002,
RuleType.BOOST_KEY_TRANSACTIONS_RULE: 1003,
RuleType.BOOST_LOW_VOLUME_TRANSACTIONS: 1400,
RuleType.BOOST_LATEST_RELEASES_RULE: 1500,
}
REVERSE_RESERVED_IDS = {value: key for key, value in RESERVED_IDS.items()}
Expand Down
3 changes: 3 additions & 0 deletions tests/sentry/api/endpoints/test_project_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,7 @@ def test_get_dynamic_sampling_biases_manually_set_biases(self):
},
{"id": "ignoreHealthChecks", "active": True},
{"id": "boostKeyTransactions", "active": True},
{"id": "prioritiseByTxName", "active": False},
andriisoldatenko marked this conversation as resolved.
Show resolved Hide resolved
]

def test_get_dynamic_sampling_biases_with_previously_assigned_biases(self):
Expand All @@ -1351,6 +1352,7 @@ def test_get_dynamic_sampling_biases_with_previously_assigned_biases(self):
},
{"id": "ignoreHealthChecks", "active": True},
{"id": "boostKeyTransactions", "active": True},
{"id": "prioritiseByTxName", "active": False},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, let me fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]

def test_dynamic_sampling_bias_activation(self):
Expand Down Expand Up @@ -1468,6 +1470,7 @@ def test_put_new_dynamic_sampling_rules_with_correct_flags(self):
},
{"id": "ignoreHealthChecks", "active": False},
{"id": "boostKeyTransactions", "active": False},
{"id": "prioritiseByTxName", "active": False},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you missed the renaming here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in b064f9c

]
with Feature(
{
Expand Down