opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
Improve asyncpg instrumentation example
Description
There's one instrumentation example inside asyncpg that doesn't run. This PR fixes the example, so it runs.
Type of change
Please delete options that are not relevant.
- [X] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- Clone contrib repo:
git clone https://github.com/open-telemetry/opentelemetry-python-contrib - Clone OTel Python repo:
git clone https://github.com/open-telemetry/opentelemetry-python - Access the contrib repo:
cd opentelemetry-python-contrib - Create a virtual env:
python3 -m venv otelvenv - Activate the virtual env:
source otelvenv/bin/activate - Install common dependencies:
pip install opentelemetry-distro/ opentelemetry-instrumentation/ \
../opentelemetry-python/opentelemetry-semantic-conventions/ \
../opentelemetry-python/opentelemetry-api/ \
../opentelemetry-python/opentelemetry-sdk/ \
../opentelemetry-python/opentelemetry-proto/ \
../opentelemetry-python/exporter/opentelemetry-exporter-otlp-proto-common
- Install
asyncpgspecific requirements:
pip install -r instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
- Copy the instrumentation examples inside the instrumentation main
__init__.pyfile into different Python files and try to run them.
Does This PR Require a Core Repo Change?
- [ ] Yes. - Link to PR:
- [X] No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
- [X] Followed the style guidelines of this project
- [ ] Changelogs have been updated
- [ ] Unit tests have been added
- [ ] Documentation has been updated