Skip to content

feat(tracing): Gate create_span gen_ai attributes via data_collection - #7295

Merged
ericapisani merged 2 commits into
masterfrom
py-2749-update-create-span-helper-helper-methods
Aug 31, 2026
Merged

feat(tracing): Gate create_span gen_ai attributes via data_collection#7295
ericapisani merged 2 commits into
masterfrom
py-2749-update-create-span-helper-helper-methods

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Route input/output attribute collection for AI_AGENT, AI_CHAT, and AI_TOOL span templates through the data_collection.gen_ai option when enabled, falling back to send_default_pii otherwise. Prompts recorded via prompt/system_prompt kwargs stay ungated when data_collection is not configured, preserving pre-existing behavior.

Fixes PY-2749
Fixes #7293

Route input/output attribute collection for AI_AGENT, AI_CHAT, and
AI_TOOL span templates through the `data_collection.gen_ai` option
when enabled, falling back to `send_default_pii` otherwise. Prompts
recorded via `prompt`/`system_prompt` kwargs stay ungated when
`data_collection` is not configured, preserving pre-existing behavior.

Fixes PY-2749
Fixes #7293
@ericapisani
ericapisani requested a review from a team as a code owner August 28, 2026 18:52
@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

PY-2749

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

119587 passed | ⏭️ 6762 skipped | Total: 126349 | Pass Rate: 94.65% | Execution Time: 414m 27s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +20948
Passed Tests 📈 +20665
Failed Tests
Skipped Tests 📈 +283

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2489 uncovered lines.
❌ Project coverage is 90.29%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    90.31%    90.29%    -0.02%
==========================================
  Files          193       193         —
  Lines        25612     25621        +9
  Branches      9450      9454        +4
==========================================
+ Hits         23129     23132        +3
- Misses        2483      2489        +6
- Partials      1434      1433        -1

Generated by Codecov Action

Comment thread sentry_sdk/tracing_utils.py Outdated
@ericapisani
ericapisani merged commit 58823cc into master Aug 31, 2026
144 checks passed
@ericapisani
ericapisani deleted the py-2749-update-create-span-helper-helper-methods branch August 31, 2026 15:21
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.

Update underlying helper methods for create_span_decorator in tracing_utils.py to respect data collection settings

2 participants