feat(tracing): Gate create_span gen_ai attributes via data_collection - #7295
Merged
ericapisani merged 2 commits intoAug 31, 2026
Merged
Conversation
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
Contributor
Codecov Results 📊✅ 119587 passed | ⏭️ 6762 skipped | Total: 126349 | Pass Rate: 94.65% | Execution Time: 414m 27s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2489 uncovered lines. 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 -1Generated by Codecov Action |
sentrivana
approved these changes
Aug 31, 2026
ericapisani
deleted the
py-2749-update-create-span-helper-helper-methods
branch
August 31, 2026 15:21
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.
Route input/output attribute collection for AI_AGENT, AI_CHAT, and AI_TOOL span templates through the
data_collection.gen_aioption when enabled, falling back tosend_default_piiotherwise. Prompts recorded viaprompt/system_promptkwargs stay ungated whendata_collectionis not configured, preserving pre-existing behavior.Fixes PY-2749
Fixes #7293