Skip to content

Commit fd36e48

Browse files
xrmxanuraagaemdneto
committed
Add click instrumentation (open-telemetry#2994)
* Add instrumentation for click based CLI apps Co-authored-by: Anuraag (Rag) Agrawal <[email protected]> * Add tox * Add Changelog * Silence pylint * Update tox.ini Co-authored-by: Emídio Neto <[email protected]> * Update instrumentation/opentelemetry-instrumentation-click/pyproject.toml * Add baseline version * Adhere to new cli span semconv * Update workflows --------- Co-authored-by: Anuraag (Rag) Agrawal <[email protected]> Co-authored-by: Emídio Neto <[email protected]>
1 parent fe8518e commit fd36e48

File tree

17 files changed

+753
-144
lines changed

17 files changed

+753
-144
lines changed

Diff for: .github/workflows/core_contrib_test_0.yml

+22
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,28 @@ jobs:
459459
- name: Run tests
460460
run: tox -e py38-test-instrumentation-boto -- -ra
461461

462+
py38-test-instrumentation-click:
463+
name: instrumentation-click
464+
runs-on: ubuntu-latest
465+
steps:
466+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
467+
uses: actions/checkout@v4
468+
with:
469+
repository: open-telemetry/opentelemetry-python-contrib
470+
ref: ${{ env.CONTRIB_REPO_SHA }}
471+
472+
- name: Set up Python 3.8
473+
uses: actions/setup-python@v5
474+
with:
475+
python-version: "3.8"
476+
architecture: "x64"
477+
478+
- name: Install tox
479+
run: pip install tox
480+
481+
- name: Run tests
482+
run: tox -e py38-test-instrumentation-click -- -ra
483+
462484
py38-test-instrumentation-elasticsearch-0:
463485
name: instrumentation-elasticsearch-0
464486
runs-on: ubuntu-latest

Diff for: .github/workflows/lint_0.yml

+18
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,24 @@ jobs:
286286
- name: Run tests
287287
run: tox -e lint-instrumentation-boto
288288

289+
lint-instrumentation-click:
290+
name: instrumentation-click
291+
runs-on: ubuntu-latest
292+
steps:
293+
- name: Checkout repo @ SHA - ${{ github.sha }}
294+
uses: actions/checkout@v4
295+
296+
- name: Set up Python 3.12
297+
uses: actions/setup-python@v5
298+
with:
299+
python-version: "3.12"
300+
301+
- name: Install tox
302+
run: pip install tox
303+
304+
- name: Run tests
305+
run: tox -e lint-instrumentation-click
306+
289307
lint-instrumentation-elasticsearch:
290308
name: instrumentation-elasticsearch
291309
runs-on: ubuntu-latest

Diff for: .github/workflows/test_0.yml

+108-108
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,114 @@ jobs:
20322032
- name: Run tests
20332033
run: tox -e py311-test-instrumentation-boto -- -ra
20342034

2035+
py38-test-instrumentation-click_ubuntu-latest:
2036+
name: instrumentation-click 3.8 Ubuntu
2037+
runs-on: ubuntu-latest
2038+
steps:
2039+
- name: Checkout repo @ SHA - ${{ github.sha }}
2040+
uses: actions/checkout@v4
2041+
2042+
- name: Set up Python 3.8
2043+
uses: actions/setup-python@v5
2044+
with:
2045+
python-version: "3.8"
2046+
2047+
- name: Install tox
2048+
run: pip install tox
2049+
2050+
- name: Run tests
2051+
run: tox -e py38-test-instrumentation-click -- -ra
2052+
2053+
py39-test-instrumentation-click_ubuntu-latest:
2054+
name: instrumentation-click 3.9 Ubuntu
2055+
runs-on: ubuntu-latest
2056+
steps:
2057+
- name: Checkout repo @ SHA - ${{ github.sha }}
2058+
uses: actions/checkout@v4
2059+
2060+
- name: Set up Python 3.9
2061+
uses: actions/setup-python@v5
2062+
with:
2063+
python-version: "3.9"
2064+
2065+
- name: Install tox
2066+
run: pip install tox
2067+
2068+
- name: Run tests
2069+
run: tox -e py39-test-instrumentation-click -- -ra
2070+
2071+
py310-test-instrumentation-click_ubuntu-latest:
2072+
name: instrumentation-click 3.10 Ubuntu
2073+
runs-on: ubuntu-latest
2074+
steps:
2075+
- name: Checkout repo @ SHA - ${{ github.sha }}
2076+
uses: actions/checkout@v4
2077+
2078+
- name: Set up Python 3.10
2079+
uses: actions/setup-python@v5
2080+
with:
2081+
python-version: "3.10"
2082+
2083+
- name: Install tox
2084+
run: pip install tox
2085+
2086+
- name: Run tests
2087+
run: tox -e py310-test-instrumentation-click -- -ra
2088+
2089+
py311-test-instrumentation-click_ubuntu-latest:
2090+
name: instrumentation-click 3.11 Ubuntu
2091+
runs-on: ubuntu-latest
2092+
steps:
2093+
- name: Checkout repo @ SHA - ${{ github.sha }}
2094+
uses: actions/checkout@v4
2095+
2096+
- name: Set up Python 3.11
2097+
uses: actions/setup-python@v5
2098+
with:
2099+
python-version: "3.11"
2100+
2101+
- name: Install tox
2102+
run: pip install tox
2103+
2104+
- name: Run tests
2105+
run: tox -e py311-test-instrumentation-click -- -ra
2106+
2107+
py312-test-instrumentation-click_ubuntu-latest:
2108+
name: instrumentation-click 3.12 Ubuntu
2109+
runs-on: ubuntu-latest
2110+
steps:
2111+
- name: Checkout repo @ SHA - ${{ github.sha }}
2112+
uses: actions/checkout@v4
2113+
2114+
- name: Set up Python 3.12
2115+
uses: actions/setup-python@v5
2116+
with:
2117+
python-version: "3.12"
2118+
2119+
- name: Install tox
2120+
run: pip install tox
2121+
2122+
- name: Run tests
2123+
run: tox -e py312-test-instrumentation-click -- -ra
2124+
2125+
pypy3-test-instrumentation-click_ubuntu-latest:
2126+
name: instrumentation-click pypy-3.8 Ubuntu
2127+
runs-on: ubuntu-latest
2128+
steps:
2129+
- name: Checkout repo @ SHA - ${{ github.sha }}
2130+
uses: actions/checkout@v4
2131+
2132+
- name: Set up Python pypy-3.8
2133+
uses: actions/setup-python@v5
2134+
with:
2135+
python-version: "pypy-3.8"
2136+
2137+
- name: Install tox
2138+
run: pip install tox
2139+
2140+
- name: Run tests
2141+
run: tox -e pypy3-test-instrumentation-click -- -ra
2142+
20352143
py38-test-instrumentation-elasticsearch-0_ubuntu-latest:
20362144
name: instrumentation-elasticsearch-0 3.8 Ubuntu
20372145
runs-on: ubuntu-latest
@@ -4407,111 +4515,3 @@ jobs:
44074515

44084516
- name: Run tests
44094517
run: tox -e py312-test-instrumentation-psycopg2 -- -ra
4410-
4411-
py38-test-instrumentation-psycopg_ubuntu-latest:
4412-
name: instrumentation-psycopg 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 3.8
4419-
uses: actions/setup-python@v5
4420-
with:
4421-
python-version: "3.8"
4422-
4423-
- name: Install tox
4424-
run: pip install tox
4425-
4426-
- name: Run tests
4427-
run: tox -e py38-test-instrumentation-psycopg -- -ra
4428-
4429-
py39-test-instrumentation-psycopg_ubuntu-latest:
4430-
name: instrumentation-psycopg 3.9 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.9
4437-
uses: actions/setup-python@v5
4438-
with:
4439-
python-version: "3.9"
4440-
4441-
- name: Install tox
4442-
run: pip install tox
4443-
4444-
- name: Run tests
4445-
run: tox -e py39-test-instrumentation-psycopg -- -ra
4446-
4447-
py310-test-instrumentation-psycopg_ubuntu-latest:
4448-
name: instrumentation-psycopg 3.10 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.10
4455-
uses: actions/setup-python@v5
4456-
with:
4457-
python-version: "3.10"
4458-
4459-
- name: Install tox
4460-
run: pip install tox
4461-
4462-
- name: Run tests
4463-
run: tox -e py310-test-instrumentation-psycopg -- -ra
4464-
4465-
py311-test-instrumentation-psycopg_ubuntu-latest:
4466-
name: instrumentation-psycopg 3.11 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.11
4473-
uses: actions/setup-python@v5
4474-
with:
4475-
python-version: "3.11"
4476-
4477-
- name: Install tox
4478-
run: pip install tox
4479-
4480-
- name: Run tests
4481-
run: tox -e py311-test-instrumentation-psycopg -- -ra
4482-
4483-
py312-test-instrumentation-psycopg_ubuntu-latest:
4484-
name: instrumentation-psycopg 3.12 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.12
4491-
uses: actions/setup-python@v5
4492-
with:
4493-
python-version: "3.12"
4494-
4495-
- name: Install tox
4496-
run: pip install tox
4497-
4498-
- name: Run tests
4499-
run: tox -e py312-test-instrumentation-psycopg -- -ra
4500-
4501-
pypy3-test-instrumentation-psycopg_ubuntu-latest:
4502-
name: instrumentation-psycopg pypy-3.8 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 pypy-3.8
4509-
uses: actions/setup-python@v5
4510-
with:
4511-
python-version: "pypy-3.8"
4512-
4513-
- name: Install tox
4514-
run: pip install tox
4515-
4516-
- name: Run tests
4517-
run: tox -e pypy3-test-instrumentation-psycopg -- -ra

0 commit comments

Comments
 (0)