Skip to content

Commit

Permalink
Change opentelemetry-ext-utils to opentelemetry-instrumentation-utils…
Browse files Browse the repository at this point in the history
… and optimize tox
  • Loading branch information
cnnradams committed Jun 4, 2020
1 parent 672a2bc commit 94783ea
Show file tree
Hide file tree
Showing 27 changed files with 53 additions and 56 deletions.
2 changes: 1 addition & 1 deletion eachdist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sortfirst=
opentelemetry-api
opentelemetry-sdk
opentelemetry-auto-instrumentation
ext/opentelemetry-ext-utils
ext/opentelemetry-instrumentation-utils
ext/opentelemetry-ext-wsgi
ext/opentelemetry-ext-dbapi
ext/*
Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-aiohttp-client/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ package_dir=
packages=find_namespace:
install_requires =
opentelemetry-api >= 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
aiohttp ~= 3.0

[options.packages.find]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def strip_query_params(url: yarl.URL) -> str:
from opentelemetry import context as context_api
from opentelemetry import propagators, trace
from opentelemetry.ext.aiohttp_client.version import __version__
from opentelemetry.ext.utils import http_status_to_canonical_code
from opentelemetry.instrumentation.utils import http_status_to_canonical_code
from opentelemetry.trace import SpanKind
from opentelemetry.trace.status import Status, StatusCanonicalCode

Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-dbapi/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package_dir=
packages=find_namespace:
install_requires =
opentelemetry-api == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
wrapt >= 1.0.0, < 2.0.0

[options.extras_require]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import wrapt

from opentelemetry.ext.dbapi.version import __version__
from opentelemetry.ext.utils import unwrap
from opentelemetry.instrumentation.utils import unwrap
from opentelemetry.trace import SpanKind, Tracer, TracerProvider, get_tracer
from opentelemetry.trace.status import Status, StatusCanonicalCode

Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-jinja2/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ packages=find_namespace:
install_requires =
opentelemetry-api == 0.9.dev0
opentelemetry-auto-instrumentation == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
jinja2~=2.7
wrapt >= 1.0.0, < 2.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

from opentelemetry.auto_instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.ext.jinja2.version import __version__
from opentelemetry.ext.utils import unwrap
from opentelemetry.instrumentation.utils import unwrap
from opentelemetry.trace import SpanKind, get_tracer
from opentelemetry.trace.status import Status, StatusCanonicalCode

Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-redis/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package_dir=
packages=find_namespace:
install_requires =
opentelemetry-api == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
opentelemetry-auto-instrumentation == 0.9.dev0
redis >= 2.6
wrapt >= 1.12.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
_format_command_args,
)
from opentelemetry.ext.redis.version import __version__
from opentelemetry.ext.utils import unwrap
from opentelemetry.instrumentation.utils import unwrap

_DEFAULT_SERVICE = "redis"
_RAWCMD = "db.statement"
Expand Down
4 changes: 2 additions & 2 deletions ext/opentelemetry-ext-requests/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ packages=find_namespace:
install_requires =
opentelemetry-api == 0.9.dev0
opentelemetry-auto-instrumentation == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
requests ~= 2.0

[options.extras_require]
test =
opentelemetry-test == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
httpretty ~= 1.0

[options.packages.find]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from opentelemetry import context, propagators, trace
from opentelemetry.auto_instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.ext.requests.version import __version__
from opentelemetry.ext.utils import http_status_to_canonical_code
from opentelemetry.instrumentation.utils import http_status_to_canonical_code
from opentelemetry.trace import SpanKind, get_tracer
from opentelemetry.trace.status import Status

Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-sqlalchemy/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages=find_namespace:
install_requires =
opentelemetry-api == 0.9.dev0
opentelemetry-auto-instrumentation == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0
wrapt >= 1.11.2
sqlalchemy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
_get_tracer,
_wrap_create_engine,
)
from opentelemetry.ext.utils import unwrap
from opentelemetry.instrumentation.utils import unwrap


class SQLAlchemyInstrumentor(BaseInstrumentor):
Expand Down
20 changes: 0 additions & 20 deletions ext/opentelemetry-ext-utils/README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-wsgi/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package_dir=
packages=find_namespace:
install_requires =
opentelemetry-api == 0.9.dev0
opentelemetry-ext-utils == 0.9.dev0
opentelemetry-instrumentation-utils == 0.9.dev0

[options.extras_require]
test =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def hello():
import wsgiref.util as wsgiref_util

from opentelemetry import context, propagators, trace
from opentelemetry.ext.utils import http_status_to_canonical_code
from opentelemetry.instrumentation.utils import http_status_to_canonical_code
from opentelemetry.ext.wsgi.version import __version__
from opentelemetry.trace.propagation import get_span_from_context
from opentelemetry.trace.status import Status, StatusCanonicalCode
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions ext/opentelemetry-instrumentation-utils/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
OpenTelemetry Utility Package
=============================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-utils.svg
:target: https://pypi.org/project/opentelemetry-instrumentation-utils/

Installation
------------

::

pip install opentelemetry-instrumentation-utils


References
----------
* `OpenTelemetry Project <https://opentelemetry.io/>`_

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# limitations under the License.
#
[metadata]
name = opentelemetry-ext-utils
name = opentelemetry-instrumentation-utils
description = OpenTelemetry Utility package
long_description = file: README.rst
long_description_content_type = text/x-rst
author = OpenTelemetry Authors
author_email = [email protected]
url = https://github.com/open-telemetry/opentelemetry-python/tree/master/ext/opentelemetry-ext-utils
url = https://github.com/open-telemetry/opentelemetry-python/tree/master/ext/opentelemetry-instrumentation-utils
platforms = any
license = Apache-2.0
classifiers =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "ext", "utils", "version.py"
BASE_DIR, "src", "opentelemetry", "instrumentation", "utils", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from http import HTTPStatus

from opentelemetry.ext.utils import http_status_to_canonical_code
from opentelemetry.instrumentation.utils import http_status_to_canonical_code
from opentelemetry.test.test_base import TestBase
from opentelemetry.trace.status import StatusCanonicalCode

Expand Down
29 changes: 13 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ envlist =
py3{4,5,6,7,8}-test-ext-sqlite3
pypy3-test-ext-sqlite3

; opentelemetry-ext-utils
; opentelemetry-instrumentation-utils
py3{5,6,7,8}-test-ext-utils
pypy3-test-ext-utils

Expand Down Expand Up @@ -168,7 +168,7 @@ changedir =
test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests
test-ext-asgi: ext/opentelemetry-ext-asgi/tests
test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests
test-ext-utils: ext/opentelemetry-ext-utils/tests
test-ext-utils: ext/opentelemetry-instrumentation-utils/tests
test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests
test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests
test-ext-boto: ext/opentelemetry-ext-boto/tests
Expand All @@ -186,16 +186,17 @@ commands_pre =
; Install common packages for all the tests. These are not needed in all the
; cases but it saves a lot of boilerplate in this file.
test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util
; Install common utils package for all ext/ tests
ext: pip install {toxinidir}/ext/opentelemetry-instrumentation-utils

test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation

example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-utils {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app
example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-instrumentation-utils {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app

getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-ext-utils -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask
getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-instrumentation-utils -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask

grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test]

wsgi,flask,django,asgi: pip install {toxinidir}/ext/opentelemetry-ext-utils
wsgi,flask,django,asgi: pip install {toxinidir}/tests/util
wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi

Expand All @@ -207,8 +208,6 @@ commands_pre =

flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test]

dbapi,mysql,psycopg2,pymysql,sqlite3: pip install {toxinidir}/ext/opentelemetry-ext-utils

dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test]

django: pip install {toxinidir}/ext/opentelemetry-ext-django[test]
Expand All @@ -227,13 +226,13 @@ commands_pre =

sqlite3: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test]

redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-utils {toxinidir}/ext/opentelemetry-ext-redis[test]
redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-redis[test]

requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-utils {toxinidir}/ext/opentelemetry-ext-requests[test]
requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests[test]

jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-utils {toxinidir}/ext/opentelemetry-ext-jinja2[test]
jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-jinja2[test]

aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-utils {toxinidir}/ext/opentelemetry-ext-aiohttp-client
aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client

jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger

Expand All @@ -244,9 +243,7 @@ commands_pre =

zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin

sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-utils {toxinidir}/ext/opentelemetry-ext-sqlalchemy

utils: pip install {toxinidir}/ext/opentelemetry-ext-utils
sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy

system-metrics: pip install {toxinidir}/opentelemetry-auto-instrumentation
system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test]
Expand Down Expand Up @@ -317,7 +314,7 @@ commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-auto-instrumentation \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/ext/opentelemetry-ext-utils \
-e {toxinidir}/ext/opentelemetry-instrumentation-utils \
-e {toxinidir}/ext/opentelemetry-ext-requests \
-e {toxinidir}/ext/opentelemetry-ext-wsgi \
-e {toxinidir}/ext/opentelemetry-ext-flask
Expand All @@ -343,7 +340,7 @@ commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-auto-instrumentation \
-e {toxinidir}/ext/opentelemetry-ext-utils \
-e {toxinidir}/ext/opentelemetry-instrumentation-utils \
-e {toxinidir}/tests/util \
-e {toxinidir}/ext/opentelemetry-ext-dbapi \
-e {toxinidir}/ext/opentelemetry-ext-mysql \
Expand Down

0 comments on commit 94783ea

Please sign in to comment.