Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: getsentry/sentry-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/anthropic-streaming-instrumentation
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 2 contributors

Commits on Feb 6, 2026

  1. fix(anthropic): Instrument Messages.stream() for streaming support

    The Anthropic SDK's `Messages.stream()` method bypasses `Messages.create()`
    by making direct HTTP requests internally. This meant our existing wrapper
    on `create()` never fired for streaming calls, producing 0 AI spans.
    
    Add wrappers for `Messages.stream` and `AsyncMessages.stream` that create
    proxy context managers to intercept iteration, collect AI data (model,
    token usage, content) from stream events, and finalize spans on completion.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    shellmayr and claude committed Feb 6, 2026
    Configuration menu
    Copy the full SHA
    e6fa611 View commit details
    Browse the repository at this point in the history
Loading