From 00a3ca2eb5bedddeab134d2e238ed8404b86e3c6 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Tue, 30 Apr 2024 13:33:45 -0700 Subject: [PATCH 1/6] Diff from 2101 --- .../instrumentation/bootstrap_gen.py | 4 --- scripts/otel_packaging.py | 27 ++++++++++--------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 9eebd5bb38..f7a97f56f8 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -24,10 +24,6 @@ "library": "aiohttp ~= 3.0", "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev", }, - { - "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev", - }, { "library": "aiopg >= 0.13.0, < 2.0.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.46b0.dev", diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py index 2f42e44189..434807fb97 100644 --- a/scripts/otel_packaging.py +++ b/scripts/otel_packaging.py @@ -13,10 +13,9 @@ # limitations under the License. import os -import subprocess -from subprocess import CalledProcessError import tomli +from requests import get scripts_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.dirname(scripts_path) @@ -29,17 +28,19 @@ def get_instrumentation_packages(): if not os.path.isdir(pkg_path): continue + error = f"Could not get version for package {pkg}" try: - version = subprocess.check_output( - "hatch version", - shell=True, - cwd=pkg_path, - universal_newlines=True, - ) - except CalledProcessError as exc: - print(f"Could not get hatch version from path {pkg_path}") - print(exc.output) - raise exc + response = get(f"https://pypi.org/pypi/{pkg}/json", timeout=10) + + except Exception: + print(error) + continue + + if response.status_code != 200: + print(error) + continue + + version = response.json()["info"]["version"] pyproject_toml_path = os.path.join(pkg_path, "pyproject.toml") @@ -63,4 +64,4 @@ def get_instrumentation_packages(): if __name__ == "__main__": - print(list(get_instrumentation_packages())) + print(list(get_instrumentation_packages())) \ No newline at end of file From c02c78f9abe995b561612f4f1d17cab0ccb2d876 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Tue, 30 Apr 2024 13:37:27 -0700 Subject: [PATCH 2/6] Skip aiohttp-server in get pkgs --- scripts/generate_instrumentation_bootstrap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index 1c0cc30f7b..36eb43e713 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -59,6 +59,10 @@ def main(): default_instrumentations = ast.List(elts=[]) libraries = ast.List(elts=[]) for pkg in get_instrumentation_packages(): + # FIXME: Remove this logic once these packages are available in Pypi + if pkg["name"] == "opentelemetry-instrumentation-aiohttp-server": + continue + if not pkg["instruments"]: default_instrumentations.elts.append(ast.Str(pkg["requirement"])) for target_pkg in pkg["instruments"]: From 45dd80f8e3207b65feda502cc916897ca954025a Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Tue, 30 Apr 2024 13:39:50 -0700 Subject: [PATCH 3/6] Force AwsLambda rely on deps elsewhere --- .../opentelemetry-instrumentation-aws-lambda/pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 3088c47dbe..d82585c861 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -20,11 +20,6 @@ classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", ] -dependencies = [ - "opentelemetry-instrumentation == 0.46b0.dev", - "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.46b0.dev", -] [project.optional-dependencies] instruments = [] From 7435c80758b8ab04a428315fa0d924789fa08a25 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Tue, 30 Apr 2024 13:40:04 -0700 Subject: [PATCH 4/6] Mock AwsLambda 0.45b0 --- .../src/opentelemetry/instrumentation/aws_lambda/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index ff4933b20b..6deb7c3d9e 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.46b0.dev" +__version__ = "0.45b0" From e64c0aaa086ce964dca19eef7285019ec558e40b Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Tue, 30 Apr 2024 16:41:43 -0700 Subject: [PATCH 5/6] Mock otel-inst 0.45b0 --- .../src/opentelemetry/instrumentation/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index ff4933b20b..6deb7c3d9e 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.46b0.dev" +__version__ = "0.45b0" From 87698df9a95e3ae5eeca31175ee87ab296d960ef Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Mon, 3 Jun 2024 16:38:59 -0700 Subject: [PATCH 6/6] Rm missing aiohttp package workaround --- scripts/generate_instrumentation_bootstrap.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index 36eb43e713..1c0cc30f7b 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -59,10 +59,6 @@ def main(): default_instrumentations = ast.List(elts=[]) libraries = ast.List(elts=[]) for pkg in get_instrumentation_packages(): - # FIXME: Remove this logic once these packages are available in Pypi - if pkg["name"] == "opentelemetry-instrumentation-aiohttp-server": - continue - if not pkg["instruments"]: default_instrumentations.elts.append(ast.Str(pkg["requirement"])) for target_pkg in pkg["instruments"]: