Skip to content

Commit f0759b7

Browse files
committed
Add asyncclick instrumentation
* Add instrumentation for asyncclick based CLI apps * Add tox * Add Changelog * Update workflows This implementation is based on the original click instrumentation work by: - Emídio Neto <[email protected]> - Anuraag (Rag) Agrawal <[email protected]> - Riccardo Magliocchetti <[email protected]>
1 parent fa8a699 commit f0759b7

File tree

23 files changed

+1173
-278
lines changed

23 files changed

+1173
-278
lines changed

.github/component_owners.yml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ components:
1111
- oxeye-nikolay
1212
- nikosokolik
1313

14+
instrumentation/opentelemetry-instrumentation-asyncclick:
15+
- jomcgi
16+
1417
instrumentation/opentelemetry-instrumentation-kafka-python:
1518
- nozik
1619

.github/workflows/core_contrib_test_0.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,28 @@ jobs:
525525
- name: Run tests
526526
run: tox -e py38-test-instrumentation-boto -- -ra
527527

528+
py38-test-instrumentation-asyncclick:
529+
name: instrumentation-asyncclick
530+
runs-on: ubuntu-latest
531+
steps:
532+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
533+
uses: actions/checkout@v4
534+
with:
535+
repository: open-telemetry/opentelemetry-python-contrib
536+
ref: ${{ env.CONTRIB_REPO_SHA }}
537+
538+
- name: Set up Python 3.8
539+
uses: actions/setup-python@v5
540+
with:
541+
python-version: "3.8"
542+
architecture: "x64"
543+
544+
- name: Install tox
545+
run: pip install tox-uv
546+
547+
- name: Run tests
548+
run: tox -e py38-test-instrumentation-asyncclick -- -ra
549+
528550
py38-test-instrumentation-click:
529551
name: instrumentation-click
530552
runs-on: ubuntu-latest
@@ -877,30 +899,8 @@ jobs:
877899
- name: Run tests
878900
run: tox -e py38-test-instrumentation-requests -- -ra
879901

880-
py38-test-instrumentation-starlette-oldest:
881-
name: instrumentation-starlette-oldest
882-
runs-on: ubuntu-latest
883-
steps:
884-
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
885-
uses: actions/checkout@v4
886-
with:
887-
repository: open-telemetry/opentelemetry-python-contrib
888-
ref: ${{ env.CONTRIB_REPO_SHA }}
889-
890-
- name: Set up Python 3.8
891-
uses: actions/setup-python@v5
892-
with:
893-
python-version: "3.8"
894-
architecture: "x64"
895-
896-
- name: Install tox
897-
run: pip install tox-uv
898-
899-
- name: Run tests
900-
run: tox -e py38-test-instrumentation-starlette-oldest -- -ra
901-
902-
py38-test-instrumentation-starlette-latest:
903-
name: instrumentation-starlette-latest
902+
py38-test-instrumentation-starlette:
903+
name: instrumentation-starlette
904904
runs-on: ubuntu-latest
905905
steps:
906906
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
@@ -919,7 +919,7 @@ jobs:
919919
run: pip install tox-uv
920920

921921
- name: Run tests
922-
run: tox -e py38-test-instrumentation-starlette-latest -- -ra
922+
run: tox -e py38-test-instrumentation-starlette -- -ra
923923

924924
py38-test-instrumentation-jinja2:
925925
name: instrumentation-jinja2

.github/workflows/lint_0.yml

+18
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,24 @@ jobs:
322322
- name: Run tests
323323
run: tox -e lint-instrumentation-boto
324324

325+
lint-instrumentation-asyncclick:
326+
name: instrumentation-asyncclick
327+
runs-on: ubuntu-latest
328+
steps:
329+
- name: Checkout repo @ SHA - ${{ github.sha }}
330+
uses: actions/checkout@v4
331+
332+
- name: Set up Python 3.13
333+
uses: actions/setup-python@v5
334+
with:
335+
python-version: "3.13"
336+
337+
- name: Install tox
338+
run: pip install tox-uv
339+
340+
- name: Run tests
341+
run: tox -e lint-instrumentation-asyncclick
342+
325343
lint-instrumentation-click:
326344
name: instrumentation-click
327345
runs-on: ubuntu-latest

.github/workflows/test_0.yml

+126-126
Original file line numberDiff line numberDiff line change
@@ -2842,6 +2842,132 @@ jobs:
28422842
- name: Run tests
28432843
run: tox -e py311-test-instrumentation-boto -- -ra
28442844

2845+
py38-test-instrumentation-asyncclick_ubuntu-latest:
2846+
name: instrumentation-asyncclick 3.8 Ubuntu
2847+
runs-on: ubuntu-latest
2848+
steps:
2849+
- name: Checkout repo @ SHA - ${{ github.sha }}
2850+
uses: actions/checkout@v4
2851+
2852+
- name: Set up Python 3.8
2853+
uses: actions/setup-python@v5
2854+
with:
2855+
python-version: "3.8"
2856+
2857+
- name: Install tox
2858+
run: pip install tox-uv
2859+
2860+
- name: Run tests
2861+
run: tox -e py38-test-instrumentation-asyncclick -- -ra
2862+
2863+
py39-test-instrumentation-asyncclick_ubuntu-latest:
2864+
name: instrumentation-asyncclick 3.9 Ubuntu
2865+
runs-on: ubuntu-latest
2866+
steps:
2867+
- name: Checkout repo @ SHA - ${{ github.sha }}
2868+
uses: actions/checkout@v4
2869+
2870+
- name: Set up Python 3.9
2871+
uses: actions/setup-python@v5
2872+
with:
2873+
python-version: "3.9"
2874+
2875+
- name: Install tox
2876+
run: pip install tox-uv
2877+
2878+
- name: Run tests
2879+
run: tox -e py39-test-instrumentation-asyncclick -- -ra
2880+
2881+
py310-test-instrumentation-asyncclick_ubuntu-latest:
2882+
name: instrumentation-asyncclick 3.10 Ubuntu
2883+
runs-on: ubuntu-latest
2884+
steps:
2885+
- name: Checkout repo @ SHA - ${{ github.sha }}
2886+
uses: actions/checkout@v4
2887+
2888+
- name: Set up Python 3.10
2889+
uses: actions/setup-python@v5
2890+
with:
2891+
python-version: "3.10"
2892+
2893+
- name: Install tox
2894+
run: pip install tox-uv
2895+
2896+
- name: Run tests
2897+
run: tox -e py310-test-instrumentation-asyncclick -- -ra
2898+
2899+
py311-test-instrumentation-asyncclick_ubuntu-latest:
2900+
name: instrumentation-asyncclick 3.11 Ubuntu
2901+
runs-on: ubuntu-latest
2902+
steps:
2903+
- name: Checkout repo @ SHA - ${{ github.sha }}
2904+
uses: actions/checkout@v4
2905+
2906+
- name: Set up Python 3.11
2907+
uses: actions/setup-python@v5
2908+
with:
2909+
python-version: "3.11"
2910+
2911+
- name: Install tox
2912+
run: pip install tox-uv
2913+
2914+
- name: Run tests
2915+
run: tox -e py311-test-instrumentation-asyncclick -- -ra
2916+
2917+
py312-test-instrumentation-asyncclick_ubuntu-latest:
2918+
name: instrumentation-asyncclick 3.12 Ubuntu
2919+
runs-on: ubuntu-latest
2920+
steps:
2921+
- name: Checkout repo @ SHA - ${{ github.sha }}
2922+
uses: actions/checkout@v4
2923+
2924+
- name: Set up Python 3.12
2925+
uses: actions/setup-python@v5
2926+
with:
2927+
python-version: "3.12"
2928+
2929+
- name: Install tox
2930+
run: pip install tox-uv
2931+
2932+
- name: Run tests
2933+
run: tox -e py312-test-instrumentation-asyncclick -- -ra
2934+
2935+
py313-test-instrumentation-asyncclick_ubuntu-latest:
2936+
name: instrumentation-asyncclick 3.13 Ubuntu
2937+
runs-on: ubuntu-latest
2938+
steps:
2939+
- name: Checkout repo @ SHA - ${{ github.sha }}
2940+
uses: actions/checkout@v4
2941+
2942+
- name: Set up Python 3.13
2943+
uses: actions/setup-python@v5
2944+
with:
2945+
python-version: "3.13"
2946+
2947+
- name: Install tox
2948+
run: pip install tox-uv
2949+
2950+
- name: Run tests
2951+
run: tox -e py313-test-instrumentation-asyncclick -- -ra
2952+
2953+
pypy3-test-instrumentation-asyncclick_ubuntu-latest:
2954+
name: instrumentation-asyncclick pypy-3.8 Ubuntu
2955+
runs-on: ubuntu-latest
2956+
steps:
2957+
- name: Checkout repo @ SHA - ${{ github.sha }}
2958+
uses: actions/checkout@v4
2959+
2960+
- name: Set up Python pypy-3.8
2961+
uses: actions/setup-python@v5
2962+
with:
2963+
python-version: "pypy-3.8"
2964+
2965+
- name: Install tox
2966+
run: pip install tox-uv
2967+
2968+
- name: Run tests
2969+
run: tox -e pypy3-test-instrumentation-asyncclick -- -ra
2970+
28452971
py38-test-instrumentation-click_ubuntu-latest:
28462972
name: instrumentation-click 3.8 Ubuntu
28472973
runs-on: ubuntu-latest
@@ -4389,129 +4515,3 @@ jobs:
43894515

43904516
- name: Run tests
43914517
run: tox -e py312-test-instrumentation-urllib -- -ra
4392-
4393-
py313-test-instrumentation-urllib_ubuntu-latest:
4394-
name: instrumentation-urllib 3.13 Ubuntu
4395-
runs-on: ubuntu-latest
4396-
steps:
4397-
- name: Checkout repo @ SHA - ${{ github.sha }}
4398-
uses: actions/checkout@v4
4399-
4400-
- name: Set up Python 3.13
4401-
uses: actions/setup-python@v5
4402-
with:
4403-
python-version: "3.13"
4404-
4405-
- name: Install tox
4406-
run: pip install tox-uv
4407-
4408-
- name: Run tests
4409-
run: tox -e py313-test-instrumentation-urllib -- -ra
4410-
4411-
pypy3-test-instrumentation-urllib_ubuntu-latest:
4412-
name: instrumentation-urllib pypy-3.8 Ubuntu
4413-
runs-on: ubuntu-latest
4414-
steps:
4415-
- name: Checkout repo @ SHA - ${{ github.sha }}
4416-
uses: actions/checkout@v4
4417-
4418-
- name: Set up Python pypy-3.8
4419-
uses: actions/setup-python@v5
4420-
with:
4421-
python-version: "pypy-3.8"
4422-
4423-
- name: Install tox
4424-
run: pip install tox-uv
4425-
4426-
- name: Run tests
4427-
run: tox -e pypy3-test-instrumentation-urllib -- -ra
4428-
4429-
py38-test-instrumentation-urllib3-0_ubuntu-latest:
4430-
name: instrumentation-urllib3-0 3.8 Ubuntu
4431-
runs-on: ubuntu-latest
4432-
steps:
4433-
- name: Checkout repo @ SHA - ${{ github.sha }}
4434-
uses: actions/checkout@v4
4435-
4436-
- name: Set up Python 3.8
4437-
uses: actions/setup-python@v5
4438-
with:
4439-
python-version: "3.8"
4440-
4441-
- name: Install tox
4442-
run: pip install tox-uv
4443-
4444-
- name: Run tests
4445-
run: tox -e py38-test-instrumentation-urllib3-0 -- -ra
4446-
4447-
py38-test-instrumentation-urllib3-1_ubuntu-latest:
4448-
name: instrumentation-urllib3-1 3.8 Ubuntu
4449-
runs-on: ubuntu-latest
4450-
steps:
4451-
- name: Checkout repo @ SHA - ${{ github.sha }}
4452-
uses: actions/checkout@v4
4453-
4454-
- name: Set up Python 3.8
4455-
uses: actions/setup-python@v5
4456-
with:
4457-
python-version: "3.8"
4458-
4459-
- name: Install tox
4460-
run: pip install tox-uv
4461-
4462-
- name: Run tests
4463-
run: tox -e py38-test-instrumentation-urllib3-1 -- -ra
4464-
4465-
py39-test-instrumentation-urllib3-0_ubuntu-latest:
4466-
name: instrumentation-urllib3-0 3.9 Ubuntu
4467-
runs-on: ubuntu-latest
4468-
steps:
4469-
- name: Checkout repo @ SHA - ${{ github.sha }}
4470-
uses: actions/checkout@v4
4471-
4472-
- name: Set up Python 3.9
4473-
uses: actions/setup-python@v5
4474-
with:
4475-
python-version: "3.9"
4476-
4477-
- name: Install tox
4478-
run: pip install tox-uv
4479-
4480-
- name: Run tests
4481-
run: tox -e py39-test-instrumentation-urllib3-0 -- -ra
4482-
4483-
py39-test-instrumentation-urllib3-1_ubuntu-latest:
4484-
name: instrumentation-urllib3-1 3.9 Ubuntu
4485-
runs-on: ubuntu-latest
4486-
steps:
4487-
- name: Checkout repo @ SHA - ${{ github.sha }}
4488-
uses: actions/checkout@v4
4489-
4490-
- name: Set up Python 3.9
4491-
uses: actions/setup-python@v5
4492-
with:
4493-
python-version: "3.9"
4494-
4495-
- name: Install tox
4496-
run: pip install tox-uv
4497-
4498-
- name: Run tests
4499-
run: tox -e py39-test-instrumentation-urllib3-1 -- -ra
4500-
4501-
py310-test-instrumentation-urllib3-0_ubuntu-latest:
4502-
name: instrumentation-urllib3-0 3.10 Ubuntu
4503-
runs-on: ubuntu-latest
4504-
steps:
4505-
- name: Checkout repo @ SHA - ${{ github.sha }}
4506-
uses: actions/checkout@v4
4507-
4508-
- name: Set up Python 3.10
4509-
uses: actions/setup-python@v5
4510-
with:
4511-
python-version: "3.10"
4512-
4513-
- name: Install tox
4514-
run: pip install tox-uv
4515-
4516-
- name: Run tests
4517-
run: tox -e py310-test-instrumentation-urllib3-0 -- -ra

0 commit comments

Comments
 (0)