Skip to content

fix(python): Migrate assessment templates to sentry-python 3.0 - #169

Merged
obostjancic merged 1 commit into
mainfrom
fix/python-sdk-3
Nov 24, 2026
Merged

obostjancic merged 1 commit into
mainfrom
fix/python-sdk-3

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

sentry-python 3.0.0 shipped on Nov 23. The Python variants pin sentry=latest, so the Nov 24 daily run installed 3.0.0, and all 31 Python variants failed inside sentry_sdk.init() before running any probe. 29 failed with TypeError: Unknown option 'send_default_pii', and the 8 LiteLLM variants failed with LiteLLMIntegration() takes no arguments. The overall score dropped from 79 to 55.

This PR moves the Python templates to the 3.0 API, following the 3.0 migration guide:

  • send_default_pii=True and stream_gen_ai_spans=True are replaced with data_collection={"gen_ai": {"inputs": True, "outputs": True}}. Both old options were removed, and in 3.0 every span is streamed. AI content is on by default in 3.0, but setting it explicitly keeps the harness's "record prompts and responses" intent independent of SDK defaults.
  • LiteLLMIntegration(include_prompts=True) becomes LiteLLMIntegration(), because 3.0 removed include_prompts from all GenAI integrations.
  • start_transaction and start_span(op=...) become start_span(name=..., attributes={"sentry.op": ...}), and set_data becomes set_attribute. This is the 3.0 span API, matching the 3.x manual-instrumentation docs. The span collector already maps v2 span sentry.op and attributes to op and data, so test.assessment, test.assessment.call and the probe and call IDs resolve the same as before.
  • In the manual agents template, tool_span.set_status("internal_error") becomes tool_span.status = "error", because 3.0 only accepts ok or error.

Open decision: the templates now target 3.x only. Every Python config uses sentryVersions: ["latest"], so the daily run isn't affected. But --sentry-python runs against a 2.x checkout will fail at init(). If 2.x coverage is still wanted, it would need a separate set of templates or version gating in the templates. I left that out.

Scores for the framework variants will move compared with the 2.x baseline. That's expected and not a harness issue, because 3.0 renames GenAI attributes, drops the OpenAI Agents workflow and handoff spans, and slims invoke_agent spans.

via Ogi.

--

View Session [Sentry]

Co-Authored-By: Ognjen Bostjancic <ognjen.bostjancic@sentry.io>
@obostjancic
obostjancic marked this pull request as ready for review November 24, 2026 12:58
@obostjancic
obostjancic merged commit 679dea2 into main Nov 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant