Skip to content

fix: OPTIC-1749: Limit only sentry_force error logs to go to Sentry #7209

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

Merged
merged 3 commits into from
Mar 11, 2025
Merged
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
4 changes: 2 additions & 2 deletions label_studio/core/utils/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
def event_processor(event, hint):
# skip all transactions without exceptions, unless it's a log record
if 'exc_info' not in hint:

if 'log_record' in hint:
# special flag inside of logger.error(..., extra={'sentry_force': True}) to force sentry to log the error
if 'log_record' in hint and event.get('extra', {}).get('sentry_force', False):

Check warning on line 8 in label_studio/core/utils/sentry.py

View check run for this annotation

Codecov / codecov/patch

label_studio/core/utils/sentry.py#L8

Added line #L8 was not covered by tests
return event

return None
Expand Down
2 changes: 1 addition & 1 deletion label_studio/projects/functions/next_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
'project_id': project.id,
'title': project.title,
}
logger.error(
logger.info(

Check warning on line 401 in label_studio/projects/functions/next_task.py

View check run for this annotation

Codecov / codecov/patch

label_studio/projects/functions/next_task.py#L401

Added line #L401 was not covered by tests
f'DEBUG INFO: get_next_task is_labeled/overlap: '
f'LOCALS ==> {local} :: PROJECT ==> {project_data} :: '
f'NEXT_TASK ==> {task}'
Expand Down
Loading