From 6e8980134e956eb45ec23bd332623ea08413278d Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Thu, 27 May 2021 04:12:37 +0530 Subject: [PATCH] Added `opentelemetry-instrumentation-all` metapackage --- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../setup.py | 2 +- .../README.rst | 112 ++++++++++++++++++ .../setup.cfg | 71 +++++++++++ .../setup.in.cfg | 40 +++++++ .../setup.py | 17 +++ .../instrumentation/bootstrap.py | 1 + .../generate_instrumentation_metapackage.py | 40 +++++++ 38 files changed, 313 insertions(+), 32 deletions(-) create mode 100644 metapackages/opentelemetry-instrumentation-all/README.rst create mode 100644 metapackages/opentelemetry-instrumentation-all/setup.cfg create mode 100644 metapackages/opentelemetry-instrumentation-all/setup.in.cfg create mode 100644 metapackages/opentelemetry-instrumentation-all/setup.py create mode 100755 scripts/generate_instrumentation_metapackage.py diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/setup.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/setup.py index 824db2983e..f8f9608d7c 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/setup.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/setup.py b/instrumentation/opentelemetry-instrumentation-aiopg/setup.py index 35b33958ef..d9167a767a 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/setup.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-asgi/setup.py b/instrumentation/opentelemetry-instrumentation-asgi/setup.py index f89c65f0a2..41f0be0460 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/setup.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/setup.py b/instrumentation/opentelemetry-instrumentation-asyncpg/setup.py index 785d822287..4efaf6c1db 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/setup.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-boto/setup.py b/instrumentation/opentelemetry-instrumentation-boto/setup.py index 0d99cc8926..fadd304a5a 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/setup.py +++ b/instrumentation/opentelemetry-instrumentation-boto/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-botocore/setup.py b/instrumentation/opentelemetry-instrumentation-botocore/setup.py index 5317443224..77097caf4f 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/setup.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-celery/setup.py b/instrumentation/opentelemetry-instrumentation-celery/setup.py index c4a01d212a..d1b39a290f 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/setup.py +++ b/instrumentation/opentelemetry-instrumentation-celery/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/setup.py b/instrumentation/opentelemetry-instrumentation-dbapi/setup.py index 2c1d28b951..0661f029ee 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/setup.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-django/setup.py b/instrumentation/opentelemetry-instrumentation-django/setup.py index 5a425c0e5a..6c29567154 100644 --- a/instrumentation/opentelemetry-instrumentation-django/setup.py +++ b/instrumentation/opentelemetry-instrumentation-django/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/setup.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/setup.py index 41914e50a8..dad9fe91df 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/setup.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-falcon/setup.py b/instrumentation/opentelemetry-instrumentation-falcon/setup.py index ca770e9260..71743e58eb 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/setup.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/setup.py b/instrumentation/opentelemetry-instrumentation-fastapi/setup.py index a56f7434a0..fb00c74451 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/setup.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-flask/setup.py b/instrumentation/opentelemetry-instrumentation-flask/setup.py index 251d905739..bc88e30167 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/setup.py +++ b/instrumentation/opentelemetry-instrumentation-flask/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-grpc/setup.py b/instrumentation/opentelemetry-instrumentation-grpc/setup.py index aaac587baa..9af0788ed3 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/setup.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/setup.py b/instrumentation/opentelemetry-instrumentation-jinja2/setup.py index f89c545429..1fe98ad245 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/setup.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-logging/setup.py b/instrumentation/opentelemetry-instrumentation-logging/setup.py index 38f3826d33..8cf426ca96 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/setup.py +++ b/instrumentation/opentelemetry-instrumentation-logging/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-mysql/setup.py b/instrumentation/opentelemetry-instrumentation-mysql/setup.py index ba396f9ffb..fa343d5a3a 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/setup.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/setup.py b/instrumentation/opentelemetry-instrumentation-psycopg2/setup.py index 077f70345b..f68d32dfbe 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/setup.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/setup.py b/instrumentation/opentelemetry-instrumentation-pymemcache/setup.py index 2964e4c7a6..13f4499eb5 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/setup.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/setup.py b/instrumentation/opentelemetry-instrumentation-pymongo/setup.py index 23ea29503b..e545457b00 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/setup.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/setup.py b/instrumentation/opentelemetry-instrumentation-pymysql/setup.py index 2da219349a..db998c97fd 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/setup.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/setup.py b/instrumentation/opentelemetry-instrumentation-pyramid/setup.py index 20790df8c1..38afc9697d 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/setup.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-redis/setup.py b/instrumentation/opentelemetry-instrumentation-redis/setup.py index bc90b25aa8..fe9fc10d06 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/setup.py +++ b/instrumentation/opentelemetry-instrumentation-redis/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-requests/setup.py b/instrumentation/opentelemetry-instrumentation-requests/setup.py index c8e36d3b1f..3c21a3328f 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/setup.py +++ b/instrumentation/opentelemetry-instrumentation-requests/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/setup.py b/instrumentation/opentelemetry-instrumentation-sklearn/setup.py index 8aec671b8d..ec550e2f65 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/setup.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/setup.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/setup.py index 90170b54a7..1d8e4d3961 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/setup.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/setup.py b/instrumentation/opentelemetry-instrumentation-sqlite3/setup.py index 1ea62e9c0a..ccbb6ba31a 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/setup.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-starlette/setup.py b/instrumentation/opentelemetry-instrumentation-starlette/setup.py index f7c28941c1..8bc87ae6e5 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/setup.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-tornado/setup.py b/instrumentation/opentelemetry-instrumentation-tornado/setup.py index 018b4773b3..d6d7415ede 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/setup.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-urllib/setup.py b/instrumentation/opentelemetry-instrumentation-urllib/setup.py index bebd64a09f..eacc21733f 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/setup.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/setup.py b/instrumentation/opentelemetry-instrumentation-urllib3/setup.py index 99c2c04396..f301d4fad0 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/setup.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/setup.py b/instrumentation/opentelemetry-instrumentation-wsgi/setup.py index 2ee7cfbfcf..73e9f65430 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/setup.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/setup.py @@ -17,9 +17,9 @@ # RUN `python scripts/generate_setup.py` TO REGENERATE. -import os import distutils.cmd import json +import os from configparser import ConfigParser import setuptools diff --git a/metapackages/opentelemetry-instrumentation-all/README.rst b/metapackages/opentelemetry-instrumentation-all/README.rst new file mode 100644 index 0000000000..6f74d2232f --- /dev/null +++ b/metapackages/opentelemetry-instrumentation-all/README.rst @@ -0,0 +1,112 @@ +OpenTelemetry Instrumentation +============================= + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation.svg + :target: https://pypi.org/project/opentelemetry-instrumentation/ + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation + + +This package provides a couple of commands that help automatically instruments a program: + + +opentelemetry-bootstrap +----------------------- + +:: + + opentelemetry-bootstrap --action=install|requirements + +This commands inspects the active Python site-packages and figures out which +instrumentation packages the user might want to install. By default it prints out +a list of the suggested instrumentation packages which can be added to a requirements.txt +file. It also supports installing the suggested packages when run with :code:`--action=install` +flag. + + +opentelemetry-instrument +------------------------ + +:: + + opentelemetry-instrument python program.py + +The instrument command will try to automatically detect packages used by your python program +and when possible, apply automatic tracing instrumentation on them. This means your program +will get automatic distributed tracing for free without having to make any code changes +at all. This will also configure a global tracer and tracing exporter without you having to +make any code changes. By default, the instrument command will use the OTLP exporter but +this can be overriden when needed. + +The command supports the following configuration options as CLI arguments and environment vars: + + +* ``--trace-exporter`` or ``OTEL_TRACE_EXPORTER`` + +Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter +names (see below). + + - Defaults to `otlp`. + - Can be set to `none` to disable automatic tracer initialization. + +You can pass multiple values to configure multiple exporters e.g, ``zipkin,prometheus`` + +Well known trace exporter names: + + - jaeger + - opencensus + - otlp + - otlp_proto_grpc_span + - zipkin + +``otlp`` is an alias for ``otlp_proto_grpc_span``. + +* ``--id-generator`` or ``OTEL_PYTHON_ID_GENERATOR`` + +Used to specify which IDs Generator to use for the global Tracer Provider. By default, it +will use the random IDs generator. + +The code in ``program.py`` needs to use one of the packages for which there is +an OpenTelemetry integration. For a list of the available integrations please +check `here `_ + +* ``OTEL_PYTHON_DISABLED_INSTRUMENTATIONS`` + +If set by the user, opentelemetry-instrument will read this environment variable to disable specific instrumentations. +e.g OTEL_PYTHON_DISABLED_INSTRUMENTATIONS = "requests,django" + + +Examples +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +:: + + opentelemetry-instrument --trace-exporter otlp flask run --port=3000 + +The above command will pass ``--trace-exporter otlp`` to the instrument command and ``--port=3000`` to ``flask run``. + +:: + + opentelemetry-instrument --trace-exporter zipkin,otlp celery -A tasks worker --loglevel=info + +The above command will configure global trace provider, attach zipkin and otlp exporters to it and then +start celery with the rest of the arguments. + +:: + + opentelemetry-instrument --ids-generator random flask run --port=3000 + +The above command will configure the global trace provider to use the Random IDs Generator, and then +pass ``--port=3000`` to ``flask run``. + +References +---------- + +* `OpenTelemetry Project `_ diff --git a/metapackages/opentelemetry-instrumentation-all/setup.cfg b/metapackages/opentelemetry-instrumentation-all/setup.cfg new file mode 100644 index 0000000000..9c1cb0c168 --- /dev/null +++ b/metapackages/opentelemetry-instrumentation-all/setup.cfg @@ -0,0 +1,71 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +[metadata] +name = opentelemetry-instrumentation-all +description = Meta package that installs all OpenTelemetry Python Contrib packages +long_description = file: README.rst +long_description_content_type = text/x-rst +author = OpenTelemetry Authors +author_email = cncf-opentelemetry-contributors@lists.cncf.io +url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation +platforms = any +license = Apache-2.0 +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Developers + License :: OSI Approved :: Apache Software License + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + +[options] +python_requires = >=3.6 +zip_safe = False +install_requires = + opentelemetry-instrumentation-pymemcache==0.22.dev0 + opentelemetry-instrumentation-flask==0.22.dev0 + opentelemetry-instrumentation-sklearn==0.22.dev0 + opentelemetry-instrumentation-tornado==0.22.dev0 + opentelemetry-instrumentation-psycopg2==0.22.dev0 + opentelemetry-instrumentation-redis==0.22.dev0 + opentelemetry-instrumentation-sqlite3==0.22.dev0 + opentelemetry-instrumentation-fastapi==0.22.dev0 + opentelemetry-instrumentation-starlette==0.22.dev0 + opentelemetry-instrumentation-celery==0.22.dev0 + opentelemetry-instrumentation-urllib3==0.22.dev0 + opentelemetry-instrumentation-falcon==0.22.dev0 + opentelemetry-instrumentation-django==0.22.dev0 + opentelemetry-instrumentation-botocore==0.22.dev0 + opentelemetry-instrumentation-requests==0.22.dev0 + opentelemetry-instrumentation-logging==0.22.dev0 + opentelemetry-instrumentation-pymysql==0.22.dev0 + opentelemetry-instrumentation-aiopg==0.22.dev0 + opentelemetry-instrumentation-wsgi==0.22.dev0 + opentelemetry-instrumentation-asyncpg==0.22.dev0 + opentelemetry-instrumentation-elasticsearch==0.22.dev0 + opentelemetry-instrumentation-mysql==0.22.dev0 + opentelemetry-instrumentation-sqlalchemy==0.22.dev0 + opentelemetry-instrumentation-aiohttp-client==0.22.dev0 + opentelemetry-instrumentation-jinja2==0.22.dev0 + opentelemetry-instrumentation-boto==0.22.dev0 + opentelemetry-instrumentation-urllib==0.22.dev0 + opentelemetry-instrumentation-pyramid==0.22.dev0 + opentelemetry-instrumentation-dbapi==0.22.dev0 + opentelemetry-instrumentation-asgi==0.22.dev0 + opentelemetry-instrumentation-pymongo==0.22.dev0 + opentelemetry-instrumentation-grpc==0.22.dev0 diff --git a/metapackages/opentelemetry-instrumentation-all/setup.in.cfg b/metapackages/opentelemetry-instrumentation-all/setup.in.cfg new file mode 100644 index 0000000000..3f925e9cf8 --- /dev/null +++ b/metapackages/opentelemetry-instrumentation-all/setup.in.cfg @@ -0,0 +1,40 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +[metadata] +name = opentelemetry-instrumentation-all +description = Meta package that installs all OpenTelemetry Python Contrib packages +long_description = file: README.rst +long_description_content_type = text/x-rst +author = OpenTelemetry Authors +author_email = cncf-opentelemetry-contributors@lists.cncf.io +url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation +platforms = any +license = Apache-2.0 +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Developers + License :: OSI Approved :: Apache Software License + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + +[options] +python_requires = >=3.6 +zip_safe = False +install_requires = + {requirements} diff --git a/metapackages/opentelemetry-instrumentation-all/setup.py b/metapackages/opentelemetry-instrumentation-all/setup.py new file mode 100644 index 0000000000..feb7faa0d2 --- /dev/null +++ b/metapackages/opentelemetry-instrumentation-all/setup.py @@ -0,0 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import setuptools + +setuptools.setup() diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py index 20d1cc4361..c1dfe4ec81 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py @@ -117,6 +117,7 @@ def _is_installed(req): return False return True + def _find_installed_libraries(): libs = default_instrumentations[:] libs.extend( diff --git a/scripts/generate_instrumentation_metapackage.py b/scripts/generate_instrumentation_metapackage.py new file mode 100755 index 0000000000..57f786c481 --- /dev/null +++ b/scripts/generate_instrumentation_metapackage.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +from otel_packaging import get_instrumentation_packages, root_path + +metapackage_path = os.path.join( + root_path, "metapackages", "opentelemetry-instrumentation-all" +) + + +def main(): + requirements = "\n\t".join( + [pkg["requirement"] for pkg in get_instrumentation_packages()] + ) + + with open(os.path.join(metapackage_path, "setup.in.cfg"), "r") as source: + template = source.read() + rendered = template.format(requirements=requirements) + with open(os.path.join(metapackage_path, "setup.cfg"), "w") as dest: + dest.write(rendered) + dest.flush() + + +if __name__ == "__main__": + main()