fix(writer): accept writer-sdk 3.x in the dependency check - #4410
fix(writer): accept writer-sdk 3.x in the dependency check#4410Anai-Guo wants to merge 1 commit into
Conversation
|
|
📝 WalkthroughWalkthroughThe writer instrumentation package extends its supported ChangesWriter SDK Compatibility
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 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",) |
There was a problem hiding this comment.
🗄️ 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.
Same class of problem as #4409, in a different package.
Problem
opentelemetry-instrumentation-writerdeclaresBaseInstrumentor.instrument()compares that against the installed distribution and, on a mismatch, logs aDependencyConflictand returns without wrapping anything.writer-sdk3.0.0 shipped on 2026-06-02, so on a current SDK you getand then silently no spans and no metrics.
Nothing the instrumentation reaches for moved in 3.x — all four wrap targets still resolve:
writerai.resources.chat.ChatResource.chatwriterai.resources.chat.AsyncChatResource.chatwriterai.resources.completions.CompletionsResource.createwriterai.resources.completions.AsyncCompletionsResource.createChange
One line:
< 3→< 4.Verification
Package test suite run against
writer-sdk==3.0.0, before and after:< 3)IndexErroron the span list,AttributeError: 'NoneType'in the metrics tests)< 4)The recorded cassettes replay unchanged under 3.x.
Note on CI
The
testgroup stays pinned atwriter-sdk>=2.3.0,<3, souv.lockis 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
writer-sdkversions 3.x while retaining support for existing 2.x versions.