Skip to content

fix(writer): accept writer-sdk 3.x in the dependency check - #4410

Open
Anai-Guo wants to merge 1 commit into
traceloop:mainfrom
Anai-Guo:fix-writer-instruments-bound
Open

fix(writer): accept writer-sdk 3.x in the dependency check#4410
Anai-Guo wants to merge 1 commit into
traceloop:mainfrom
Anai-Guo:fix-writer-instruments-bound

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Aug 10, 2026

Copy link
Copy Markdown

Same class of problem as #4409, in a different package.

Problem

opentelemetry-instrumentation-writer declares

_instruments = ("writer-sdk >= 2.2.1, < 3",)

BaseInstrumentor.instrument() compares that against the installed distribution and, on a mismatch, logs a DependencyConflict and returns without wrapping anything. writer-sdk 3.0.0 shipped on 2026-06-02, so on a current SDK you get

DependencyConflict: requested: "writer-sdk >= 2.2.1, < 3" but found: "writer-sdk 3.0.0"

and then silently no spans and no metrics.

Nothing the instrumentation reaches for moved in 3.x — all four wrap targets still resolve:

target writer-sdk 3.0.0
writerai.resources.chat.ChatResource.chat present
writerai.resources.chat.AsyncChatResource.chat present
writerai.resources.completions.CompletionsResource.create present
writerai.resources.completions.AsyncCompletionsResource.create present

Change

One line: < 3< 4.

Verification

Package test suite run against writer-sdk==3.0.0, before and after:

result
before (< 3) 76 failed — no spans at all, so every assertion trips (IndexError on the span list, AttributeError: 'NoneType' in the metrics tests)
after (< 4) 76 passed

The recorded cassettes replay unchanged under 3.x.

Note on CI

The test group stays pinned at writer-sdk>=2.3.0,<3, so uv.lock is untouched and CI keeps testing the version it tests today (where this change is a no-op). Glad to bump the test pin too if you'd prefer CI to cover 3.x — the suite is green there, as above.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Expanded compatibility to support writer-sdk versions 3.x while retaining support for existing 2.x versions.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The writer instrumentation package extends its supported writer-sdk dependency range from >= 2.2.1, < 3 to >= 2.2.1, < 4.

Changes

Writer SDK Compatibility

Layer / File(s) Summary
Update writer-sdk version range
packages/opentelemetry-instrumentation-writer/opentelemetry/instrumentation/writer/__init__.py
The supported writer-sdk upper bound changes from < 3 to < 4.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the change to support writer-sdk 3.x.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/opentelemetry-instrumentation-writer/opentelemetry/instrumentation/writer/__init__.py`:
- Line 40: Update the package dependency declaration in pyproject.toml
associated with the writer instrumentation to allow writer-sdk versions from
2.3.0 up to, but not including, 4. Keep any test-only constraint below version 3
separate if needed, and leave the _instruments declaration unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 56203a18-c411-4cdf-98fb-81900f5b7682

📥 Commits

Reviewing files that changed from the base of the PR and between 62e24c2 and a8bc839.

📒 Files selected for processing (1)
  • packages/opentelemetry-instrumentation-writer/opentelemetry/instrumentation/writer/__init__.py

logger = logging.getLogger(__name__)

_instruments = ("writer-sdk >= 2.2.1, < 3",)
_instruments = ("writer-sdk >= 2.2.1, < 4",)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Update the package dependency metadata to allow writer-sdk 3.x.

Line 40 allows writer-sdk versions below 4, but packages/opentelemetry-instrumentation-writer/pyproject.toml:43 still declares writer-sdk>=2.3.0,<3. A standard resolver can therefore reject or downgrade writer-sdk==3.0.0 before BaseInstrumentor.instrument() runs. Change the package dependency upper bound to <4, while keeping any test-only <3 constraint separate if required.

Proposed metadata change
- "writer-sdk>=2.3.0,<3",
+ "writer-sdk>=2.3.0,<4",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/opentelemetry-instrumentation-writer/opentelemetry/instrumentation/writer/__init__.py`
at line 40, Update the package dependency declaration in pyproject.toml
associated with the writer instrumentation to allow writer-sdk versions from
2.3.0 up to, but not including, 4. Keep any test-only constraint below version 3
separate if needed, and leave the _instruments declaration unchanged.

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.

2 participants