Skip to content

Commit

Permalink
Gunicorn example (#55)
Browse files Browse the repository at this point in the history
* adding gunicorn example

* Update README

* Update README

* Fix links

---------

Co-authored-by: karthikeyangs9 <[email protected]>
  • Loading branch information
prathamesh-sonpatki and karthikeyangs9 authored Feb 4, 2025
1 parent ce75f74 commit 5ade876
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/django/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export OTEL_AWS_PYTHON_DEFER_TO_WORKERS_ENABLED=true

### With uWSGI

1. Add to your `uwsgi.ini`:
1. Add the [last9_uwsgi.py](./mysite/last9_uwsgi.py) to your `uwsgi.ini`:

This file is responsible for initializing the OpenTelemetry instrumentation after the worker is spawned by uwsgi.

```ini
import = last9_uwsgi.py
env = DJANGO_SETTINGS_MODULE=mysite.settings # This is the name of your settings file
Expand All @@ -58,6 +61,9 @@ Set the environment variable for the settings file:
export DJANGO_SETTINGS_MODULE=mysite.settings
```

Use the [last9_gunicorn.py](./mysite/last9_gunicorn.py) as configuration file for gunicorn.
This file is responsible for initializing the OpenTelemetry instrumentation after the worker is spawned by gunicorn.

Start the server:
```bash
opentelemetry-instrument gunicorn mysite.wsgi:application -c last9_gunicorn.py
Expand Down

0 comments on commit 5ade876

Please sign in to comment.