Skip to content

Commit 2286b86

Browse files
lzchenxrmx
authored andcommitted
Add openai instrumentation to opentelemetry-bootstrap (open-telemetry#2996)
1 parent f0bd9d1 commit 2286b86

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- `opentelemetry-instrumentation-sqlalchemy` Update unit tests to run with SQLALchemy 2
1717
([#2976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2976))
18+
- Add `opentelemetry-instrumentation-openai-v2` to `opentelemetry-bootstrap`
19+
([#2996](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2996))
1820

1921
### Fixed
2022

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

+1-1
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]

opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
# RUN `python scripts/generate_instrumentation_bootstrap.py` TO REGENERATE.
1717

1818
libraries = [
19+
{
20+
"library": "openai >= 1.26.0",
21+
"instrumentation": "opentelemetry-instrumentation-openai-v2==2.1b0.dev",
22+
},
1923
{
2024
"library": "aio_pika >= 7.2.0, < 10.0.0",
2125
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.50b0.dev",

scripts/otel_packaging.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,23 @@
2121
scripts_path = os.path.dirname(os.path.abspath(__file__))
2222
root_path = os.path.dirname(scripts_path)
2323
instrumentations_path = os.path.join(root_path, "instrumentation")
24+
genai_instrumentations_path = os.path.join(root_path, "instrumentation-genai")
2425

2526

2627
def get_instrumentation_packages():
27-
for pkg in sorted(os.listdir(instrumentations_path)):
28+
pkg_paths = []
29+
for pkg in os.listdir(instrumentations_path):
2830
pkg_path = os.path.join(instrumentations_path, pkg)
2931
if not os.path.isdir(pkg_path):
3032
continue
33+
pkg_paths.append(pkg_path)
34+
for pkg in os.listdir(genai_instrumentations_path):
35+
pkg_path = os.path.join(genai_instrumentations_path, pkg)
36+
if not os.path.isdir(pkg_path):
37+
continue
38+
pkg_paths.append(pkg_path)
3139

40+
for pkg_path in sorted(pkg_paths):
3241
try:
3342
version = subprocess.check_output(
3443
"hatch version",

0 commit comments

Comments
 (0)