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

Install all transitive dependencies for Python instrumentation #1483

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions python/src/otel/otel_sdk/nodeps-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
opentelemetry-instrumentation-aiohttp-client==0.47b0
opentelemetry-util-http==0.47b0
asgiref~=3.8
opentelemetry-instrumentation-asgi==0.47b0
opentelemetry-instrumentation-asyncpg==0.47b0
opentelemetry-instrumentation-boto==0.47b0
opentelemetry-instrumentation-boto3sqs==0.47b0
opentelemetry-instrumentation-botocore==0.47b0
opentelemetry-instrumentation-celery==0.47b0
opentelemetry-instrumentation-dbapi==0.47b0
opentelemetry-instrumentation-django==0.47b0
opentelemetry-instrumentation-elasticsearch==0.47b0
opentelemetry-instrumentation-fastapi==0.47b0
opentelemetry-instrumentation-falcon==0.47b0
opentelemetry-instrumentation-flask==0.47b0
opentelemetry-instrumentation-grpc==0.47b0
opentelemetry-instrumentation-jinja2==0.47b0
opentelemetry-instrumentation-mysql==0.47b0
opentelemetry-instrumentation-psycopg2==0.47b0
opentelemetry-instrumentation-pymemcache==0.47b0
opentelemetry-instrumentation-pymongo==0.47b0
opentelemetry-instrumentation-pymysql==0.47b0
opentelemetry-instrumentation-pyramid==0.47b0
opentelemetry-instrumentation-redis==0.47b0
opentelemetry-instrumentation-requests==0.47b0
opentelemetry-instrumentation-sqlalchemy==0.47b0
opentelemetry-instrumentation-sqlite3==0.47b0
opentelemetry-instrumentation-starlette==0.47b0
opentelemetry-instrumentation-tornado==0.47b0
opentelemetry-instrumentation-wsgi==0.47b0
# TODO: move these dependencies to requirements.txt when they stopped relying on a pinned version of
# opentelemetry-propagator-aws-xray
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is already merged we can make a new Python release and this won't be necessary.

Copy link
Contributor Author

@rapphil rapphil Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this will work for v.0.48b0 (which is not released yet.). being merged does not mean that it is released.

opentelemetry-instrumentation-aws-lambda==0.47b0
opentelemetry-instrumentation-botocore==0.47b0
32 changes: 31 additions & 1 deletion python/src/otel/otel_sdk/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,35 @@ opentelemetry-sdk==1.26.0
opentelemetry-exporter-otlp-proto-http==1.26.0
opentelemetry-distro==0.47b0
opentelemetry-instrumentation==0.47b0
opentelemetry-semantic-conventions == 0.47b0
opentelemetry-semantic-conventions==0.47b0
opentelemetry-propagator-aws-xray==1.0.2

# Instrumentation dependencies
opentelemetry-instrumentation-aiohttp-client==0.47b0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much does moving all this to the lambda layer increase the layer size? Is that enough to be concerned about for adding to the cold start time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simulated locally to check what is the delta:

without installing all dependencies

python3 -m pip install -r otel_sdk/requirements.txt -t ./deps && \
  python3 -m pip install -r otel_sdk/nodeps-requirements.txt -t ./deps --no-deps
du -h --max-depth 0 deps
25M     deps

installing all transitive dependencies

python3 -m pip install -r otel_sdk/requirements.txt -t ./deps && \
  python3 -m pip install -r otel_sdk/nodeps-requirements.txt -t ./deps --no-deps
du -h --max-depth 0 deps
27M     deps

The impact on the cold startup will be negligible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the last version was 7.4 MB. We can see where things end up with the next release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data presented before regarding size was just for the dependencies and it was not zipped. Here is the resulting layer for reference:

8.3M Aug 22 15:51 build/opentelemetry-python-layer.zip

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So an added 1mb.... that's not insignificant. 🤷

opentelemetry-util-http==0.47b0
opentelemetry-instrumentation-asgi==0.47b0
opentelemetry-instrumentation-asyncpg==0.47b0
opentelemetry-instrumentation-boto==0.47b0
opentelemetry-instrumentation-boto3sqs==0.47b0
opentelemetry-instrumentation-celery==0.47b0
opentelemetry-instrumentation-dbapi==0.47b0
opentelemetry-instrumentation-django==0.47b0
opentelemetry-instrumentation-elasticsearch==0.47b0
opentelemetry-instrumentation-fastapi==0.47b0
opentelemetry-instrumentation-falcon==0.47b0
opentelemetry-instrumentation-flask==0.47b0
opentelemetry-instrumentation-grpc==0.47b0
opentelemetry-instrumentation-jinja2==0.47b0
opentelemetry-instrumentation-mysql==0.47b0
opentelemetry-instrumentation-psycopg2==0.47b0
opentelemetry-instrumentation-pymemcache==0.47b0
opentelemetry-instrumentation-pymongo==0.47b0
opentelemetry-instrumentation-pymysql==0.47b0
opentelemetry-instrumentation-pyramid==0.47b0
opentelemetry-instrumentation-redis==0.47b0
opentelemetry-instrumentation-requests==0.47b0
opentelemetry-instrumentation-sqlalchemy==0.47b0
opentelemetry-instrumentation-sqlite3==0.47b0
opentelemetry-instrumentation-starlette==0.47b0
opentelemetry-instrumentation-tornado==0.47b0
opentelemetry-instrumentation-wsgi==0.47b0
Loading