Skip to content

Commit 3c71ead

Browse files
docs: add contributing guidelines for new instrumentations (#2259)
* docs: add contributing guidelines for new instrumentations * Update CONTRIBUTING.md Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com> --------- Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
1 parent 9e4726c commit 3c71ead

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

.github/ISSUE_TEMPLATE/plugin_request.md renamed to .github/ISSUE_TEMPLATE/instrumentation_request.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ labels: instrumentation-request
55
---
66

77
<!--
8-
**NB:** Before opening an instrumentation request against this repo, consider whether the instrumentation should/could be implemented in the [other OpenTelemetry client libraries](https://github.com/open-telemetry/). If so, please [open an issue on opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/issues/new) first.
9-
10-
You are welcome to try to build your own instrumentation. If you do, please let us know if you have any questions/feedback.
8+
**NB:** Before opening an instrumentation request against this repo, please read [the contributing guidelines for new instrumentation](../../CONTRIBUTING.md#new-instrumentation).
119
-->
1210

1311
### Is your instrumentation request related to a problem? Please describe
@@ -27,6 +25,15 @@ Weekly Downloads:
2725

2826
Versions:
2927

28+
### Code Owners
29+
30+
<!--
31+
New Instrumentation requests need at least 2 code-owners that will maintain the instrumentation long-term.
32+
-->
33+
34+
- Owner 1
35+
- Owner 2
36+
3037
### Additional context
3138
<!--
3239
Add any other context or screenshots about the instrumentation request here. Is there a reference you could point for the well-defined lifecycle methods?

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ We'd love your help!
2626
- [Contributing Vendor Components](#contributing-vendor-components)
2727
- [Adding a New Vendor Component](#adding-a-new-vendor-component)
2828
- [Removing Vendor Components](#removing-vendor-components)
29+
- [New Instrumentation](#new-instrumentation)
2930

3031
## Development Quick Start
3132

@@ -232,6 +233,38 @@ please ping ([@open-telemetry/javascript-approvers](https://github.com/orgs/open
232233
- New or changed functionality is documented if appropriate
233234
- Substantial changes should not be merged within 24 hours of opening in order to allow reviewers from all time zones to have a chance to review
234235

236+
## New Instrumentation
237+
238+
**Do not submit pull requests for new instrumentation without reading the following.**
239+
240+
This project is dedicated to promoting the development of quality instrumentation using OpenTelemetry.
241+
To achieve this goal, we recognize that the instrumentation needs to be written using the best practices of OpenTelemetry, but also by developers that understand the package they are instrumenting.
242+
Additionally, the produced instrumentation needs to be maintained and evolved.
243+
244+
The size of the OpenTelemetry JavaScript developer community is not large enough to support an ever-growing amount of instrumentation.
245+
Therefore, to reach our goal, we have the following recommendations for where instrumentation packages should live.
246+
247+
1. Native to the instrumented package
248+
2. A dedicated public repository
249+
3. Here in the opentelemetry-js-contrib repository
250+
251+
If possible, OpenTelemetry instrumentation should be included in the instrumented package.
252+
This will ensure the instrumentation reaches all package users, and is continuously maintained by developers that understand the package.
253+
254+
If instrumentation cannot be directly included in the package it is instrumenting, it should be hosted in a dedicated public repository owned by its maintainer(s).
255+
This will appropriately assign maintenance responsibilities for the instrumentation and ensure these maintainers have the needed privilege to maintain the code.
256+
257+
The last place instrumentation should be hosted is here in this repository.
258+
Maintaining instrumentation here hampers the development of OpenTelemetry for JavaScript and therefore should be avoided.
259+
When instrumentation cannot be included in a target package and there is good reason to not host it in a separate and dedicated repository an [instrumentation request](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/new/choose) should be filed.
260+
Note that new instrumentation needs at least two contributors assigned to it as code-owners. It is the responsibility
261+
of the requesting party to reach out and find code-owners for the proposed instrumentation. The instrumentation request
262+
needs to be accepted before any pull requests for the instrumentation can be considered for merging.
263+
264+
Regardless of where instrumentation is hosted, it needs to be discoverable.
265+
The [OpenTelemetry registry](https://opentelemetry.io/registry/) exists to ensure that instrumentation is discoverable.
266+
You can find out how to add instrumentation to the registry [here](https://github.com/open-telemetry/opentelemetry.io#adding-a-project-to-the-opentelemetry-registry).
267+
235268
## Contributing Vendor Components
236269

237270
This repo is generally meant for hosting components that work with popular open-source frameworks and tools. However, it is also possible to contribute components specific to a 3rd party vendor in this repo.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This project includes:
4848
- [Resource Detectors](./detectors).
4949

5050
**Instrumentations**: OpenTelemetry can collect tracing data automatically using instrumentations. Vendors/Users can also create and use their own.
51+
Please read the [contributing guidelines on adding new instrumentation](CONTRIBUTING.md#new-instrumentation) before opening any PRs.
5152

5253
**Resource Detectors**: OpenTelemetry can collect resource attributes of the entity that producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace and possibly is part of a Deployment which also has a name. All three of these attributes can be included in the `Resource`.
5354

0 commit comments

Comments
 (0)