wu-sheng opened a new pull request, #387: URL: https://github.com/apache/skywalking-python/pull/387
## Summary Add `sw_urllib3_v2` plugin for urllib3 2.x, which removed `urllib3.request.RequestMethods` that the existing `sw_urllib3` plugin hooks. ### Changes - **New plugin** `skywalking/plugins/sw_urllib3_v2.py`: hooks `PoolManager.request` (urllib3 2.x entry point) - **Existing plugin** `sw_urllib3.py`: add `>=3.12: []` to skip testing 1.x on Python 3.12+ (can't install) - **Shared test**: `tests/plugin/http/sw_urllib3/test_urllib3.py` merges version vectors from both plugins ### Auto-detection Both plugins are discovered by the agent. Only one activates based on the installed urllib3 version: - **urllib3 1.x**: `sw_urllib3` succeeds (imports `RequestMethods`). `sw_urllib3_v2` detects 1.x and returns early. - **urllib3 2.x**: `sw_urllib3` fails (ImportError, skipped). `sw_urllib3_v2` hooks `PoolManager.request`. ### Verified locally (Python 3.13, span data validated) - `urllib3==2.3` — PASSED - `urllib3==2.0` — PASSED ## Test plan - [ ] Plugin tests pass on Python 3.10/3.11 (urllib3 1.x via sw_urllib3) - [ ] Plugin tests pass on Python 3.12/3.13/3.14 (urllib3 2.x via sw_urllib3_v2) - [ ] No double-hooking when both plugins are loaded 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
