![Gitter](https://badges.gitter.im/Join Chat.svg)
This is a simple admin interface for Spring Boot applications.
This application provides a simple GUI to administrate Spring Boot applications in some ways. At the moment it provides the following features for every registered application.
- Show name/id and version number
- Show health status
- Download main logfile
- Show details, like
- JVM & memory metrics
- Counter & gauge Metrics
- Datasource Metrics
- View Java, system- & environment-properties
- Support for Spring Clouds postable /env- &/refresh-endpoint
- Easy loggerlevel management (for Logback)
- Interact with JMX-beans
- View threaddump
- View traces
- Mail and desktop notification on status change
- Event journal of status changes (non persistent)
Add the following dependency to your pom.xml.
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.2.4</version>
</dependency>
Create the Spring Boot Admin server with only one single annotation.
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
See also the example project in this repository.
For configuring hazelcast support see spring-boot-admin-server or hazelcast-example project
To get all your boot applications shown in spring boot admin you have two choices:
- either you include the spring-boot-admin-starter-client into your applications
or
- you add a DiscoveryClient (e.g. Eureka) to your spring boot admin server.
Note: If you don't include the spring-boot-admin-starter-client the logfile won't be available with spring boot 1.2.x, due to the fact that the logfile endpoint won't be exposed.
Each application that want to register itself to the admin application has to include the spring-boot-admin-starter-client as dependency. This starter JAR includes some AutoConfiguration features that includes registering tasks, controller, etc.
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.2.4</version>
</dependency>
Inside your configuration (e.g. application.properties) you also have to define the URL of the Spring Boot Admin server, e.g.
spring.boot.admin.url=http://localhost:8080
For all configuration options see spring-boot-admin-starter-client
Just add spring-clouds @EnableDiscoveryClient
annotation and include an appropriate implementation (e.g. Eureka) to your classpath.
@Configuration
@EnableAutoConfiguration
@EnableDiscoveryClient
@EnableAdminServer
public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
}
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<version>1.0.3.RELEASE</version>
</dependency>
See the sample discovery sample project
Configure a JavaMailSender using spring-boot-starter-mail and set a recipient:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
spring.mail.host=smtp.example.com
[email protected]
For all configuration options see spring-boot-admin-server
You can access snapshot builds from the sonatype repository:
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
In order to build spring-boot-admin you need to have node.js and npm on your PATH.
mvn clean package
mvn build-helper:parse-version versions:set -DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
mvn -Psign-artifacts clean deploy
Example:
mvn build-helper:parse-version versions:set versions:commit -DnewVersion=1.0.0-SNAPSHOT