diff --git a/CHANGELOG.md b/CHANGELOG.md index 81fab0c6d3..8339eb14d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Add `opentelemetry-instrumentation-openai-v2` to `opentelemetry-bootstrap` + ([#2996](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2996)) + ### Fixed - `opentelemetry-instrumentation-httpx`: instrument_client is a static method again diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml index b342cdade7..f1539ba641 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml +++ b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "openai >= 1.0.0", + "openai >= 1.26.0", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index c30eb4ec92..2d8d0407c0 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -16,6 +16,10 @@ # RUN `python scripts/generate_instrumentation_bootstrap.py` TO REGENERATE. libraries = [ + { + "library": "openai >= 1.26.0", + "instrumentation": "opentelemetry-instrumentation-openai-v2==2.0.0.dev", + }, { "library": "aio_pika >= 7.2.0, < 10.0.0", "instrumentation": "opentelemetry-instrumentation-aio-pika==0.49b1", diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py index 2f42e44189..3b09dd87eb 100644 --- a/scripts/otel_packaging.py +++ b/scripts/otel_packaging.py @@ -21,14 +21,23 @@ scripts_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.dirname(scripts_path) instrumentations_path = os.path.join(root_path, "instrumentation") +genai_instrumentations_path = os.path.join(root_path, "instrumentation-genai") def get_instrumentation_packages(): - for pkg in sorted(os.listdir(instrumentations_path)): + pkg_paths = [] + for pkg in os.listdir(instrumentations_path): pkg_path = os.path.join(instrumentations_path, pkg) if not os.path.isdir(pkg_path): continue + pkg_paths.append(pkg_path) + for pkg in os.listdir(genai_instrumentations_path): + pkg_path = os.path.join(genai_instrumentations_path, pkg) + if not os.path.isdir(pkg_path): + continue + pkg_paths.append(pkg_path) + for pkg_path in sorted(pkg_paths): try: version = subprocess.check_output( "hatch version",