Skip to content

Commit 6b161e9

Browse files
authored
chore(dynamic-sampling): remove org recalibration feature flag (#102207)
1 parent e7968da commit 6b161e9

File tree

4 files changed

+35
-45
lines changed

4 files changed

+35
-45
lines changed

src/sentry/dynamic_sampling/rules/combine.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ def get_relay_biases_combinator(organization: Organization) -> BiasesCombinator:
2626

2727
default_combinator.add(RuleType.BOOST_REPLAY_ID_RULE, BoostReplayIdBias())
2828
default_combinator.add(RuleType.BOOST_ENVIRONMENTS_RULE, BoostEnvironmentsBias())
29-
default_combinator.add_if(
30-
RuleType.RECALIBRATION_RULE,
31-
RecalibrationBias(),
32-
lambda: features.has("organizations:ds-org-recalibration", organization, actor=None),
33-
)
29+
default_combinator.add(RuleType.RECALIBRATION_RULE, RecalibrationBias())
3430
default_combinator.add(RuleType.BOOST_LATEST_RELEASES_RULE, BoostLatestReleasesBias())
3531
default_combinator.add(
3632
RuleType.BOOST_LOW_VOLUME_TRANSACTIONS_RULE, BoostLowVolumeTransactionsBias()

src/sentry/features/temporary.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
132132
manager.add("organizations:migrate-transaction-queries-to-spans", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
133133
# Enable new cell actions styling and features for tables that use the component
134134
manager.add("organizations:discover-cell-actions-v2", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
135-
# Enable the org recalibration
136-
manager.add("organizations:ds-org-recalibration", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
137135
# Enable custom dynamic sampling rates
138136
manager.add("organizations:dynamic-sampling-custom", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
139137
# Enable dynamic sampling minimum sample rate

tests/sentry/dynamic_sampling/test_generate_rules.py

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,18 @@ def test_generate_rules_return_only_always_allowed_rules_if_sample_rate_is_100_a
115115
0.5,
116116
)
117117

118-
with Feature("organizations:ds-org-recalibration"):
119-
assert generate_rules(default_old_project) == [
120-
{
121-
"condition": {"inner": [], "op": "and"},
122-
"id": 1000,
123-
"samplingValue": {"type": "sampleRate", "value": 1.0},
124-
"type": "trace",
125-
},
126-
]
127-
get_blended_sample_rate.assert_called_with(
128-
organization_id=default_old_project.organization.id, project=default_old_project
129-
)
130-
_validate_rules(default_old_project)
118+
assert generate_rules(default_old_project) == [
119+
{
120+
"condition": {"inner": [], "op": "and"},
121+
"id": 1000,
122+
"samplingValue": {"type": "sampleRate", "value": 1.0},
123+
"type": "trace",
124+
},
125+
]
126+
get_blended_sample_rate.assert_called_with(
127+
organization_id=default_old_project.organization.id, project=default_old_project
128+
)
129+
_validate_rules(default_old_project)
131130

132131

133132
@django_db_all
@@ -647,22 +646,21 @@ def test_generate_rules_return_uniform_rules_and_recalibrate_orgs_rule(
647646
default_factor,
648647
)
649648

650-
with Feature("organizations:ds-org-recalibration"):
651-
assert generate_rules(default_old_project) == [
652-
{
653-
"condition": {"inner": [], "op": "and"},
654-
"id": 1004,
655-
"samplingValue": {"type": "factor", "value": default_factor},
656-
"type": "trace",
657-
},
658-
{
659-
"condition": {"inner": [], "op": "and"},
660-
"id": 1000,
661-
"samplingValue": {"type": "sampleRate", "value": 0.1},
662-
"type": "trace",
663-
},
664-
]
665-
_validate_rules(default_project)
649+
assert generate_rules(default_old_project) == [
650+
{
651+
"condition": {"inner": [], "op": "and"},
652+
"id": 1004,
653+
"samplingValue": {"type": "factor", "value": default_factor},
654+
"type": "trace",
655+
},
656+
{
657+
"condition": {"inner": [], "op": "and"},
658+
"id": 1000,
659+
"samplingValue": {"type": "sampleRate", "value": 0.1},
660+
"type": "trace",
661+
},
662+
]
663+
_validate_rules(default_project)
666664

667665

668666
@django_db_all
@@ -997,9 +995,7 @@ def test_generate_rules_project_mode(
997995
)
998996
default_old_project.update_option("sentry:target_sample_rate", 0.2)
999997

1000-
with Feature(
1001-
{"organizations:ds-org-recalibration": True, "organizations:dynamic-sampling-custom": True}
1002-
):
998+
with Feature({"organizations:dynamic-sampling-custom": True}):
1003999
assert generate_rules(default_old_project) == [
10041000
{
10051001
"condition": {"inner": [], "op": "and"},

tests/sentry/relay/test_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,6 @@ def test_project_config_with_all_biases_enabled(
471471
"samplingValue": {"type": "sampleRate", "value": 1.0},
472472
"type": "trace",
473473
},
474-
# {
475-
# "condition": {"inner": [], "op": "and"},
476-
# "id": 1004,
477-
# "samplingValue": {"type": "factor", "value": default_factor},
478-
# "type": "trace",
479-
# },
480474
{
481475
"samplingValue": {"type": "sampleRate", "value": 1.0},
482476
"type": "trace",
@@ -492,6 +486,12 @@ def test_project_config_with_all_biases_enabled(
492486
},
493487
"id": 1001,
494488
},
489+
{
490+
"condition": {"inner": [], "op": "and"},
491+
"id": 1004,
492+
"samplingValue": {"type": "factor", "value": default_factor},
493+
"type": "trace",
494+
},
495495
{
496496
"samplingValue": {"type": "factor", "value": 1.5},
497497
"type": "trace",

0 commit comments

Comments
 (0)