-
Notifications
You must be signed in to change notification settings - Fork 621
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
chore(examples): update python examples #3769
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the file as it duplicates the README in the /python
. This file includes more recent updates: in fact, I replaced /python/README.md
with /python/rideshare/README.md
(same for _zh
version – however, I don't know if it is up to date)
# Dockerizing Django with Pyroscope, Postgres, Gunicorn, and Nginx | ||
This is a simple rideshare example that adds Pyroscope to a Django application and uses it to profile various routes | ||
# Django Example | ||
|
||
### Development | ||
Uses the default Django development server. | ||
To run the example run the following commands: | ||
``` | ||
# Pull latest pyroscope and grafana images: | ||
docker pull grafana/pyroscope:latest | ||
docker pull grafana/grafana:latest | ||
|
||
1. Rename *.env.dev-sample* to *.env.dev*. | ||
1. Update the environment variables in the *docker-compose.yml* and *.env.dev* files. | ||
1. Build the images and run the containers: | ||
# Run the example project: | ||
docker-compose up --build | ||
|
||
```sh | ||
$ docker-compose up -d --build | ||
``` | ||
# Reset the database (if needed): | ||
# docker-compose down | ||
``` | ||
|
||
Test it out at [http://localhost:8000](http://localhost:8000). The "app" folder is mounted into the container and your code changes apply automatically. | ||
Navigate to [Grafana](http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer?explorationType=flame-graph&var-serviceName=django-ride-sharing-app&var-profileMetricId=process_cpu:cpu:nanoseconds:cpu:nanoseconds) to Explore Profiles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I unified it with the Flask and FastAPI versions
|
||
Navigate to [Grafana](http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer?explorationType=flame-graph&var-serviceName=flask-ride-sharing-app&var-profileMetricId=process_cpu:cpu:nanoseconds:cpu:nanoseconds) to Explore Profiles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to add a link to the local Explore Profiles page with the service flame graph, as it might not be immediately apparent to new users what to do or where to find the profiling data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a pity that the README is quite outdated in terms of user experience. I'm hesitant to update it to the Explore Profiles version.
@Rperry2174, please let me know if you think it's time to make the update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
examples/language-sdk-instrumentation/python/rideshare/django/README.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Christian Simon <simon@swine.de>
…README.md Co-authored-by: Christian Simon <simon@swine.de>
The PR does not bring any significant changes: I fixed a couple of links, added new ones, and cleaned up a bit. All the examples (simple, flask, django, fastapi) use the latest version and can be run locally.