Skip to content

Commit e7744fc

Browse files
authored
chore(dynamic-sampling): capture exceptions in boost low volume projects (#97669)
1 parent 9ab40a9 commit e7744fc

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/sentry/dynamic_sampling/tasks/boost_low_volume_projects.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,27 @@ def boost_low_volume_projects_of_org(
251251
organization ID. Transaction counts and rates have to be provided.
252252
"""
253253

254-
rebalanced_projects = calculate_sample_rates_of_projects(
255-
org_id, projects_with_tx_count_and_rates
256-
)
254+
org = Organization.objects.get_from_cache(id=org_id)
255+
if features.has("organizations:log-project-config", org):
256+
logger.info(
257+
"log-project-config: Starting boost_low_volume_projects_of_org for org %s",
258+
org_id,
259+
extra={"org_id": org_id},
260+
)
261+
262+
try:
263+
rebalanced_projects = calculate_sample_rates_of_projects(
264+
org_id, projects_with_tx_count_and_rates
265+
)
266+
except Exception as e:
267+
if features.has("organizations:log-project-config", org):
268+
logger.info(
269+
"log-project-config: Error calculating sample rates of for org %s",
270+
org_id,
271+
extra={"org_id": org_id},
272+
)
273+
sentry_sdk.capture_exception(e)
274+
raise
257275

258276
logger.info(
259277
"boost_low_volume_projects_of_org",

0 commit comments

Comments
 (0)