Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for Django with auto instrumentation #1803

Merged
merged 3 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

### Added
- Added example for running Django with auto instrumentation
([#1803](https://github.com/open-telemetry/opentelemetry-python/pull/1803))

### Removed
- Moved `opentelemetry-instrumentation` to contrib repository
([#1797](https://github.com/open-telemetry/opentelemetry-python/pull/1797))
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/django/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ to ``DjangoInstrumento().instrument()`` in ``main``, then Run the django app
with ``opentelemetry-instrumentation python manage.py runserver --noreload``.
Repeat the steps with the client, the result should be the same.

Usage with Auto Instrumentation and uWSGI
-----------------------------------------

uWSGI and Django can be used together with auto instrumentation. To do so,
first install uWSGI in the previous virtual environment:

```
pip install uwsgi
```
Once that is done, run the server with ``uwsgi`` from the directory that
contains ``instrumentation_example``:

```
opentelemetry-instrument uwsgi --http :8000 --module instrumentation_example.wsgi
```

This should start one uWSGI worker in your console. Open up a browser and point
it to ``localhost:8000``. This request should display a span exported in the
server console.

References
----------

Expand Down