Repository navigation
Conversation
Enforce sentry-conventions attributes in task integrations (huey, arq, celery, dramatiq, mcp, ray, rq). #8323 PY-3090
Contributor
Coverage Results 📊✅ 59240 passed | ❌ 1 failed | ⏭️ 3047 skipped | Total: 62288 | Pass Rate: 95.11% | Execution Time: 162m 50s 📊 Comparison with Base Branch
➕ New Tests (1)View new tests
❌ Failed Tests
|
| File | Patch coverage | Changed executable lines |
|---|---|---|
| sentry_sdk/integrations/arq.py | 100.00% | 2/2 covered |
| sentry_sdk/integrations/celery/init.py | 100.00% | 7/7 covered |
| sentry_sdk/integrations/dramatiq.py | 100.00% | 2/2 covered |
| sentry_sdk/integrations/huey.py | 100.00% | 2/2 covered |
| sentry_sdk/integrations/mcp.py | 100.00% | 8/8 covered |
| sentry_sdk/integrations/ray.py | 100.00% | 1/1 covered |
| sentry_sdk/integrations/rq.py | 100.00% | 3/3 covered |
Coverage diff
@@ Coverage Diff @@
## master #8404 +/-##
==========================================
+ Coverage 90.11% 90.12% +0.01%
==========================================
Files 201 200 -1
Tracked lines 22199 22105 -94
Branches 7784 7746 -38
==========================================
- Hits 20004 19921 -83
+ Misses 2195 2184 -11
+ Partials 1283 1276 -7Generated by Coverage Action
Enforce sentry-conventions attribute names in task integration tests (arq, celery, dramatiq, fastmcp, huey, mcp, ray, rq). #8323 PY-3090 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reference the deprecated mcp.request.id attribute through ATTRIBUTE_NAMES instead of SPANDATA in the mcp integration and the mcp and fastmcp tests. The sent keys stay the same. #8323 PY-3090 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sentrivana
pushed a commit
that referenced
this pull request
Nov 30, 2026
### Description Removes `_extract_tool_result_content()` from `sentry_sdk/integrations/mcp.py` (39 lines). Nothing calls it. **Why it's dead** - #4964 added it with the MCP integration. It turned the return value of a patched low-level server tool handler (`CallToolResult`, a `(unstructured, structured)` tuple, a dict, or a list of content blocks) into the value for the tool result span attribute. - #7508 (`chore(mcp): Drop support for < 2.0`) replaced that handler patching with the server middleware and deleted the only call (`extracted = _extract_tool_result_content(result)`). The definition stayed behind. - On mcp 2.x, `_instrument_tool_call` gets the result as a dict and reads `structuredContent` or `content` from it inline. It calls `_extract_text_from_content_blocks` directly, and this PR keeps that function. - `git grep _extract_tool_result_content` on `master` finds only the definition. `git log -S "_extract_tool_result_content("` finds only the two PRs above. The helper is private and isn't exported or documented. **Why it's safe** Nothing reaches the function, so no behavior changes. Public API, supported mcp versions, and dependencies stay the same. No open PR or issue mentions it. The only open PR that touches `mcp.py`, #8404, edits other lines, so it shouldn't conflict. **Why it's better gone** A reader of `mcp.py` today sees two ways tool results get extracted, and only the inline one runs. The dead helper also documents result shapes (tuple, `CallToolResult` object) that the middleware path never receives. #### Issues None. <!-- junior-request-attribution:start --> via [automation `sched_65eed06cc199036c2b13411096f412d4`](https://junior-prod.sentry.dev/automations/sched_65eed06cc199036c2b13411096f412d4) · Run ID `sched_65eed06cc199036c2b13411096f412d4:1796025600000`. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent-dispatch%3Adispatch_d2b9643c275b26cf884e93a61f07e0cf --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_d2b9643c275b26cf884e93a61f07e0cf) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_d2b9643c275b26cf884e93a61f07e0cf/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enforce sentry-conventions attributes in task integrations (huey, arq, celery, dramatiq, mcp, ray, rq).
Issues
#8323
PY-3090