Repository navigation
fix(python): Migrate assessment templates to sentry-python 3.0 - #169
Merged
Merged
Conversation
Co-Authored-By: Ognjen Bostjancic <ognjen.bostjancic@sentry.io>
obostjancic
marked this pull request as ready for review
November 24, 2026 12:58
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.
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 insidesentry_sdk.init()before running any probe. 29 failed withTypeError: Unknown option 'send_default_pii', and the 8 LiteLLM variants failed withLiteLLMIntegration() 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=Trueandstream_gen_ai_spans=Trueare replaced withdata_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)becomesLiteLLMIntegration(), because 3.0 removedinclude_promptsfrom all GenAI integrations.start_transactionandstart_span(op=...)becomestart_span(name=..., attributes={"sentry.op": ...}), andset_databecomesset_attribute. This is the 3.0 span API, matching the 3.x manual-instrumentation docs. The span collector already maps v2 spansentry.opand attributes toopanddata, sotest.assessment,test.assessment.calland the probe and call IDs resolve the same as before.tool_span.set_status("internal_error")becomestool_span.status = "error", because 3.0 only acceptsokorerror.Open decision: the templates now target 3.x only. Every Python config uses
sentryVersions: ["latest"], so the daily run isn't affected. But--sentry-pythonruns against a 2.x checkout will fail atinit(). 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]