Skip to content

Commit e244407

Browse files
gloshkajianxrmx
andauthored
Feature/httpx2 instrumentor (#4730)
* httpx2 instrumentation support * small readme edit * Add docstring for httpx2 * doc updates * ensure that if only httpx2 is available, that the httpx instrumentor isn't backed by httpx2 classes * feedback: httpx protocol to type checking block * feedback: remove top level fail, fix annotations * feedback: move class definitions to the same conditions, fix docgen and genned workflows * feedback: pull out the client instrumentor * tox -e generate --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
1 parent aa3fdc6 commit e244407

21 files changed

Lines changed: 1161 additions & 70 deletions

File tree

.changelog/4730.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-httpx`: add support for httpx2

.github/workflows/core_contrib_test.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,6 +3087,126 @@ jobs:
30873087
- name: Run tests
30883088
run: tox -e py310-test-instrumentation-httpx-1-wrapt2 -- -ra
30893089

3090+
py310-test-instrumentation-httpx-2-wrapt1:
3091+
name: instrumentation-httpx-2-wrapt1
3092+
runs-on: ubuntu-latest
3093+
timeout-minutes: 30
3094+
steps:
3095+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
3096+
uses: actions/checkout@v4
3097+
with:
3098+
repository: open-telemetry/opentelemetry-python-contrib
3099+
ref: ${{ env.CONTRIB_REPO_SHA }}
3100+
3101+
- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
3102+
uses: actions/checkout@v4
3103+
with:
3104+
repository: open-telemetry/opentelemetry-python
3105+
ref: ${{ env.CORE_REPO_SHA }}
3106+
path: opentelemetry-python
3107+
3108+
- name: Set up Python 3.10
3109+
uses: actions/setup-python@v5
3110+
with:
3111+
python-version: "3.10"
3112+
architecture: "x64"
3113+
3114+
- name: Install tox
3115+
run: pip install tox-uv
3116+
3117+
- name: Run tests
3118+
run: tox -e py310-test-instrumentation-httpx-2-wrapt1 -- -ra
3119+
3120+
py310-test-instrumentation-httpx-2-wrapt2:
3121+
name: instrumentation-httpx-2-wrapt2
3122+
runs-on: ubuntu-latest
3123+
timeout-minutes: 30
3124+
steps:
3125+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
3126+
uses: actions/checkout@v4
3127+
with:
3128+
repository: open-telemetry/opentelemetry-python-contrib
3129+
ref: ${{ env.CONTRIB_REPO_SHA }}
3130+
3131+
- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
3132+
uses: actions/checkout@v4
3133+
with:
3134+
repository: open-telemetry/opentelemetry-python
3135+
ref: ${{ env.CORE_REPO_SHA }}
3136+
path: opentelemetry-python
3137+
3138+
- name: Set up Python 3.10
3139+
uses: actions/setup-python@v5
3140+
with:
3141+
python-version: "3.10"
3142+
architecture: "x64"
3143+
3144+
- name: Install tox
3145+
run: pip install tox-uv
3146+
3147+
- name: Run tests
3148+
run: tox -e py310-test-instrumentation-httpx-2-wrapt2 -- -ra
3149+
3150+
py310-test-instrumentation-httpx-3-wrapt1:
3151+
name: instrumentation-httpx-3-wrapt1
3152+
runs-on: ubuntu-latest
3153+
timeout-minutes: 30
3154+
steps:
3155+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
3156+
uses: actions/checkout@v4
3157+
with:
3158+
repository: open-telemetry/opentelemetry-python-contrib
3159+
ref: ${{ env.CONTRIB_REPO_SHA }}
3160+
3161+
- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
3162+
uses: actions/checkout@v4
3163+
with:
3164+
repository: open-telemetry/opentelemetry-python
3165+
ref: ${{ env.CORE_REPO_SHA }}
3166+
path: opentelemetry-python
3167+
3168+
- name: Set up Python 3.10
3169+
uses: actions/setup-python@v5
3170+
with:
3171+
python-version: "3.10"
3172+
architecture: "x64"
3173+
3174+
- name: Install tox
3175+
run: pip install tox-uv
3176+
3177+
- name: Run tests
3178+
run: tox -e py310-test-instrumentation-httpx-3-wrapt1 -- -ra
3179+
3180+
py310-test-instrumentation-httpx-3-wrapt2:
3181+
name: instrumentation-httpx-3-wrapt2
3182+
runs-on: ubuntu-latest
3183+
timeout-minutes: 30
3184+
steps:
3185+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
3186+
uses: actions/checkout@v4
3187+
with:
3188+
repository: open-telemetry/opentelemetry-python-contrib
3189+
ref: ${{ env.CONTRIB_REPO_SHA }}
3190+
3191+
- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
3192+
uses: actions/checkout@v4
3193+
with:
3194+
repository: open-telemetry/opentelemetry-python
3195+
ref: ${{ env.CORE_REPO_SHA }}
3196+
path: opentelemetry-python
3197+
3198+
- name: Set up Python 3.10
3199+
uses: actions/setup-python@v5
3200+
with:
3201+
python-version: "3.10"
3202+
architecture: "x64"
3203+
3204+
- name: Install tox
3205+
run: pip install tox-uv
3206+
3207+
- name: Run tests
3208+
run: tox -e py310-test-instrumentation-httpx-3-wrapt2 -- -ra
3209+
30903210
py310-test-util-http:
30913211
name: util-http
30923212
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)