Skip to content

Commit a3f559b

Browse files
authored
Merge branch 'main' into click-instrumentation
2 parents d90cff6 + e3ba54b commit a3f559b

20 files changed

+438
-352
lines changed

.github/component_owners.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ components:
7373
- lzchen
7474
- gyliu513
7575
- nirga
76+
- codefromthecrypt

.github/workflows/package-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ jobs:
102102
- name: Publish to PyPI
103103
env:
104104
TWINE_USERNAME: '__token__'
105-
TWINE_PASSWORD: ${{ secrets.test_pypi_token }}
105+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
106106
run: |
107-
twine upload --repository testpypi --skip-existing --verbose dist/*
107+
twine upload --skip-existing --verbose dist/*
108108
109109
- name: Generate release notes
110110
env:

.github/workflows/release.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@ jobs:
8181
# rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
8282
# middle of the package upload causing the action to fail, and certain packages
8383
# might have already been updated, this would be bad.
84-
# EDIT: 5/31/2024 - TestPypi now requires a verified email. Commenting out as a temporary measure
85-
# until we found TestPypi credentials.
86-
# - name: Publish to TestPyPI
87-
# env:
88-
# TWINE_USERNAME: '__token__'
89-
# TWINE_PASSWORD: ${{ secrets.test_pypi_token }}
90-
# run: |
91-
# twine upload --repository testpypi --skip-existing --verbose dist/*
84+
85+
- name: Publish to TestPyPI
86+
env:
87+
TWINE_USERNAME: '__token__'
88+
TWINE_PASSWORD: ${{ secrets.test_pypi_token }}
89+
run: |
90+
twine upload --repository testpypi --skip-existing --verbose dist/*
9291
9392
- name: Publish to PyPI
9493
env:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
([#2976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2976))
1818
- `opentelemetry-instrumentation-click`: new instrumentation to trace click commands
1919
([#2994](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2994))
20+
- Add `opentelemetry-instrumentation-openai-v2` to `opentelemetry-bootstrap`
21+
([#2996](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2996))
2022

2123
### Fixed
2224

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ You can run `tox` with the following arguments:
6868
Python version
6969
* `tox -e spellcheck` to run a spellcheck on all the code
7070
* `tox -e lint-some-package` to run lint checks on `some-package`
71+
* `tox -e generate-workflows` to run creation of new CI workflows if tox environments have been updated
7172
* `tox -e ruff` to run ruff linter and formatter checks against the entire codebase
7273

7374
`ruff check` and `ruff format` are executed when `tox -e ruff` is run. We strongly recommend you to configure [pre-commit](https://pre-commit.com/) locally to run `ruff` automatically before each commit by installing it as git hooks. You just need to [install pre-commit](https://pre-commit.com/#install) in your environment:
@@ -297,6 +298,7 @@ When updating the minimum supported Python version remember to:
297298

298299
- Remove the version in `pyproject.toml` trove classifiers
299300
- Remove the version from `tox.ini`
301+
- Update github workflows accordingly with `tox -e generate-workflows`
300302
- Search for `sys.version_info` usage and remove code for unsupported versions
301303
- Bump `py-version` in `.pylintrc` for Python version dependent checks
302304

@@ -306,6 +308,6 @@ When adding support for a new Python release remember to:
306308

307309
- Add the version in `tox.ini`
308310
- Add the version in `pyproject.toml` trove classifiers
309-
- Update github workflows accordingly; lint and benchmarks use the latest supported version
311+
- Update github workflows accordingly with `tox -e generate-workflows`; lint and benchmarks use the latest supported version
310312
- Update `.pre-commit-config.yaml`
311313
- Update tox examples in the documentation

instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232

3333
[project.optional-dependencies]
3434
instruments = [
35-
"openai >= 1.0.0",
35+
"openai >= 1.26.0",
3636
]
3737

3838
[project.entry-points.opentelemetry_instrumentor]

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes/test_chat_completion_404.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interactions:
1515
- application/json
1616
accept-encoding:
1717
- gzip, deflate
18+
authorization:
19+
- Bearer test_openai_api_key
1820
connection:
1921
- keep-alive
2022
content-length:
@@ -24,7 +26,7 @@ interactions:
2426
host:
2527
- api.openai.com
2628
user-agent:
27-
- OpenAI/Python 1.26.0
29+
- OpenAI/Python 1.54.3
2830
x-stainless-arch:
2931
- arm64
3032
x-stainless-async:
@@ -34,7 +36,9 @@ interactions:
3436
x-stainless-os:
3537
- MacOS
3638
x-stainless-package-version:
37-
- 1.26.0
39+
- 1.54.3
40+
x-stainless-retry-count:
41+
- '0'
3842
x-stainless-runtime:
3943
- CPython
4044
x-stainless-runtime-version:
@@ -56,13 +60,13 @@ interactions:
5660
CF-Cache-Status:
5761
- DYNAMIC
5862
CF-RAY:
59-
- 8dd0709dffd19c8c-SIN
63+
- 8e1225a16c283d93-SIN
6064
Connection:
6165
- keep-alive
6266
Content-Type:
6367
- application/json; charset=utf-8
6468
Date:
65-
- Mon, 04 Nov 2024 00:20:44 GMT
69+
- Mon, 11 Nov 2024 23:43:52 GMT
6670
Server:
6771
- cloudflare
6872
Set-Cookie: test_set_cookie
@@ -74,13 +78,13 @@ interactions:
7478
- h3=":443"; ma=86400
7579
content-length:
7680
- '231'
77-
openai-organization: test_organization
81+
openai-organization: test_openai_org_id
7882
strict-transport-security:
7983
- max-age=31536000; includeSubDomains; preload
8084
vary:
8185
- Origin
8286
x-request-id:
83-
- req_e08854c4f7d5104af6fdc755caed30fc
87+
- req_c3e0f92d7b5426d1a4a17bb3d39953ea
8488
status:
8589
code: 404
8690
message: Not Found

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes/test_chat_completion_extra_params.yaml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interactions:
2020
- application/json
2121
accept-encoding:
2222
- gzip, deflate
23+
authorization:
24+
- Bearer test_openai_api_key
2325
connection:
2426
- keep-alive
2527
content-length:
@@ -29,7 +31,7 @@ interactions:
2931
host:
3032
- api.openai.com
3133
user-agent:
32-
- OpenAI/Python 1.26.0
34+
- OpenAI/Python 1.54.3
3335
x-stainless-arch:
3436
- arm64
3537
x-stainless-async:
@@ -39,7 +41,9 @@ interactions:
3941
x-stainless-os:
4042
- MacOS
4143
x-stainless-package-version:
42-
- 1.26.0
44+
- 1.54.3
45+
x-stainless-retry-count:
46+
- '0'
4347
x-stainless-runtime:
4448
- CPython
4549
x-stainless-runtime-version:
@@ -50,9 +54,9 @@ interactions:
5054
body:
5155
string: |-
5256
{
53-
"id": "chatcmpl-APfFNvBVQx43PNOIf1dWnEUT5u5fA",
57+
"id": "chatcmpl-ASYMT7913Sp58qhZqQgY7g7Ia2J4M",
5458
"object": "chat.completion",
55-
"created": 1730680117,
59+
"created": 1731368633,
5660
"model": "gpt-4o-mini-2024-07-18",
5761
"choices": [
5862
{
@@ -71,10 +75,14 @@ interactions:
7175
"completion_tokens": 12,
7276
"total_tokens": 24,
7377
"prompt_tokens_details": {
74-
"cached_tokens": 0
78+
"cached_tokens": 0,
79+
"audio_tokens": 0
7580
},
7681
"completion_tokens_details": {
77-
"reasoning_tokens": 0
82+
"reasoning_tokens": 0,
83+
"audio_tokens": 0,
84+
"accepted_prediction_tokens": 0,
85+
"rejected_prediction_tokens": 0
7886
}
7987
},
8088
"service_tier": "default",
@@ -84,13 +92,13 @@ interactions:
8492
CF-Cache-Status:
8593
- DYNAMIC
8694
CF-RAY:
87-
- 8dd07c2d0a5a9f98-SIN
95+
- 8e1225a3f8e9ce65-SIN
8896
Connection:
8997
- keep-alive
9098
Content-Type:
9199
- application/json
92100
Date:
93-
- Mon, 04 Nov 2024 00:28:37 GMT
101+
- Mon, 11 Nov 2024 23:43:53 GMT
94102
Server:
95103
- cloudflare
96104
Set-Cookie: test_set_cookie
@@ -103,10 +111,10 @@ interactions:
103111
alt-svc:
104112
- h3=":443"; ma=86400
105113
content-length:
106-
- '697'
107-
openai-organization: test_organization
114+
- '825'
115+
openai-organization: test_openai_org_id
108116
openai-processing-ms:
109-
- '228'
117+
- '431'
110118
openai-version:
111119
- '2020-10-01'
112120
strict-transport-security:
@@ -120,11 +128,11 @@ interactions:
120128
x-ratelimit-remaining-tokens:
121129
- '199943'
122130
x-ratelimit-reset-requests:
123-
- 13.724s
131+
- 14.746s
124132
x-ratelimit-reset-tokens:
125133
- 16ms
126134
x-request-id:
127-
- req_0ded46a4535c24c36ef58363b7538421
135+
- req_81e29a8992ea8001c0240bd990acf0ab
128136
status:
129137
code: 200
130138
message: OK

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/cassettes/test_chat_completion_multiple_choices.yaml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ interactions:
1717
- application/json
1818
accept-encoding:
1919
- gzip, deflate
20+
authorization:
21+
- Bearer test_openai_api_key
2022
connection:
2123
- keep-alive
2224
content-length:
@@ -26,7 +28,7 @@ interactions:
2628
host:
2729
- api.openai.com
2830
user-agent:
29-
- OpenAI/Python 1.26.0
31+
- OpenAI/Python 1.54.3
3032
x-stainless-arch:
3133
- arm64
3234
x-stainless-async:
@@ -36,7 +38,9 @@ interactions:
3638
x-stainless-os:
3739
- MacOS
3840
x-stainless-package-version:
39-
- 1.26.0
41+
- 1.54.3
42+
x-stainless-retry-count:
43+
- '0'
4044
x-stainless-runtime:
4145
- CPython
4246
x-stainless-runtime-version:
@@ -47,16 +51,16 @@ interactions:
4751
body:
4852
string: |-
4953
{
50-
"id": "chatcmpl-APfFO3w0cNVOphe5Lk9EaYyRaS2pm",
54+
"id": "chatcmpl-ASYMUBq69UHDarAz2fsd0O50rv0r1",
5155
"object": "chat.completion",
52-
"created": 1730680118,
56+
"created": 1731368634,
5357
"model": "gpt-4o-mini-2024-07-18",
5458
"choices": [
5559
{
5660
"index": 0,
5761
"message": {
5862
"role": "assistant",
59-
"content": "This is a test.",
63+
"content": "This is a test. How can I assist you further?",
6064
"refusal": null
6165
},
6266
"logprobs": null,
@@ -66,7 +70,7 @@ interactions:
6670
"index": 1,
6771
"message": {
6872
"role": "assistant",
69-
"content": "This is a test! How can I assist you further?",
73+
"content": "This is a test. How can I assist you further?",
7074
"refusal": null
7175
},
7276
"logprobs": null,
@@ -75,13 +79,17 @@ interactions:
7579
],
7680
"usage": {
7781
"prompt_tokens": 12,
78-
"completion_tokens": 17,
79-
"total_tokens": 29,
82+
"completion_tokens": 24,
83+
"total_tokens": 36,
8084
"prompt_tokens_details": {
81-
"cached_tokens": 0
85+
"cached_tokens": 0,
86+
"audio_tokens": 0
8287
},
8388
"completion_tokens_details": {
84-
"reasoning_tokens": 0
89+
"reasoning_tokens": 0,
90+
"audio_tokens": 0,
91+
"accepted_prediction_tokens": 0,
92+
"rejected_prediction_tokens": 0
8593
}
8694
},
8795
"system_fingerprint": "fp_0ba0d124f1"
@@ -90,13 +98,13 @@ interactions:
9098
CF-Cache-Status:
9199
- DYNAMIC
92100
CF-RAY:
93-
- 8dd07c30beda3dd4-SIN
101+
- 8e1225a91a253e53-SIN
94102
Connection:
95103
- keep-alive
96104
Content-Type:
97105
- application/json
98106
Date:
99-
- Mon, 04 Nov 2024 00:28:38 GMT
107+
- Mon, 11 Nov 2024 23:43:54 GMT
100108
Server:
101109
- cloudflare
102110
Set-Cookie: test_set_cookie
@@ -109,10 +117,10 @@ interactions:
109117
alt-svc:
110118
- h3=":443"; ma=86400
111119
content-length:
112-
- '872'
113-
openai-organization: test_organization
120+
- '1030'
121+
openai-organization: test_openai_org_id
114122
openai-processing-ms:
115-
- '261'
123+
- '399'
116124
openai-version:
117125
- '2020-10-01'
118126
strict-transport-security:
@@ -126,11 +134,11 @@ interactions:
126134
x-ratelimit-remaining-tokens:
127135
- '199962'
128136
x-ratelimit-reset-requests:
129-
- 21.785s
137+
- 22.564s
130138
x-ratelimit-reset-tokens:
131139
- 11ms
132140
x-request-id:
133-
- req_86ab6a7a85f95e2a001cfeb89e0827b1
141+
- req_01290a92a1a3d787c7a00bb3836da597
134142
status:
135143
code: 200
136144
message: OK

0 commit comments

Comments
 (0)