Skip to content

Commit de8a474

Browse files
authored
Add example for Django with auto instrumentation (#1803)
1 parent d598ab4 commit de8a474

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.1.0...HEAD)
88

9+
### Added
10+
- Added example for running Django with auto instrumentation
11+
([#1803](https://github.com/open-telemetry/opentelemetry-python/pull/1803))
12+
913
### Removed
1014
- Moved `opentelemetry-instrumentation` to contrib repository
1115
([#1797](https://github.com/open-telemetry/opentelemetry-python/pull/1797))

docs/examples/django/README.rst

+20
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@ to ``DjangoInstrumento().instrument()`` in ``main``, then Run the django app
117117
with ``opentelemetry-instrumentation python manage.py runserver --noreload``.
118118
Repeat the steps with the client, the result should be the same.
119119

120+
Usage with Auto Instrumentation and uWSGI
121+
-----------------------------------------
122+
123+
uWSGI and Django can be used together with auto instrumentation. To do so,
124+
first install uWSGI in the previous virtual environment:
125+
126+
```
127+
pip install uwsgi
128+
```
129+
Once that is done, run the server with ``uwsgi`` from the directory that
130+
contains ``instrumentation_example``:
131+
132+
```
133+
opentelemetry-instrument uwsgi --http :8000 --module instrumentation_example.wsgi
134+
```
135+
136+
This should start one uWSGI worker in your console. Open up a browser and point
137+
it to ``localhost:8000``. This request should display a span exported in the
138+
server console.
139+
120140
References
121141
----------
122142

0 commit comments

Comments
 (0)