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

fix(taskworker) Make complete metric not include RPC calls #86125

Merged
merged 1 commit into from
Feb 28, 2025
Merged
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
9 changes: 4 additions & 5 deletions src/sentry/taskworker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ def _drain_result(self, fetch: bool = True) -> bool:
except queue.Empty:
return False

task_received = self._task_receive_timing.pop(result.task_id, None)
if task_received is not None:
metrics.distribution("taskworker.worker.complete_duration", time.time() - task_received)

if fetch:
fetch_next = None
if not self._child_tasks.full():
Expand All @@ -349,11 +353,6 @@ def _drain_result(self, fetch: bool = True) -> bool:
status=result.status,
fetch_next_task=fetch_next,
)
task_received = self._task_receive_timing.pop(result.task_id, None)
if task_received is not None:
metrics.distribution(
"taskworker.worker.complete_duration", time.time() - task_received
)
except grpc.RpcError as e:
logger.exception(
"taskworker.drain_result.update_task_failed",
Expand Down
Loading