Skip to content

Commit

Permalink
update build-info.properties docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Feb 12, 2024
1 parent 40056cf commit 06c22b6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
26 changes: 20 additions & 6 deletions instrumentation/spring/spring-boot-autoconfigure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,27 @@ The service name is determined by the following precedence, in accordance with t
5. `build-info.properties`
6. the default value `unknown_service:java` (lowest precedence)

Use the following snippet in your gradle file to generate the `build-info.properties` file:
Use the following snippet in your pom.xml file to generate the `build-info.properties` file
(the gradle plugin generates this file by default):

```groovy
springBoot {
buildInfo {
}
}
```xml
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```

##### Exporter Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,27 @@
* Detects <code>service.name</code> and <code>service.version</code> from Spring Boot's <code>
* build-info.properties</code> file.
*
* <p>Use the following snippet in your gradle file to generate the build-info.properties file:
* <p>Use the following snippet in your pom.xml file to generate the build-info.properties file (the
* gradle plugin generates this file by default):
*
* <pre>{@code
* springBoot {
* buildInfo {
* }
* }
* <build>
* <finalName>${project.artifactId}</finalName>
* <plugins>
* <plugin>
* <groupId>org.springframework.boot</groupId>
* <artifactId>spring-boot-maven-plugin</artifactId>
* <executions>
* <execution>
* <goals>
* <goal>build-info</goal>
* <goal>repackage</goal>
* </goals>
* </execution>
* </executions>
* </plugin>
* </plugins>
* </build>
* }</pre>
*/
@AutoService(ResourceProvider.class)
Expand Down
5 changes: 0 additions & 5 deletions smoke-tests/images/spring-boot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}

springBoot {
buildInfo {
}
}

jib {
from.image = "openjdk:$targetJDK"
to.image = "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk$targetJDK-$tag"
Expand Down

0 comments on commit 06c22b6

Please sign in to comment.