Update contributing doc for instrumentationModule (#7803)

As `helperResourceNames()` method is replaced by
`registerHelperResources(HelperResourceBuilder)` method, replacing it to
use `registerHelperResources(HelperResourceBuilder)` in
[writing-instrumentation-module.md](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/writing-instrumentation-module.md#inject-additional-resources-using-the-helperresourcenames-method)
This commit is contained in:
kaibocai 2023-02-11 14:43:06 -06:00 committed by GitHub
parent ee722f9a4a
commit bbb6482979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ public boolean isHelperClass(String className) {
For more information on package conventions, see the [muzzle docs](muzzle.md#compile-time-reference-collection).
### Inject additional resources using the `helperResourceNames()` method
### Inject additional resources using the `registerHelperResources(HelperResourceBuilder)` method
Some libraries may expose SPI interfaces that you can easily implement to provide
telemetry-gathering capabilities. The OpenTelemetry javaagent is able to inject `ServiceLoader`
@ -81,8 +81,8 @@ service provider files, but it needs to be told which ones:
```java
@Override
public List<String> helperResourceNames() {
return singletonList("META-INF/services/org.my.library.SpiClass");
public void registerHelperResources(HelperResourceBuilder helperResourceBuilder) {
helperResourceBuilder.register("META-INF/services/org.my.library.SpiClass");
}
```