Skip to content

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Oct 15, 2025

Changes included:

  • Start transaction for each process
  • Add metric to track process errors

Changes included:
* Start transaction for each process
* Add metric to track process errors
@armenzg armenzg requested a review from wedamija October 15, 2025 20:57
@armenzg armenzg self-assigned this Oct 15, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 15, 2025

return

model_name, chunk = j
Copy link
Member Author

Choose a reason for hiding this comment

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

This section is easier to review by hiding the white spaces:
https://github.com/getsentry/sentry/pull/101558/files?diff=split&w=1

logger.exception("Error in multiprocess_worker.")
finally:
task_queue.task_done()
with sentry_sdk.start_transaction(op="cleanup", name="multiprocess_worker") as transaction:
Copy link
Member Author

Choose a reason for hiding this comment

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

All the errors from the processes are missing the transaction:

Image

finally:
task_queue.task_done()
with sentry_sdk.start_transaction(op="cleanup", name="multiprocess_worker") as transaction:
transaction.set_tag("model", model_name)
Copy link
Member Author

Choose a reason for hiding this comment

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

This will help me distinguish the impact per model.

if not task.chunk(apply_filter=True):
break
except Exception:
metrics.incr("cleanup.error", instance=model_name)
Copy link
Member Author

Choose a reason for hiding this comment

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

Eventually we can create monitors for this. We should not let things get as bad as they currently are.

is_flag=True,
help="Send the duration of this command to internal metrics.",
hidden=True,
help="(deprecated) Send the duration of this command to internal metrics.",
Copy link
Member Author

Choose a reason for hiding this comment

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

All scripts are passing the --timed parameter, thus, we don't need this.

# main process tracks the overall cleanup operation performance.
with sentry_sdk.start_transaction(op="cleanup", name="cleanup") as transaction:
transaction.set_tag("router", router)
transaction.set_tag("model", model)
Copy link
Member Author

Choose a reason for hiding this comment

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

All errors are happening within the processes, thus, these taggings are useless.
I will remove the other one on a different commit/PR to save triggering CI.

@armenzg armenzg requested a review from a team October 15, 2025 21:21
@armenzg armenzg marked this pull request as ready for review October 15, 2025 21:21
cursor[bot]

This comment was marked as outdated.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 15, 2025
@ryan953 ryan953 removed the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 15, 2025
@getsentry getsentry deleted a comment from github-actions bot Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants