Skip to content

Commit 1be90ae

Browse files
committed
Basic instrumentation for Bedrock runtime Converse api (open-telemetry#3161)
* botocore: add extension for bedrock runtime api * Add tests and handle only non streaming responses * Make it explicit we are handling only the converse operation * Simplify test since all models behaves the same * Add test for error case and rework things a bit * Add converse example * Generate workflows * Add changelog
1 parent ee3203e commit 1be90ae

File tree

20 files changed

+1234
-239
lines changed

20 files changed

+1234
-239
lines changed

.github/workflows/core_contrib_test_0.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ jobs:
349349
- name: Run tests
350350
run: tox -e py38-test-instrumentation-aws-lambda -- -ra
351351

352-
py38-test-instrumentation-botocore:
353-
name: instrumentation-botocore
352+
py38-test-instrumentation-botocore-0:
353+
name: instrumentation-botocore-0
354354
runs-on: ubuntu-latest
355355
steps:
356356
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
@@ -369,7 +369,29 @@ jobs:
369369
run: pip install tox-uv
370370

371371
- name: Run tests
372-
run: tox -e py38-test-instrumentation-botocore -- -ra
372+
run: tox -e py38-test-instrumentation-botocore-0 -- -ra
373+
374+
py38-test-instrumentation-botocore-1:
375+
name: instrumentation-botocore-1
376+
runs-on: ubuntu-latest
377+
steps:
378+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
379+
uses: actions/checkout@v4
380+
with:
381+
repository: open-telemetry/opentelemetry-python-contrib
382+
ref: ${{ env.CONTRIB_REPO_SHA }}
383+
384+
- name: Set up Python 3.8
385+
uses: actions/setup-python@v5
386+
with:
387+
python-version: "3.8"
388+
architecture: "x64"
389+
390+
- name: Install tox
391+
run: pip install tox-uv
392+
393+
- name: Run tests
394+
run: tox -e py38-test-instrumentation-botocore-1 -- -ra
373395

374396
py38-test-instrumentation-boto3sqs:
375397
name: instrumentation-boto3sqs

.github/workflows/test_0.yml

+126-126
Original file line numberDiff line numberDiff line change
@@ -1852,8 +1852,8 @@ jobs:
18521852
- name: Run tests
18531853
run: tox -e pypy3-test-instrumentation-aws-lambda -- -ra
18541854

1855-
py38-test-instrumentation-botocore_ubuntu-latest:
1856-
name: instrumentation-botocore 3.8 Ubuntu
1855+
py38-test-instrumentation-botocore-0_ubuntu-latest:
1856+
name: instrumentation-botocore-0 3.8 Ubuntu
18571857
runs-on: ubuntu-latest
18581858
steps:
18591859
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -1868,10 +1868,28 @@ jobs:
18681868
run: pip install tox-uv
18691869

18701870
- name: Run tests
1871-
run: tox -e py38-test-instrumentation-botocore -- -ra
1871+
run: tox -e py38-test-instrumentation-botocore-0 -- -ra
18721872

1873-
py39-test-instrumentation-botocore_ubuntu-latest:
1874-
name: instrumentation-botocore 3.9 Ubuntu
1873+
py38-test-instrumentation-botocore-1_ubuntu-latest:
1874+
name: instrumentation-botocore-1 3.8 Ubuntu
1875+
runs-on: ubuntu-latest
1876+
steps:
1877+
- name: Checkout repo @ SHA - ${{ github.sha }}
1878+
uses: actions/checkout@v4
1879+
1880+
- name: Set up Python 3.8
1881+
uses: actions/setup-python@v5
1882+
with:
1883+
python-version: "3.8"
1884+
1885+
- name: Install tox
1886+
run: pip install tox-uv
1887+
1888+
- name: Run tests
1889+
run: tox -e py38-test-instrumentation-botocore-1 -- -ra
1890+
1891+
py39-test-instrumentation-botocore-0_ubuntu-latest:
1892+
name: instrumentation-botocore-0 3.9 Ubuntu
18751893
runs-on: ubuntu-latest
18761894
steps:
18771895
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -1886,10 +1904,46 @@ jobs:
18861904
run: pip install tox-uv
18871905

18881906
- name: Run tests
1889-
run: tox -e py39-test-instrumentation-botocore -- -ra
1907+
run: tox -e py39-test-instrumentation-botocore-0 -- -ra
1908+
1909+
py39-test-instrumentation-botocore-1_ubuntu-latest:
1910+
name: instrumentation-botocore-1 3.9 Ubuntu
1911+
runs-on: ubuntu-latest
1912+
steps:
1913+
- name: Checkout repo @ SHA - ${{ github.sha }}
1914+
uses: actions/checkout@v4
1915+
1916+
- name: Set up Python 3.9
1917+
uses: actions/setup-python@v5
1918+
with:
1919+
python-version: "3.9"
1920+
1921+
- name: Install tox
1922+
run: pip install tox-uv
1923+
1924+
- name: Run tests
1925+
run: tox -e py39-test-instrumentation-botocore-1 -- -ra
1926+
1927+
py310-test-instrumentation-botocore-0_ubuntu-latest:
1928+
name: instrumentation-botocore-0 3.10 Ubuntu
1929+
runs-on: ubuntu-latest
1930+
steps:
1931+
- name: Checkout repo @ SHA - ${{ github.sha }}
1932+
uses: actions/checkout@v4
1933+
1934+
- name: Set up Python 3.10
1935+
uses: actions/setup-python@v5
1936+
with:
1937+
python-version: "3.10"
1938+
1939+
- name: Install tox
1940+
run: pip install tox-uv
1941+
1942+
- name: Run tests
1943+
run: tox -e py310-test-instrumentation-botocore-0 -- -ra
18901944

1891-
py310-test-instrumentation-botocore_ubuntu-latest:
1892-
name: instrumentation-botocore 3.10 Ubuntu
1945+
py310-test-instrumentation-botocore-1_ubuntu-latest:
1946+
name: instrumentation-botocore-1 3.10 Ubuntu
18931947
runs-on: ubuntu-latest
18941948
steps:
18951949
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -1904,10 +1958,10 @@ jobs:
19041958
run: pip install tox-uv
19051959

19061960
- name: Run tests
1907-
run: tox -e py310-test-instrumentation-botocore -- -ra
1961+
run: tox -e py310-test-instrumentation-botocore-1 -- -ra
19081962

1909-
py311-test-instrumentation-botocore_ubuntu-latest:
1910-
name: instrumentation-botocore 3.11 Ubuntu
1963+
py311-test-instrumentation-botocore-0_ubuntu-latest:
1964+
name: instrumentation-botocore-0 3.11 Ubuntu
19111965
runs-on: ubuntu-latest
19121966
steps:
19131967
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -1922,10 +1976,28 @@ jobs:
19221976
run: pip install tox-uv
19231977

19241978
- name: Run tests
1925-
run: tox -e py311-test-instrumentation-botocore -- -ra
1979+
run: tox -e py311-test-instrumentation-botocore-0 -- -ra
19261980

1927-
py312-test-instrumentation-botocore_ubuntu-latest:
1928-
name: instrumentation-botocore 3.12 Ubuntu
1981+
py311-test-instrumentation-botocore-1_ubuntu-latest:
1982+
name: instrumentation-botocore-1 3.11 Ubuntu
1983+
runs-on: ubuntu-latest
1984+
steps:
1985+
- name: Checkout repo @ SHA - ${{ github.sha }}
1986+
uses: actions/checkout@v4
1987+
1988+
- name: Set up Python 3.11
1989+
uses: actions/setup-python@v5
1990+
with:
1991+
python-version: "3.11"
1992+
1993+
- name: Install tox
1994+
run: pip install tox-uv
1995+
1996+
- name: Run tests
1997+
run: tox -e py311-test-instrumentation-botocore-1 -- -ra
1998+
1999+
py312-test-instrumentation-botocore-0_ubuntu-latest:
2000+
name: instrumentation-botocore-0 3.12 Ubuntu
19292001
runs-on: ubuntu-latest
19302002
steps:
19312003
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -1940,10 +2012,46 @@ jobs:
19402012
run: pip install tox-uv
19412013

19422014
- name: Run tests
1943-
run: tox -e py312-test-instrumentation-botocore -- -ra
2015+
run: tox -e py312-test-instrumentation-botocore-0 -- -ra
2016+
2017+
py312-test-instrumentation-botocore-1_ubuntu-latest:
2018+
name: instrumentation-botocore-1 3.12 Ubuntu
2019+
runs-on: ubuntu-latest
2020+
steps:
2021+
- name: Checkout repo @ SHA - ${{ github.sha }}
2022+
uses: actions/checkout@v4
2023+
2024+
- name: Set up Python 3.12
2025+
uses: actions/setup-python@v5
2026+
with:
2027+
python-version: "3.12"
2028+
2029+
- name: Install tox
2030+
run: pip install tox-uv
2031+
2032+
- name: Run tests
2033+
run: tox -e py312-test-instrumentation-botocore-1 -- -ra
2034+
2035+
py313-test-instrumentation-botocore-0_ubuntu-latest:
2036+
name: instrumentation-botocore-0 3.13 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.13
2043+
uses: actions/setup-python@v5
2044+
with:
2045+
python-version: "3.13"
2046+
2047+
- name: Install tox
2048+
run: pip install tox-uv
2049+
2050+
- name: Run tests
2051+
run: tox -e py313-test-instrumentation-botocore-0 -- -ra
19442052

1945-
py313-test-instrumentation-botocore_ubuntu-latest:
1946-
name: instrumentation-botocore 3.13 Ubuntu
2053+
py313-test-instrumentation-botocore-1_ubuntu-latest:
2054+
name: instrumentation-botocore-1 3.13 Ubuntu
19472055
runs-on: ubuntu-latest
19482056
steps:
19492057
- name: Checkout repo @ SHA - ${{ github.sha }}
@@ -1958,7 +2066,7 @@ jobs:
19582066
run: pip install tox-uv
19592067

19602068
- name: Run tests
1961-
run: tox -e py313-test-instrumentation-botocore -- -ra
2069+
run: tox -e py313-test-instrumentation-botocore-1 -- -ra
19622070

19632071
py38-test-instrumentation-boto3sqs_ubuntu-latest:
19642072
name: instrumentation-boto3sqs 3.8 Ubuntu
@@ -4407,111 +4515,3 @@ jobs:
44074515

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

0 commit comments

Comments
 (0)