Skip to content

Commit 35a3dc6

Browse files
authored
Document naming convention for common modules (#13506)
1 parent 3c14532 commit 35a3dc6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/contributing/writing-instrumentation.md

+20
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,26 @@ All classes from the newly added bootstrap module will be loaded by the bootstra
402402
globally available within the JVM. **IMPORTANT: Note that you _cannot_ use any third-party libraries
403403
here, including the instrumented library - you can only use JDK and OpenTelemetry API classes.**
404404

405+
### Common Modules
406+
407+
When creating a common module shared among different instrumentations, the naming convention should
408+
include a version suffix that matches the major/minor version of the instrumented library specified
409+
in the common module's `build.gradle.kts`.
410+
411+
For example, if the common module's Gradle file contains the following dependency:
412+
413+
```kotlin
414+
dependencies {
415+
compileOnly("org.yarpc.client:rest:5.0.0")
416+
}
417+
```
418+
419+
Then the module should be named using the suffix `yarp-common-5.0`.
420+
421+
If the common module does not have a direct dependency on the instrumented library, no version
422+
suffix is required. Examples of such cases include modules named `lettuce-common` and
423+
`netty-common`.
424+
405425
## Writing Java agent unit tests
406426

407427
As mentioned before, tests in the `javaagent` module cannot access the javaagent instrumentation

0 commit comments

Comments
 (0)