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

IA-98: add rollout for sentry task latency #83244

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2937,3 +2937,10 @@
default=False,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

# rollout option for task latency metrics
register(
"sentry.tasks.record.timing.rollout",
default=0.0,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
7 changes: 3 additions & 4 deletions src/sentry/tasks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.db.models import Model

from sentry.celery import app
from sentry.features.rollout import in_random_rollout
from sentry.silo.base import SiloLimit, SiloMode
from sentry.utils import metrics
from sentry.utils.memory import track_memory_usage
Expand Down Expand Up @@ -84,10 +85,8 @@ def instrumented_task(name, stat_suffix=None, silo_mode=None, record_timing=Fals
def wrapped(func):
@wraps(func)
def _wrapped(*args, **kwargs):
record_queue_wait_time = record_timing

# Use a try/catch here to contain the blast radius of an exception being unhandled through the options lib
# Unhandled exception could cause all tasks to be effected and not work
Comment on lines -89 to -90
Copy link
Member Author

Choose a reason for hiding this comment

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

the code this comment refers to was deleted in a previous PR

record_timing_rollout = in_random_rollout("sentry.tasks.record.timing.rollout")
record_queue_wait_time = record_timing or record_timing_rollout

# TODO(dcramer): we want to tag a transaction ID, but overriding
# the base on app.task seems to cause problems w/ Celery internals
Expand Down
Loading