Odigos initializer of OpenTelemetry for Python
This package is utilized in the Odigos project to initialize OpenTelemetry components for automatic instrumentation of Python applications.
Note: This package is currently meant to be used in the odigos project with odigos OpAMP server. It cannot be used as a standalone package in arbitrary Python applications.
requirements:
uv - curl -LsSf https://astral.sh/uv/0.11.2/install.sh | sh
Local developement mimics the flow in which instrumentations reach their uses (e.g. odiglet): instrumentation wheel uploads to pypi -> odigos python instrumentation bundle releases version -> odiglet.
Instead of doing all that, use:
make build-release-docker
This releases a local version of the instrumentation and bundle, versioned as version local.
In order to build an odiglet image with this custom code the following change should be made (Different for OSS and enterprise)
Update the python agent dependency with a reference to a local image (with "local" version). For example:
Change
COPY --from=public.ecr.aws/odigos/agents/python-community:v1.0.66 /python-instrumentation/workspace /instrumentations/python
to
COPY --from=public.ecr.aws/odigos/agents/python-community:local /python-instrumentation/workspace /instrumentations/python
-
Ensure all changes are merged into the
mainbranch. -
Create a tag for the new version.
git tag <TAG>- Push the tag to the remote repository.
git push origin <TAG>- Let the GitHub workflow handle versioning and publishing to odigos-opentelemetry-python on PyPI.
- Copy the source code of the new instrumentation to overload into the
instrumentationsdir. - In the instrumentation's
pyproject.tomlfile, add theodigos-prefix to the name. - Update the
dependenciesinpyproject.tomlto use theodigos-*for the relevant instrumentation. - Push your changed and push a new tag :)