The auto-instrumentation for Python (per OTEP 0001) instruments each library in a separately installable package to ensure users only need to install the libraries that make sense for their use-case. This repository contains the code initially donate by DataDog in the reference
folder. All instrumentation that has been ported lives in the instrumentors
directory.
The steps below describe the process to port integrations from the reference directory containing the originally donated code to OpenTelemetry.
- Move the code into the instrumentors directory
git mv reference/ddtrace/contribs/jinja2 instrumentors/
- Move the tests
git mv reference/tests/contrib/jinja2 instrumentors/jinja2/tests
- Make the package installable
- Move source code to package path
mkdir -p instrumentors/jinja2/src/opentelemetry/ext/jinja2
git mv instrumentors/jinja2/*.py instrumentors/jinja2/src/opentelemetry/ext/jinja2
- Add
README.rst
,setup.cfg
andsetup.py
files and update them accordingly
cp _template/* instrumentors/jinja2/
- Add
version.py
file and update it accordingly
mv instrumentors/jinja2/version.py instrumentors/jinja2/src/opentelemetry/ext/jinja2/version.py
- Fix relative import paths to using ddtrace package instead of using relative paths
- Update the code and tests to use the OpenTelemetry API