From 5c0c8fd8e28ff79d83da628fcde596fcd2c776b3 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Sat, 14 Dec 2024 10:21:09 -0500 Subject: [PATCH 1/2] Add docs section for instrumentation submodule naming convention --- docs/contributing/writing-instrumentation.md | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/contributing/writing-instrumentation.md b/docs/contributing/writing-instrumentation.md index f921a57015b7..791fb430f676 100644 --- a/docs/contributing/writing-instrumentation.md +++ b/docs/contributing/writing-instrumentation.md @@ -68,6 +68,47 @@ include("instrumentation:yarpc-1.0:library") include("instrumentation:yarpc-1.0:testing") ``` +## Instrumentation Submodules + +When writing instrumentation that requires submodules for different versions, the name of each +submodule must be prefixed with the name of the parent directory (typically the library or +framework name). + +As an example, if `yarpc` has instrumentation for two different versions, each version submodule +must include the `yarpc` prefix before the version: + +``` +instrumentation -> + ... + yarpc -> + yarpc-1.0 -> + javaagent + build.gradle.kts + library + build.gradle.kts + testing + build.gradle.kts + yarpc-2.0 -> + javaagent + build.gradle.kts + library + build.gradle.kts + testing + build.gradle.kts +``` + +After creating the submodules, they must be registered in the settings.gradle.kts file. Include each +submodule explicitly to ensure it is recognized and built as part of the project. For example: + +```kotlin +include(":instrumentation:yarpc:yarpc-1.0:javaagent") +include(":instrumentation:yarpc:yarpc-1.0:library") +include(":instrumentation:yarpc:yarpc-1.0:testing") +include(":instrumentation:yarpc:yarpc-2.0:javaagent") +include(":instrumentation:yarpc:yarpc-2.0:library") +include(":instrumentation:yarpc:yarpc-2.0:testing") +``` + ## Writing library instrumentation Start by creating the `build.gradle.kts` file in the `library` From b86162b0e91b3d0cd4bec43197ee70be65da4edb Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Mon, 16 Dec 2024 06:51:02 -0500 Subject: [PATCH 2/2] make instrumentation submodules a subsection of the folder structure section --- docs/contributing/writing-instrumentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/writing-instrumentation.md b/docs/contributing/writing-instrumentation.md index 791fb430f676..08f1230895ec 100644 --- a/docs/contributing/writing-instrumentation.md +++ b/docs/contributing/writing-instrumentation.md @@ -68,7 +68,7 @@ include("instrumentation:yarpc-1.0:library") include("instrumentation:yarpc-1.0:testing") ``` -## Instrumentation Submodules +### Instrumentation Submodules When writing instrumentation that requires submodules for different versions, the name of each submodule must be prefixed with the name of the parent directory (typically the library or