Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs section for instrumentation submodule naming convention #12893

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/contributing/writing-instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding related content in Folder Structure part directly? It might look more concentrated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, i've made the instrumentation submodules section an H3 so it's a subsection of Folder Structure

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`
Expand Down
Loading