From 221f15dee8b7e8d98dff693718b67ddd4d778e61 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 29 Aug 2024 11:33:24 -0700 Subject: [PATCH 1/3] Merge branch 'main' of https://github.com/open-telemetry/opentelemetry-python-contrib into bugfix/registered-method-error From 0b7fec7834d06c1a5ddf154846360ab8a694e96e Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 12 Nov 2024 11:19:14 -0800 Subject: [PATCH 2/3] genai --- .../pyproject.toml | 2 +- .../opentelemetry/instrumentation/bootstrap_gen.py | 4 ++++ scripts/otel_packaging.py | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml b/instrumentation-genai/opentelemetry-instrumentation-openai-v2/pyproject.toml index eddd85e5f0..e28611d0c5 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 2e7b5532f3..6b7eae6b00 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.1b0.dev", + }, { "library": "aio_pika >= 7.2.0, < 10.0.0", "instrumentation": "opentelemetry-instrumentation-aio-pika==0.50b0.dev", diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py index 2f42e44189..45f07a2c24 100644 --- a/scripts/otel_packaging.py +++ b/scripts/otel_packaging.py @@ -21,14 +21,24 @@ 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", From fd4f8c6af52773e0ae17d74aaafdb9d07e005092 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 12 Nov 2024 12:52:53 -0800 Subject: [PATCH 3/3] ruff --- CHANGELOG.md | 2 ++ scripts/otel_packaging.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6be2429f06..24760db6c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-sqlalchemy` Update unit tests to run with SQLALchemy 2 ([#2976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2976)) + - Add `opentelemetry-instrumentation-openai-v2` to `opentelemetry-bootstrap` + ([#2996](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2996)) ### Fixed diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py index 45f07a2c24..3b09dd87eb 100644 --- a/scripts/otel_packaging.py +++ b/scripts/otel_packaging.py @@ -37,7 +37,6 @@ def get_instrumentation_packages(): continue pkg_paths.append(pkg_path) - for pkg_path in sorted(pkg_paths): try: version = subprocess.check_output(