Skip to content

Commit

Permalink
instrumentation properties files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Apr 7, 2022
1 parent 39db85f commit 260a4a1
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions docs/contributing/using-instrumenter-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,26 @@ all interfaces that can be used to customize an `Instrumenter`.

### Set the instrumentation version and OpenTelemetry schema URL

Always set the instrumentation library version on the `Instrumenter`. You can do this by calling
the `setInstrumentationVersion()` method on the `InstrumenterBuilder`. By setting the version, you
let users identify which version of your instrumentation produced the telemetry.
Make sure you always provide the instrumentation library version to the `Instrumenter`. You can do
this in two ways:

* By calling the `setInstrumentationVersion()` method on the `InstrumenterBuilder`.
* By making sure the JAR with your instrumentation library contains a properties file with the
version. The file should be located in the `META-INF/io/opentelemetry/instrumentation/` directory,
and it should be named `${instrumentationName}.properties`, where `${instrumentationName}` is the
name of the instrumentation library that is passed to the `Instrumenter#builder()` method. The
file should contain a single property `version`, e.g.:

```properties
# META-INF/io/opentelemetry/instrumentation/my-instrumentation.properties
version = 1.2.3
```

The `Instrumenter` will automatically detect these properties files and determine the
instrumentation version based on its name.

By setting the version, you let users identify which version of your instrumentation produced the
telemetry.

If the `Instrumenter` adheres to a specific OpenTelemetry schema, you can set the schema URL using
the `setSchemaUrl()` method on the `InstrumenterBuilder`. To learn more about the OpenTelemetry
Expand Down

0 comments on commit 260a4a1

Please sign in to comment.