The info endpoint

The /actuator/info endpoint, by default, is empty. We will need to add the following settings to application.properties so that we can see the basic information:

info.app.name=@name@
info.app.description=@description@
[email protected]@
[email protected]@
[email protected]@

We can use @..@ placeholders to refer to our Maven properties because we use spring-boot-starter-parent. Beside this basic information, we can add build information into this endpoint by adding the build-info goal to the spring-boot-maven-plugin:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
...
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
...
</executions>
</plugin>

We can add the following git-commit-id-plugin to add the Git commit information to the endpoint:

<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
<plugin>
...
</plugins>
</build>

With these plugins, we can use the /actuator/info endpoint to verify whether the application has the current build and commit to detect situations such as having an old incompatible version of the application running.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.178.237