Skip to content

Commit f7472b7

Browse files
authored
Add docs section for instrumentation submodule naming convention (#12893)
1 parent d80f5bf commit f7472b7

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/contributing/writing-instrumentation.md

+41
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,47 @@ include("instrumentation:yarpc-1.0:library")
6868
include("instrumentation:yarpc-1.0:testing")
6969
```
7070

71+
### Instrumentation Submodules
72+
73+
When writing instrumentation that requires submodules for different versions, the name of each
74+
submodule must be prefixed with the name of the parent directory (typically the library or
75+
framework name).
76+
77+
As an example, if `yarpc` has instrumentation for two different versions, each version submodule
78+
must include the `yarpc` prefix before the version:
79+
80+
```
81+
instrumentation ->
82+
...
83+
yarpc ->
84+
yarpc-1.0 ->
85+
javaagent
86+
build.gradle.kts
87+
library
88+
build.gradle.kts
89+
testing
90+
build.gradle.kts
91+
yarpc-2.0 ->
92+
javaagent
93+
build.gradle.kts
94+
library
95+
build.gradle.kts
96+
testing
97+
build.gradle.kts
98+
```
99+
100+
After creating the submodules, they must be registered in the settings.gradle.kts file. Include each
101+
submodule explicitly to ensure it is recognized and built as part of the project. For example:
102+
103+
```kotlin
104+
include(":instrumentation:yarpc:yarpc-1.0:javaagent")
105+
include(":instrumentation:yarpc:yarpc-1.0:library")
106+
include(":instrumentation:yarpc:yarpc-1.0:testing")
107+
include(":instrumentation:yarpc:yarpc-2.0:javaagent")
108+
include(":instrumentation:yarpc:yarpc-2.0:library")
109+
include(":instrumentation:yarpc:yarpc-2.0:testing")
110+
```
111+
71112
## Writing library instrumentation
72113

73114
Start by creating the `build.gradle.kts` file in the `library`

0 commit comments

Comments
 (0)