Repository navigation
fix(python): Correct functions_to_trace option type - #19819
Conversation
Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
The plan uses error signals on the changed options URL and its markdown export. Services: PlanWhat changedThe Python options page now documents RiskWrong copy does not change SDK runtime. Intended effectThis change only edits documentation copy. Regression watchIf this MDX is wrong, the options page or its markdown export fails first.
Not observableThe published Type cell and the dictionary example are not in Sentry. |
## DESCRIBE YOUR PR The Python options page lists `functions_to_trace` as `list[str]` and says each entry is a string with the function's fully qualified name. The SDK actually expects `Sequence[Dict[str, str]]` and reads `function["qualified_name"]` from each entry ([`client.py` @ 2.71.0](https://github.com/getsentry/sentry-python/blob/2.71.0/sentry_sdk/client.py#L545-L547), [`consts.py`](https://github.com/getsentry/sentry-python/blob/2.71.0/sentry_sdk/consts.py#L1356)). If you pass plain strings, `sentry_sdk.init()` fails with `TypeError: string indices must be integers`. This changes the type to `list[dict[str, str]]` and describes the `qualified_name` key. That matches the example already on the [custom instrumentation page](https://docs.sentry.io/platforms/python/tracing/instrumentation/custom-instrumentation/#define-span-creation-in-a-central-place). ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) <!-- junior-request-attribution:start --> via **Ivana Kellyer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent-dispatch%3Adispatch_629c1689a0364da29b4e432b70cfeadb --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_629c1689a0364da29b4e432b70cfeadb) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_629c1689a0364da29b4e432b70cfeadb/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
DESCRIBE YOUR PR
The Python options page lists
functions_to_traceaslist[str]and says each entry is a string with the function's fully qualified name. The SDK actually expectsSequence[Dict[str, str]]and readsfunction["qualified_name"]from each entry (client.py@ 2.71.0,consts.py). If you pass plain strings,sentry_sdk.init()fails withTypeError: string indices must be integers.This changes the type to
list[dict[str, str]]and describes thequalified_namekey. That matches the example already on the custom instrumentation page.IS YOUR CHANGE URGENT?
PRE-MERGE CHECKLIST
via Ivana Kellyer.
--
View Junior Session [Sentry]