Skip to content

Commit 655cefc

Browse files
authored
fix(seer): Align project grouping record deletion with Seer API (#111756)
Issue: https://sentry.sentry.io/issues/5865067343/?project=1&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=7d This PR addresses the `seer.delete_grouping_records.project.failure` errors, which saw a significant spike recently. The root cause was a mismatch in how Sentry was calling the Seer API endpoint for deleting grouping records by project (`/v0/issues/similar-issues/grouping-record/delete`). Specifically, two issues were identified: 1. **Incorrect HTTP Method**: Sentry was sending a `POST` request, while the Seer endpoint was defined as a `GET`. 2. **Incorrect Parameter Location**: Sentry was sending the `project_id` in the request body, but Seer expected it as a **path parameter** (e.g., `/v0/issues/similar-issues/grouping-record/delete/{project_id}`). This change updates the `make_delete_grouping_records_by_project_request` function in `src/sentry/seer/signed_seer_api.py` to: * Use the `GET` HTTP method. * Construct the URL with the `project_id` included as a path parameter. * Send an empty body, as `GET` requests typically do not carry a body. This fix ensures that Sentry correctly communicates with the Seer service for project grouping record deletions, resolving the 404 errors and allowing these background tasks to complete successfully. Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
1 parent ecb1c25 commit 655cefc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sentry/seer/signed_seer_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,12 @@ def make_delete_grouping_records_by_project_request(
537537
timeout: int | float | None = None,
538538
viewer_context: SeerViewerContext | None = None,
539539
) -> BaseHTTPResponse:
540+
project_id = body["project_id"]
540541
return make_signed_seer_api_request(
541542
seer_grouping_default_connection_pool,
542-
"/v0/issues/similar-issues/grouping-record/delete",
543-
body=orjson.dumps(body),
543+
f"/v0/issues/similar-issues/grouping-record/delete/{project_id}",
544+
body=b"",
545+
method="GET",
544546
timeout=timeout,
545547
viewer_context=viewer_context,
546548
)

0 commit comments

Comments
 (0)