opentelemetry-python
opentelemetry-python copied to clipboard
Feature/env propagator
Description
Extended opentelemetry-python to develop a propagator that helps in inter-process propagation of trace/baggage details in a particular format (b3/w3c/any other) using environment dictionary as the carrier.
Using environment dictionary as the carrier will help to connect batch processes. For example: The environment dictionary containing trace/baggage details can be passed to the next process in the subprocess call, thereby propagating the trace/baggage details across processes.
The propagator has dependency on opentelemetry-api.
Relates to opentelemetry-specification issue #740
Type of change
Please delete options that are not relevant.
- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update
How Has This Been Tested?
All the functions in the propagator have been tested using unittest library.
Following steps can be followed to run the tests:
-
cd opentelemetry-python/propagator/opentelemetry-propagator-env
- Run the command to install the propagator in editable mode:
pip install -e .[test]
For z-shell, use the command:pip install -e ".[test]"
- Run the tests:
python3 -m unittest
Then you can uninstall the project by using the command:pip uninstall opentelemetry-propagator-env
you could also run individual test files by using the command format:python3 -m unittest tests.<test_file_name>.<test_file_class>
Does This PR Require a Contrib Repo Change?
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
-
The OTel specification has changed which prompted this PR to update the method interfaces of
opentelemetry-api/
oropentelemetry-sdk/
-
The method interfaces of
opentelemetry-instrumentation/
have changed -
The method interfaces of
test/util
have changed -
Scripts in
scripts/
that were copied over to the Contrib repo have changed -
Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in
-
pyproject.toml
-
isort.cfg
-
.flake8
-
-
When a new
.github/CODEOWNER
is added -
Major changes to project information, such as in:
-
README.md
-
CONTRIBUTING.md
-
-
[ ] Yes. - Link to PR:
-
[x] No.
Checklist:
- [x] Followed the style guidelines of this project
- [ ] Changelogs have been updated
- [x] Unit tests have been added
- [ ] Documentation has been updated