From 76d5231bf2503c42f870f0d493d2972960960795 Mon Sep 17 00:00:00 2001 From: emdneto <9735060+emdneto@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:43:06 -0300 Subject: [PATCH 1/4] remove aws-lambda from default instrumentation in opentelemetry-bootstrap --- CHANGELOG.md | 5 ++++- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 1 - scripts/generate_instrumentation_bootstrap.py | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3b91462ba..15f8ecbe79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-kafka-python` Instrument temporary fork, kafka-python-ng inside kafka-python's instrumentation - ([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537))) + ([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537)) ## Breaking changes +- `opentelemetry-bootstrap` Remove `opentelemetry-instrumentation-aws-lambda` from the defaults instrumentations + ([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537)) + ## Fixed - `opentelemetry-instrumentation-aws-lambda` Avoid exception when a handler is not present. diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 1c9bd63874..bc0706d25a 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -191,7 +191,6 @@ ] default_instrumentations = [ "opentelemetry-instrumentation-asyncio==0.48b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.48b0.dev", "opentelemetry-instrumentation-dbapi==0.48b0.dev", "opentelemetry-instrumentation-logging==0.48b0.dev", "opentelemetry-instrumentation-sqlite3==0.48b0.dev", diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index 1c0cc30f7b..eeca0079a6 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -53,12 +53,16 @@ "bootstrap_gen.py", ) +packages_to_ignore = "opentelemetry-instrumentation-aws-lambda" + def main(): # pylint: disable=no-member default_instrumentations = ast.List(elts=[]) libraries = ast.List(elts=[]) for pkg in get_instrumentation_packages(): + if pkg.get("name") in packages_to_ignore: + continue if not pkg["instruments"]: default_instrumentations.elts.append(ast.Str(pkg["requirement"])) for target_pkg in pkg["instruments"]: From 378b3060686aac70d232111e88cd377ab75fc1b9 Mon Sep 17 00:00:00 2001 From: emdneto <9735060+emdneto@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:55:23 -0300 Subject: [PATCH 2/4] fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f8ecbe79..ccd98bcd39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Breaking changes - `opentelemetry-bootstrap` Remove `opentelemetry-instrumentation-aws-lambda` from the defaults instrumentations - ([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537)) + ([#2786](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2786)) ## Fixed From 6ad412cd3f039387f809c7287c7f65dbf9a673e3 Mon Sep 17 00:00:00 2001 From: emdneto <9735060+emdneto@users.noreply.github.com> Date: Wed, 7 Aug 2024 22:44:14 -0300 Subject: [PATCH 3/4] fix script --- scripts/generate_instrumentation_bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index eeca0079a6..9966cb7557 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -53,7 +53,7 @@ "bootstrap_gen.py", ) -packages_to_ignore = "opentelemetry-instrumentation-aws-lambda" +packages_to_ignore = ["opentelemetry-instrumentation-aws-lambda"] def main(): From cab212f2b31483fae9e9d13860a7be77a98b4ee5 Mon Sep 17 00:00:00 2001 From: emdneto <9735060+emdneto@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:10:14 -0300 Subject: [PATCH 4/4] add comment explaining why removing aws-lambda --- scripts/generate_instrumentation_bootstrap.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index 9966cb7557..57af33e303 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -53,7 +53,12 @@ "bootstrap_gen.py", ) -packages_to_ignore = ["opentelemetry-instrumentation-aws-lambda"] +# AWS Lambda instrumentation is excluded from the default list because it often +# requires specific configurations and dependencies that may not be set up +# in all environments. Instead, users who need AWS Lambda support can opt-in +# by manually adding it to their environment. +# See https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2787 +packages_to_exclude = ["opentelemetry-instrumentation-aws-lambda"] def main(): @@ -61,7 +66,7 @@ def main(): default_instrumentations = ast.List(elts=[]) libraries = ast.List(elts=[]) for pkg in get_instrumentation_packages(): - if pkg.get("name") in packages_to_ignore: + if pkg.get("name") in packages_to_exclude: continue if not pkg["instruments"]: default_instrumentations.elts.append(ast.Str(pkg["requirement"]))