Skip to content

Commit 090b664

Browse files
requests: Rename http_requests to requests (#619)
The requests integration is named http-requests because at the time it was created there were some problems with pylint. other integrations are using opentelemetry.ext.integration without problems, tests are passing without issue, even renamed.
1 parent 1d84ee9 commit 090b664

File tree

22 files changed

+56
-57
lines changed

22 files changed

+56
-57
lines changed

docs/examples/http/README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HTTP Integration Example
33

44
This example shows how to use
55
:doc:`WSGI Middleware <../../ext/wsgi/wsgi>`
6-
and :doc:`requests <../../ext/http_requests/http_requests>` integrations to
6+
and :doc:`requests <../../ext/requests/requests>` integrations to
77
instrument an HTTP client and server in Python.
88

99
The source files required to run this example are available :scm_web:`here <docs/examples/http/>`.
@@ -16,7 +16,7 @@ Installation
1616
pip install opentelemetry-api
1717
pip install opentelemetry-sdk
1818
pip install opentelemetry-ext-wsgi
19-
pip install opentelemetry-ext-http-requests
19+
pip install opentelemetry-ext-requests
2020
pip install flask
2121
2222
@@ -60,6 +60,6 @@ Useful links
6060
- OpenTelemetry_
6161
- :doc:`../../api/trace`
6262
- :doc:`../../ext/wsgi/wsgi`
63-
- :doc:`../../ext/http_requests/http_requests`
63+
- :doc:`../../ext/requests/requests`
6464

6565
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/

docs/examples/http/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import requests
2020

2121
from opentelemetry import trace
22-
from opentelemetry.ext import http_requests
22+
from opentelemetry.ext.requests import RequestsInstrumentor
2323
from opentelemetry.sdk.trace import TracerProvider
2424
from opentelemetry.sdk.trace.export import (
2525
BatchExportSpanProcessor,
@@ -32,7 +32,7 @@
3232
trace.set_tracer_provider(TracerProvider())
3333

3434
# Enable instrumentation in the requests library.
35-
http_requests.RequestsInstrumentor().instrument()
35+
RequestsInstrumentor().instrument()
3636

3737
# Configure a console span exporter.
3838
exporter = ConsoleSpanExporter()

docs/examples/http/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import requests
2121

2222
from opentelemetry import trace
23-
from opentelemetry.ext import http_requests
23+
from opentelemetry.ext.requests import RequestsInstrumentor
2424
from opentelemetry.ext.wsgi import OpenTelemetryMiddleware
2525
from opentelemetry.sdk.trace import TracerProvider
2626
from opentelemetry.sdk.trace.export import (
@@ -36,7 +36,7 @@
3636
# Integrations are the glue that binds the OpenTelemetry API and the
3737
# frameworks and libraries that are used together, automatically creating
3838
# Spans and propagating context as appropriate.
39-
http_requests.RequestsInstrumentor().instrument()
39+
RequestsInstrumentor().instrument()
4040
app = flask.Flask(__name__)
4141
app.wsgi_app = OpenTelemetryMiddleware(app.wsgi_app)
4242

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"typing; python_version<'3.5'",
3838
"opentelemetry-api",
3939
"opentelemetry-sdk",
40-
"opentelemetry-ext-http-requests",
40+
"opentelemetry-ext-requests",
4141
"opentelemetry-ext-flask",
4242
"flask",
4343
"requests",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import flask
2020
import requests
2121

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

36-
opentelemetry.ext.http_requests.RequestsInstrumentor().instrument()
36+
opentelemetry.ext.requests.RequestsInstrumentor().instrument()
3737
FlaskInstrumentor().instrument()
3838

3939
trace.get_tracer_provider().add_span_processor(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OpenTelemetry requests Integration
22
==================================
33

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

docs/getting-started.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ We will now instrument a basic Flask application that uses the requests library
176176
.. code-block:: sh
177177
178178
pip install opentelemetry-ext-flask
179-
pip install opentelemetry-ext-http-requests
179+
pip install opentelemetry-ext-requests
180180
181181
182182
And let's write a small Flask application that sends an HTTP request, activating each instrumentation during the initialization:
@@ -190,7 +190,7 @@ And let's write a small Flask application that sends an HTTP request, activating
190190
import flask
191191
import requests
192192
193-
import opentelemetry.ext.http_requests
193+
import opentelemetry.ext.requests
194194
from opentelemetry import trace
195195
from opentelemetry.sdk.trace import TracerProvider
196196
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
@@ -202,7 +202,7 @@ And let's write a small Flask application that sends an HTTP request, activating
202202
)
203203
204204
app = flask.Flask(__name__)
205-
opentelemetry.ext.http_requests.RequestsInstrumentor().instrument()
205+
opentelemetry.ext.requests.RequestsInstrumentor().instrument()
206206
207207
@app.route("/")
208208
def hello():

ext/opentelemetry-ext-http-requests/CHANGELOG.md renamed to ext/opentelemetry-ext-requests/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Rename package to opentelemetry-ext-requests ([#619](https://github.com/open-telemetry/opentelemetry-python/pull/619))
56
- Implement instrumentor interface ([#597](https://github.com/open-telemetry/opentelemetry-python/pull/597))
67

78
## 0.3a0

0 commit comments

Comments
 (0)