Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda layer support for Python 3.9 #222

Closed
ericksoen opened this issue Feb 9, 2022 · 6 comments
Closed

Lambda layer support for Python 3.9 #222

ericksoen opened this issue Feb 9, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@ericksoen
Copy link

Is your feature request related to a problem? Please describe.
We have Lambda functions that we'd like to upgrade to use Python 3.9. When we test the upgrade path and use the Lambda layer that targets Python 3.8, the Lambda layer returns the following error:

ChannelCredentials, Compression
File "/opt/python/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/opt/python/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/opt/python/grpc/_cython/__init__.py)
Failed to auto initialize opentelemetry
Traceback (most recent call last):
File "/opt/python/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 116, in initialize
_load_configurators()
File "/opt/python/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 109, in _load_configurators
raise exc
File "/opt/python/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 105, in _load_configurators
entry_point.load()().configure(auto_instrumentation_version=__version__)  # type: ignore
File "/var/task/opentelemetry/sdk/_configuration/__init__.py", line 178, in configure
self._configure(**kwargs)
File "/var/task/opentelemetry/sdk/_configuration/__init__.py", line 194, in _configure
_initialize_components(kwargs.get("auto_instrumentation_version"))
File "/var/task/opentelemetry/sdk/_configuration/__init__.py", line 148, in _initialize_components
trace_exporters = _import_exporters(exporter_names)
File "/var/task/opentelemetry/sdk/_configuration/__init__.py", line 122, in _import_exporters
) in _import_tracer_provider_config_components(
File "/var/task/opentelemetry/sdk/_configuration/__init__.py", line 108, in _import_tracer_provider_config_components
component_impl = entry_point.load()
File "/var/task/pkg_resources/__init__.py", line 2465, in load
return self.resolve()
File "/var/task/pkg_resources/__init__.py", line 2471, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/opt/python/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py", line 20, in <module>
from grpc import ChannelCredentials, Compression
File "/opt/python/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/opt/python/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/opt/python/grpc/_cython/__init__.py)
[ERROR]	2022-02-09T14:57:20.701Z	9003dd25-68a1-4070-90ee-203e3b98a61b	TracerProvider was missing `force_flush` method. This is necessary in case of a Lambda freeze and would exist in the OTel SDK implementation.

Describe the solution you'd like
Add OTEL Lambda Layer support for Python 3.9

Describe alternatives you've considered
Pause migration to Python 3.9 for Lambda functions that implement OpenTelemetry layer.

@wangzlei
Copy link
Contributor

wangzlei commented Feb 15, 2022

aws-otel-python38 layers contain c extension files so it is not version compatible with python 3.9. We are actively supporting Lambda 3.9 runtime by providing a new group of layer aws-otel-python39.
Before it is done, a workaround is you can build aws-otel layer from scratch in your own account. Please refer the steps in github workflow.
To build layer for python 3.9, need to modify this line to be
ARG runtime=python3.9

@ericksoen
Copy link
Author

We'll probably wait for the officially supported Python 3.9 runtime for Lambda, but the extra info on building our own layer is an interesting technique to keep in the background.

@wangzlei
Copy link
Contributor

Reopen this issue for tracking python 3.9 support. @vasireddy99

@TriQuach
Copy link

TriQuach commented May 7, 2022

We're experiencing the same issue. Just wondering if the issue has been fixed or do we have a tentative date that it can be fixed?

@vasireddy99
Copy link
Contributor

vasireddy99 commented May 9, 2022

HI @TriQuach, the support for Python3.9 has been implemented and shall be available in next Lambda Layer release . I shall provide more info here, if there are any more updates.

updated comment

@vasireddy99
Copy link
Contributor

vasireddy99 commented May 25, 2022

Update : The Lambda layer for Python to support 3.9 is now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants