Skip to content

feat(openai): Gate embeddings input collection on data_collection - #6977

Open
ericapisani wants to merge 3 commits into
masterfrom
py-2588-openai-embeddings-input-data
Open

feat(openai): Gate embeddings input collection on data_collection#6977
ericapisani wants to merge 3 commits into
masterfrom
py-2588-openai-embeddings-input-data

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Honour _experiments["data_collection"]["gen_ai"]["inputs"] in _set_embeddings_input_data. When the experiment is set, it takes precedence over send_default_pii (though include_prompts=False still wins); when unset, fall back to the previous PII-based behavior. gen_ai.operation.name and the request model are now always set on the span, even when input collection is skipped.

Add tests covering the precedence matrix (sync + async) and input shapes under disabled input collection.

Refs PY-2588

Honour `_experiments["data_collection"]["gen_ai"]["inputs"]` in
`_set_embeddings_input_data`. When the experiment is set, it takes
precedence over `send_default_pii` (though `include_prompts=False`
still wins); when unset, fall back to the previous PII-based behavior.
`gen_ai.operation.name` and the request model are now always set on
the span, even when input collection is skipped.

Add tests covering the precedence matrix (sync + async) and input
shapes under disabled input collection.

Refs PY-2588
@ericapisani
ericapisani requested a review from a team as a code owner July 31, 2026 16:02
@linear-code

linear-code Bot commented Jul 31, 2026

Copy link
Copy Markdown

PY-2588

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

96342 passed | ⏭️ 6343 skipped | Total: 102685 | Pass Rate: 93.82% | Execution Time: 342m 30s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +1360
Passed Tests 📈 +1361
Failed Tests 📉 -1
Skipped Tests

➖ Removed Tests (1)

View removed tests
  • test_continuous_profiler_auto_start_and_stop_sampled[non-experiment-thread]
    • File: tests.profiler.test_continuous_profiler

All tests are passing successfully.

✅ Patch coverage is 91.67%. Project has 2514 uncovered lines.
❌ Project coverage is 89.88%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/openai.py 91.67% ⚠️ 1 Missing and 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    89.91%    89.88%    -0.03%
==========================================
  Files          193       193         —
  Lines        24832     24835        +3
  Branches      8912      8920        +8
==========================================
+ Hits         22326     22321        -5
- Misses        2506      2514        +8
- Partials      1417      1420        +3

Generated by Codecov Action

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.

1 participant