Skip to content

fix(python): Correct functions_to_trace option type - #19819

Merged
sentrivana merged 1 commit into
masterfrom
fix/python-functions-to-trace-type
Oct 6, 2026
Merged

sentrivana merged 1 commit into
masterfrom
fix/python-functions-to-trace-type

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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, consts.py). 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.

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • 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

via Ivana Kellyer.

--

View Junior Session [Sentry]

Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Oct 6, 2026 7:39am UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Oct 6, 2026 7:39am UTC

Request Review

@github-actions github-actions Bot added the Priority: Normal Docs review has no urgent deadline label Oct 6, 2026
@codeowner-assignment
codeowner-assignment Bot requested a review from a team October 6, 2026 07:34
@sentrivana
sentrivana marked this pull request as ready for review October 6, 2026 07:35
@codeowner-assignment
codeowner-assignment Bot requested a review from a team October 6, 2026 07:35
@cursor

cursor Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The plan uses error signals on the changed options URL and its markdown export.
It also uses error-status spans on the page catch-all for that URL.
An issue escalates when those signals leave zero.

Rollout complete

Services: sentry-docs.

Plan

What changed

The Python options page now documents functions_to_trace as list[dict[str, str]].
Each list entry is a dictionary with a qualified_name key.
sentry-docs must deploy before this text is live.

Risk

Wrong copy does not change SDK runtime.
Readers may still pass a list of strings if they miss the new type.
A failed MDX render can 500 the options page and its markdown export.
The blast reaches those two URLs only.
SdkOption prints the type string and does not parse it.

Intended effect

This change only edits documentation copy.
Sentry does not record the Type cell text.
The executor cannot set intended_effect from telemetry.
absent means the live Type cell still shows list[str].
absent also means the old string-list wording is still present.

Regression watch

If this MDX is wrong, the options page or its markdown export fails first.
Page transactions use /:path*?, not the URL path.
Filter spans and errors with URL /platforms/python/configuration/options.
Traces sample at 30 percent. Span counts are sampled. Error events are not.
Site-wide Algolia and kapa.ai fetch failures already occur on /:path*?.
Do not treat those titles as this change unless they appear on this URL.

Signal Baseline Rule Source
Error events on URL containing /platforms/python/configuration/options 0 events Hold at zero. Escalate if the count rises above 0. Sentry project docs, environment production, 2026-10-05T07:36:00Z to 2026-10-06T07:36:00Z
Error-status fraction on transaction /:path*? for that URL 0 of 283 spans (0%) Hold at zero. Escalate if any internal_error span appears. Sentry spans, environment production, same window
Error-status fraction on transaction GET docs.sentry.io for that URL 0 of 60 spans (0%) Hold at zero. Escalate if any internal_error span appears. Sentry spans, environment production, same window
Error-status fraction on transaction GET /md-exports/[...path] for that URL 0 of 3 spans (0%) Hold at zero. Escalate if any internal_error span appears. Sentry spans, environment production, same window

Not observable

The published Type cell and the dictionary example are not in Sentry.
Hourly p95 for this URL was not obtained, so latency has no measured band.

@sentrivana
sentrivana enabled auto-merge (squash) October 6, 2026 07:36
@sentrivana
sentrivana merged commit 81fcc60 into master Oct 6, 2026
27 checks passed
@sentrivana
sentrivana deleted the fix/python-functions-to-trace-type branch October 6, 2026 07:51
solnic pushed a commit that referenced this pull request Oct 8, 2026
## 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>

This branch was successfully deployed

1 active deployment
Preview – sentry-docs — 3a7ba480 Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant