Skip to content

Commit 28d0cdf

Browse files
authored
Rename web framework packages from "ext" to "instrumentation" (open-telemetry#961)
1 parent 242d5a7 commit 28d0cdf

File tree

146 files changed

+352
-301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+352
-301
lines changed

docs-requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ asyncpg>=0.12.0
88
ddtrace>=0.34.0
99
aiohttp~= 3.0
1010
aiopg>=0.13.0
11+
grpcio~=1.27
1112
Deprecated>=1.2.6
1213
django>=2.2
1314
PyMySQL~=0.9.3
@@ -29,5 +30,3 @@ boto~=2.0
2930
botocore~=1.0
3031
starlette~=0.13
3132
fastapi~=0.58.1
32-
opentelemetry-exporter-cloud-trace==0.10b0
33-
opentelemetry-exporter-cloud-monitoring==0.10b0

docs/conf.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@
4343
for f in listdir(ext)
4444
if isdir(join(ext, f))
4545
]
46-
sys.path[:0] = source_dirs + exp_dirs + ext_dirs
46+
47+
instr = "../instrumentation"
48+
instr_dirs = [
49+
os.path.abspath("/".join(["../instrumentation", f, "src"]))
50+
for f in listdir(instr)
51+
if isdir(join(instr, f))
52+
]
53+
54+
sys.path[:0] = source_dirs + exp_dirs + ext_dirs + instr_dirs
4755

4856
# -- Project information -----------------------------------------------------
4957

docs/examples/auto-instrumentation/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Installation
7373
7474
$ pip install opentelemetry-sdk
7575
$ pip install opentelemetry-instrumentation
76-
$ pip install opentelemetry-ext-flask
76+
$ pip install opentelemetry-instrumentation-flask
7777
$ pip install requests
7878
7979
Execution

docs/examples/auto-instrumentation/server_instrumented.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from flask import Flask, request
1616

1717
from opentelemetry import propagators, trace
18-
from opentelemetry.ext.wsgi import collect_request_attributes
18+
from opentelemetry.instrumentation.wsgi import collect_request_attributes
1919
from opentelemetry.sdk.trace import TracerProvider
2020
from opentelemetry.sdk.trace.export import (
2121
ConsoleSpanExporter,

docs/examples/datadog_exporter/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Distributed Example
5050
pip install opentelemetry-sdk
5151
pip install opentelemetry-exporter-datadog
5252
pip install opentelemetry-instrumentation
53-
pip install opentelemetry-ext-flask
53+
pip install opentelemetry-instrumentation-flask
5454
pip install flask
5555
pip install requests
5656

docs/examples/django/README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OpenTelemetry Django Instrumentation Example
22
============================================
33

4-
This shows how to use ``opentelemetry-ext-django`` to automatically instrument a
4+
This shows how to use ``opentelemetry-instrumentation-django`` to automatically instrument a
55
Django app.
66

77
For more user convenience, a Django app is already provided in this directory.
@@ -24,7 +24,7 @@ Installation
2424
.. code-block::
2525
2626
$ pip install opentelemetry-sdk
27-
$ pip install opentelemetry-ext-django
27+
$ pip install opentelemetry-instrumentation-django
2828
$ pip install requests
2929
3030
@@ -40,7 +40,7 @@ Set these environment variables first:
4040
#. ``export DJANGO_SETTINGS_MODULE=instrumentation_example.settings``
4141

4242
The way to achieve OpenTelemetry instrumentation for your Django app is to use
43-
an ``opentelemetry.ext.django.DjangoInstrumentor`` to instrument the app.
43+
an ``opentelemetry.instrumentation.django.DjangoInstrumentor`` to instrument the app.
4444

4545
Clone the ``opentelemetry-python`` repository and go to ``opentelemetry-python/docs/examples/django``.
4646

@@ -105,4 +105,4 @@ References
105105

106106
* `Django <https://djangoproject.com/>`_
107107
* `OpenTelemetry Project <https://opentelemetry.io/>`_
108-
* `OpenTelemetry Django extension <https://github.com/open-telemetry/opentelemetry-python/tree/master/ext/opentelemetry-ext-django>`_
108+
* `OpenTelemetry Django extension <https://github.com/open-telemetry/opentelemetry-python/tree/master/instrumentation/opentelemetry-instrumentation-django>`_

docs/examples/django/manage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import os
1818
import sys
1919

20-
from opentelemetry.ext.django import DjangoInstrumentor
20+
from opentelemetry.instrumentation.django import DjangoInstrumentor
2121

2222

2323
def main():

docs/examples/opentelemetry-example-app/setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ install_requires =
4545
typing; python_version<'3.5'
4646
opentelemetry-api == 0.12.dev0
4747
opentelemetry-sdk == 0.12.dev0
48-
opentelemetry-ext-requests == 0.12.dev0
49-
opentelemetry-ext-flask == 0.12.dev0
48+
opentelemetry-instrumentation-requests == 0.12.dev0
49+
opentelemetry-instrumentation-flask == 0.12.dev0
5050
flask
5151
requests
5252
protobuf~=3.11

docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/flask_example.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import flask
2020
import requests
2121

22-
import opentelemetry.ext.requests
22+
import opentelemetry.instrumentation.requests
2323
from opentelemetry import trace
24-
from opentelemetry.ext.flask import FlaskInstrumentor
24+
from opentelemetry.instrumentation.flask import FlaskInstrumentor
2525
from opentelemetry.sdk.trace import TracerProvider
2626
from opentelemetry.sdk.trace.export import (
2727
ConsoleSpanExporter,
@@ -33,7 +33,7 @@
3333
# It must be done before instrumenting any library
3434
trace.set_tracer_provider(TracerProvider())
3535

36-
opentelemetry.ext.requests.RequestsInstrumentor().instrument()
36+
opentelemetry.instrumentation.requests.RequestsInstrumentor().instrument()
3737

3838
trace.get_tracer_provider().add_span_processor(
3939
SimpleExportSpanProcessor(ConsoleSpanExporter())

docs/ext/aiohttp_client/aiohttp_client.rst

-7
This file was deleted.

docs/ext/asgi/asgi.rst

-10
This file was deleted.

docs/ext/flask/flask.rst

-7
This file was deleted.

docs/ext/grpc/grpc.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
OpenTelemetry gRPC Integration
2-
==============================
1+
OpenTelemetry gRPC Instrumentation
2+
==================================
33

44
Module contents
55
---------------

docs/ext/pyramid/pyramid.rst

-7
This file was deleted.

docs/ext/wsgi/wsgi.rst

-7
This file was deleted.

docs/getting-started.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ We will now instrument a basic Flask application that uses the requests library
156156

157157
.. code-block:: sh
158158
159-
pip install opentelemetry-ext-flask
160-
pip install opentelemetry-ext-requests
159+
pip install opentelemetry-instrumentation-flask
160+
pip install opentelemetry-instrumentation-requests
161161
162162
163163
And let's write a small Flask application that sends an HTTP request, activating each instrumentation during the initialization:

docs/getting_started/flask_example.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import requests
1818

1919
from opentelemetry import trace
20-
from opentelemetry.ext.flask import FlaskInstrumentor
21-
from opentelemetry.ext.requests import RequestsInstrumentor
20+
from opentelemetry.instrumentation.flask import FlaskInstrumentor
21+
from opentelemetry.instrumentation.requests import RequestsInstrumentor
2222
from opentelemetry.sdk.trace import TracerProvider
2323
from opentelemetry.sdk.trace.export import (
2424
ConsoleSpanExporter,

docs/index.rst

+8
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>
8484
:name: Instrumentations
8585
:glob:
8686

87+
instrumentation/**
88+
89+
.. toctree::
90+
:maxdepth: 2
91+
:caption: OpenTelemetry Integrations
92+
:name: integrations
93+
:glob:
94+
8795
ext/**
8896

8997
.. toctree::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
OpenTelemetry aiohttp client Instrumentation
2+
============================================
3+
4+
.. automodule:: opentelemetry.instrumentation.aiohttp_client
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/ext/aiopg/aiopg.rst renamed to docs/instrumentation/aiopg/aiopg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OpenTelemetry aiopg instrumentation
1+
OpenTelemetry aiopg Instrumentation
22
===================================
33

44
.. automodule:: opentelemetry.instrumentation.aiopg

docs/instrumentation/asgi/asgi.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
OpenTelemetry asgi Instrumentation
2+
===================================
3+
4+
Module contents
5+
---------------
6+
7+
.. automodule:: opentelemetry.instrumentation.asgi
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OpenTelemetry Django Instrumentation
22
====================================
33

4-
.. automodule:: opentelemetry.ext.django
4+
.. automodule:: opentelemetry.instrumentation.django
55
:members:
66
:undoc-members:
77
:show-inheritance:

docs/ext/fastapi/fastapi.rst renamed to docs/instrumentation/fastapi/fastapi.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: ../../../ext/opentelemetry-instrumentation-fastapi/README.rst
1+
.. include:: ../../../instrumentation/opentelemetry-instrumentation-fastapi/README.rst
22

33
API
44
---

docs/instrumentation/flask/flask.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
OpenTelemetry Flask Instrumentation
2+
===================================
3+
4+
.. automodule:: opentelemetry.instrumentation.flask
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/instrumentation/instrumentation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
OpenTelemetry Python Instrumentation
2-
====================================
1+
OpenTelemetry Python Instrumentor
2+
=================================
33

44
.. automodule:: opentelemetry.instrumentation
55
:members:
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
OpenTelemetry Pyramid Instrumentation
2+
=====================================
3+
4+
.. automodule:: opentelemetry.instrumentation.pyramid
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
OpenTelemetry requests Instrumentation
2+
======================================
3+
4+
.. automodule:: opentelemetry.instrumentation.requests
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/ext/starlette/starlette.rst renamed to docs/instrumentation/starlette/starlette.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: ../../../ext/opentelemetry-instrumentation-starlette/README.rst
1+
.. include:: ../../../instrumentation/opentelemetry-instrumentation-starlette/README.rst
22

33
API
44
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
OpenTelemetry requests Integration
1+
OpenTelemetry WSGI Instrumentation
22
==================================
33

4-
.. automodule:: opentelemetry.ext.requests
4+
.. automodule:: opentelemetry.instrumentation.wsgi
55
:members:
66
:undoc-members:
77
:show-inheritance:

eachdist.ini

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ sortfirst=
77
opentelemetry-instrumentation
88
opentelemetry-proto
99
tests/util
10-
exporter/*
11-
ext/opentelemetry-ext-wsgi
10+
instrumentation/opentelemetry-instrumentation-wsgi
1211
ext/opentelemetry-ext-dbapi
13-
ext/opentelemetry-ext-asgi
12+
instrumentation/opentelemetry-instrumentation-asgi
1413
ext/opentelemetry-ext-botocore
14+
instrumentation/*
15+
exporter/*
1516
ext/*
1617

1718
[lintroots]

exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232

3333
DEFAULT_AGENT_URL = "http://localhost:8126"
3434
_INSTRUMENTATION_SPAN_TYPES = {
35-
"opentelemetry.ext.aiohttp-client": DatadogSpanTypes.HTTP,
36-
"opentelemetry.ext.asgi": DatadogSpanTypes.WEB,
35+
"opentelemetry.instrumentation.aiohttp-client": DatadogSpanTypes.HTTP,
36+
"opentelemetry.instrumentation.asgi": DatadogSpanTypes.WEB,
3737
"opentelemetry.ext.dbapi": DatadogSpanTypes.SQL,
38-
"opentelemetry.ext.django": DatadogSpanTypes.WEB,
39-
"opentelemetry.ext.flask": DatadogSpanTypes.WEB,
38+
"opentelemetry.instrumentation.django": DatadogSpanTypes.WEB,
39+
"opentelemetry.instrumentation.flask": DatadogSpanTypes.WEB,
4040
"opentelemetry.ext.grpc": DatadogSpanTypes.GRPC,
4141
"opentelemetry.ext.jinja2": DatadogSpanTypes.TEMPLATE,
4242
"opentelemetry.ext.mysql": DatadogSpanTypes.SQL,
@@ -45,9 +45,9 @@
4545
"opentelemetry.ext.pymongo": DatadogSpanTypes.MONGODB,
4646
"opentelemetry.ext.pymysql": DatadogSpanTypes.SQL,
4747
"opentelemetry.ext.redis": DatadogSpanTypes.REDIS,
48-
"opentelemetry.ext.requests": DatadogSpanTypes.HTTP,
48+
"opentelemetry.instrumentation.requests": DatadogSpanTypes.HTTP,
4949
"opentelemetry.ext.sqlalchemy": DatadogSpanTypes.SQL,
50-
"opentelemetry.ext.wsgi": DatadogSpanTypes.WEB,
50+
"opentelemetry.instrumentation.wsgi": DatadogSpanTypes.WEB,
5151
}
5252

5353

exporter/opentelemetry-exporter-datadog/tests/test_datadog_exporter.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,20 @@ def test_resources(self):
290290

291291
def test_span_types(self):
292292
test_instrumentations = [
293-
"opentelemetry.ext.aiohttp-client",
293+
"opentelemetry.instrumentation.aiohttp-client",
294294
"opentelemetry.ext.dbapi",
295-
"opentelemetry.ext.django",
296-
"opentelemetry.ext.flask",
295+
"opentelemetry.instrumentation.django",
296+
"opentelemetry.instrumentation.flask",
297297
"opentelemetry.ext.grpc",
298298
"opentelemetry.ext.jinja2",
299299
"opentelemetry.ext.mysql",
300300
"opentelemetry.ext.psycopg2",
301301
"opentelemetry.ext.pymongo",
302302
"opentelemetry.ext.pymysql",
303303
"opentelemetry.ext.redis",
304-
"opentelemetry.ext.requests",
304+
"opentelemetry.instrumentation.requests",
305305
"opentelemetry.ext.sqlalchemy",
306-
"opentelemetry.ext.wsgi",
306+
"opentelemetry.instrumentation.wsgi",
307307
]
308308

309309
for index, instrumentation in enumerate(test_instrumentations):

ext/opentelemetry-ext-aiohttp-client/CHANGELOG.md

-9
This file was deleted.

ext/opentelemetry-ext-grpc/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
[metadata]
1616
name = opentelemetry-ext-grpc
17-
description = OpenTelemetry gRPC Integration
17+
description = OpenTelemetry gRPC instrumentation
1818
long_description = file: README.rst
1919
long_description_content_type = text/x-rst
2020
author = OpenTelemetry Authors

0 commit comments

Comments
 (0)