Skip to content

Commit 9cf2683

Browse files
xrmxemdneto
andauthored
CONTRIBUTING: notes abount adding doc for new instrumentation (#3064)
* CONTRIBUTING: notes abount adding doc for new instrumentation While at it revise the versioning paragraph to take into account the openai instrumentation. * Reword doc paragraph * Update CONTRIBUTING.md Co-authored-by: Emídio Neto <[email protected]> * Add autodoc template * Add notes about tox --------- Co-authored-by: Emídio Neto <[email protected]>
1 parent 7617031 commit 9cf2683

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ Below is a checklist of things to be mindful of when implementing a new instrume
272272
- Isolate sync and async test
273273
- For synchronous tests, the typical test case class is inherited from `opentelemetry.test.test_base.TestBase`. However, if you want to write asynchronous tests, the test case class should inherit also from `IsolatedAsyncioTestCase`. Adding asynchronous tests to a common test class can lead to tests passing without actually running, which can be misleading.
274274
- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/60fb936b7e5371b3e5587074906c49fb873cbd76/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py#L84>
275-
- All instrumentations have the same version. If you are going to develop a new instrumentation it would probably have `X.Y.dev` version and depends on `opentelemetry-instrumentation` and `opentelemetry-semantic-conventions` for the same version. That means that if you want to install your instrumentation you need to install its dependencies from this repo and the core repo also from git.
275+
- Most of the instrumentations have the same version. If you are going to develop a new instrumentation it would probably have `X.Y.dev` version and depends on `opentelemetry-instrumentation` and `opentelemetry-semantic-conventions` for a [compatible version](https://peps.python.org/pep-0440/#compatible-release). That means that you may need to install the instrumentation dependencies from this repo and the core repo from git.
276+
- Documentation
277+
- When adding a new instrumentation remember to add an entry in `docs/instrumentation/` named `<instrumentation>/<instrumentation>.rst` to have the instrumentation documentation referenced from the index. You can use the entry template available [here](./_template/autodoc_entry.rst)
278+
- Testing
279+
- When adding a new instrumentation remember to update `tox.ini` adding appropriate rules in `envlist`, `command_pre` and `commands` sections
276280

277281
## Guideline for GenAI instrumentations
278282

_template/autodoc_entry.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. include:: ../../../instrumentation/opentelemetry-instrumentation-<REPLACE ME>/README.rst
2+
:end-before: References
3+
4+
.. automodule:: opentelemetry.instrumentation.<REPLACE ME>
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)