Skip to content

Commit 3d6b9f2

Browse files
committed
update docs
1 parent 7255a03 commit 3d6b9f2

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,14 @@ Below is a checklist of things to be mindful of when implementing a new instrume
325325
### Update supported instrumentation package versions
326326

327327
- Navigate to the **instrumentation package directory:**
328-
- Update **`pyproject.toml`** file by modifying _instruments_ entry in the `[project.optional-dependencies]` section with the new version constraint
329-
- Update `_instruments` variable in instrumentation **`package.py`** file with the new version constraint
328+
- Update **`pyproject.toml`** file by modifying _instruments_ or _instruments_either_ entry in the `[project.optional-dependencies]` section with the new version constraint
329+
- Update `_instruments` or `_instruments-either` variable in instrumentation **`package.py`** file with the new version constraint
330330
- At the **root of the project directory**, run `tox -e generate` to regenerate necessary files
331331

332+
Please note that _instruments_either_ is an optional field that can be used instead of or in addition to _instruments_. While _instruments_ is a list of dependencies, _all_ of which are expected by the instrumentation, _instruments_either_ is a list _any_ of which but not all are expected.
333+
334+
<!-- See https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3610 for details on instruments_either -->
335+
332336
If you're adding support for a new version of the instrumentation package, follow these additional steps:
333337

334338
- At the **instrumentation package directory:** Add new test-requirements.txt file with the respective package version required for testing

scripts/generate_instrumentation_bootstrap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def main():
9393
values=[ast.Str(target_pkg), ast.Str(pkg["requirement"])],
9494
)
9595
)
96+
# _instruments_either is an optional field that can be used instead of or in addition to _instruments. While _instruments is a list of dependencies, all of which are expected by the instrumentation, _instruments_either is a list any of which but not all are expected.
9697
for target_pkg in pkg["instruments_either"]:
9798
libraries.elts.append(
9899
ast.Dict(

scripts/generate_instrumentation_readme.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def main(base_instrumentation_path):
5959
exec(fh.read(), pkg_info)
6060

6161
instruments_and = pkg_info.get("_instruments", ())
62+
# _instruments_either is an optional field that can be used instead of or in addition to _instruments. While _instruments is a list of dependencies, all of which are expected by the instrumentation, _instruments_either is a list any of which but not all are expected.
6263
instruments_either = pkg_info.get("_instruments_either", ())
6364
supports_metrics = pkg_info.get("_supports_metrics")
6465
semconv_status = pkg_info.get("_semconv_status")

scripts/otel_packaging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def get_instrumentation_packages(
6464
"optional-dependencies"
6565
]
6666
instruments = optional_dependencies.get("instruments", [])
67+
# _instruments_either is an optional field that can be used instead of or in addition to _instruments. While _instruments is a list of dependencies, all of which are expected by the instrumentation, _instruments_either is a list any of which but not all are expected.
6768
instruments_either = optional_dependencies.get(
6869
"instruments_either", []
6970
)

0 commit comments

Comments
 (0)