### Install Pyctuator Package
Source: https://docs.spring-boot-admin.com/3.5.6/docs/third-party/pyctuator
Use pip to install the pyctuator package. This is the first step to enable integration.
```bash
pip install pyctuator
```
--------------------------------
### Set Instance Tags via Info Endpoint
Source: https://docs.spring-boot-admin.com/3.5.6/docs/client/client-features
Alternatively, tags can be added to instances by exposing them through the info endpoint. This example sets the 'environment' tag to 'test'.
```properties
#using the info endpoint
info.tags.environment=test
```
--------------------------------
### Set Instance Tags via Metadata
Source: https://docs.spring-boot-admin.com/3.5.6/docs/client/client-features
Add tags to instances for visual markers in the application list and instance view by configuring them in the application's metadata. This example sets the 'environment' tag to 'test'.
```properties
#using the metadata
spring.boot.admin.client.instance.metadata.tags.environment=test
```
--------------------------------
### Configure Hazelcast Instance for Spring Boot Admin
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/Clustering
Instantiate a Hazelcast Config bean to set up event and notification stores, and configure network for clustering. This example uses multicast for discovery.
```java
@Bean
public Config hazelcastConfig() {
// This map is used to store the events.
// It should be configured to reliably hold all the data,
// Spring Boot Admin will compact the events, if there are too many
MapConfig eventStoreMap = new MapConfig(DEFAULT_NAME_EVENT_STORE_MAP).setInMemoryFormat(InMemoryFormat.OBJECT)
.setBackupCount(1)
.setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
// This map is used to deduplicate the notifications.
// If data in this map gets lost it should not be a big issue as it will atmost
// lead to
// the same notification to be sent by multiple instances
MapConfig sentNotificationsMap = new MapConfig(DEFAULT_NAME_SENT_NOTIFICATIONS_MAP)
.setInMemoryFormat(InMemoryFormat.OBJECT)
.setBackupCount(1)
.setEvictionConfig(
new EvictionConfig().setEvictionPolicy(EvictionPolicy.LRU).setMaxSizePolicy(MaxSizePolicy.PER_NODE))
.setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
Config config = new Config();
config.addMapConfig(eventStoreMap);
config.addMapConfig(sentNotificationsMap);
config.setProperty("hazelcast.jmx", "true");
// network and join configuration (simple defaults good for local/dev)
NetworkConfig network = config.getNetworkConfig();
network.setPort(5701).setPortAutoIncrement(true);
JoinConfig join = network.getJoin();
join.getMulticastConfig().setEnabled(true);
return config;
}
```
--------------------------------
### List All Events
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/Events
Retrieves all instance events as a JSON array. This is useful for fetching the complete event history for all registered instances when the UI starts.
```APIDOC
## GET /instances/events
### Description
Returns all instance events as a JSON array.
### Method
GET
### Endpoint
/instances/events
### Parameters
#### Query Parameters
None
### Request Example
None
### Response
#### Success Response (200)
- **events** (array) - A JSON array containing all instance events.
#### Response Example
```json
[
{
"timestamp": 1678886400000,
"type": "InstanceRegisteredEvent",
"instance": {
"id": "instance-1",
"name": "MyApplication",
"healthUrl": "http://localhost:8080/actuator/health",
"managementUrl": "http://localhost:8080/actuator",
"serviceUrl": "http://localhost:8080",
"metadata": {}
}
}
]
```
```
--------------------------------
### Implement Custom HTTP Interceptor
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_interceptors
Implement `InstanceExchangeFilterFunction` to intercept and modify requests. This example logs DELETE and POST requests to actuator endpoints.
```java
@Bean
public InstanceExchangeFilterFunction auditLog() {
return (instance, request, next) -> next.exchange(request).doOnSubscribe((s) -> {
if (HttpMethod.DELETE.equals(request.method()) || HttpMethod.POST.equals(request.method())) {
log.info("{} for {} on {}", request.method(), instance.getId(), request.url());
}
});
}
```
--------------------------------
### Add Top-Level View with Vue.js in Spring Boot Admin
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
Create a custom top-level view using Vue.js by accessing application data via SBA.useApplicationStore. This example displays registered applications and their instances.
```vue
This application has the following instances:
```
--------------------------------
### Add spring-boot-starter-mail Dependency
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/notifications/notifier-mail
Include this dependency in your pom.xml to enable mail functionality.
```xml
org.springframework.boot
spring-boot-starter-mail
```
--------------------------------
### Add Spring Cloud Starter Dependency
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/server
Include the spring-cloud-starter dependency in your pom.xml to enable Spring Cloud features for service discovery.
```xml
org.springframework.cloud
spring-cloud-starter
```
--------------------------------
### Hide Specific UI Views
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Configure which views are displayed in the Spring Boot Admin UI navbar. This example hides the 'journal' view by setting its 'enabled' property to false.
```yaml
spring:
boot:
admin:
ui:
view-settings:
- name: "journal"
enabled: false
```
--------------------------------
### Configure Dropdown Link with Children and Iframe Option
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
Set up a dropdown menu item that also functions as a link, with additional child links. One child link can be configured to open in an iframe.
```yaml
spring:
boot:
admin:
ui:
external-views:
- label: Link w children
url: https://codecentric.de #(1)
children:
- label: "📖 Docs"
url: https://codecentric.github.io/spring-boot-admin/current/
- label: "📦 Maven"
url: https://search.maven.org/search?q=g:de.codecentric%20AND%20a:spring-boot-admin-starter-server
- label: "🐙 GitHub"
url: https://github.com/codecentric/spring-boot-admin
- label: "🎅 Is it christmas"
url: https://isitchristmas.com
iframe: true
```
--------------------------------
### Add Spring Boot Admin Server Dependency (Maven)
Source: https://docs.spring-boot-admin.com/3.5.6/docs/installation-and-setup
Include these dependencies in your pom.xml to set up the Spring Boot Admin Server. Requires spring-boot-starter-web.
```xml
de.codecentric
spring-boot-admin-starter-server
3.5.6
org.springframework.boot
spring-boot-starter-web
```
--------------------------------
### Configure Static Discovery Client Instances
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/server
Define static instances for the SimpleDiscoveryClient in application.yml. This allows the Spring Boot Admin server to discover applications without clients needing to include the admin client starter.
```yaml
spring:
cloud:
discovery:
client:
simple:
instances:
test:
- uri: http://instance1.intern:8080
metadata:
management.context-path: /actuator
- uri: http://instance2.intern:8080
metadata:
management.context-path: /actuator
```
--------------------------------
### Configure Mail Properties
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/notifications/notifier-mail
Set the mail host and recipient address in your application.properties file.
```properties
spring.mail.host=smtp.example.com
sspring.boot.admin.notify.mail.to=admin@example.com
```
--------------------------------
### Include Spring and Sonatype Snapshot Repositories in Maven
Source: https://docs.spring-boot-admin.com/3.5.6/docs/snapshots
Add these repositories to your pom.xml to resolve snapshot versions of Spring Boot Admin Server. Ensure the snapshot configurations are correctly set for each repository.
```xml
spring-milestone
false
http://repo.spring.io/milestone
spring-snapshot
true
http://repo.spring.io/snapshot
sonatype-nexus-snapshots
Sonatype Nexus Snapshots
https://oss.sonatype.org/content/repositories/snapshots/
true
false
```
--------------------------------
### Configure Client Actuator Credentials via Metadata
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/security
Configure the SBA client to provide username and password in metadata for accessing secured actuator endpoints. This is useful when the SBA server needs to authenticate with the client's actuator endpoints.
```yaml
spring.boot.admin.client:
url: http://localhost:8080
instance:
metadata:
user.name: ${spring.security.user.name}
user.password: ${spring.security.user.password}
```
--------------------------------
### Generate Build Info with Gradle
Source: https://docs.spring-boot-admin.com/3.5.6/docs/client/client-features
Configure your Gradle build to generate build information for Spring Boot applications by adding the buildInfo() method to the springBoot configuration.
```gradle
springBoot {
buildInfo()
}
```
--------------------------------
### Configure Eureka Client in application.yml
Source: https://docs.spring-boot-admin.com/3.5.6/docs/installation-and-setup
Configure the Eureka client in application.yml, specifying the application name, Eureka instance details, and client registry fetch interval. Ensure management endpoints are exposed and health details are shown.
```yaml
spring:
application:
name: spring-boot-admin-sample-eureka
profiles:
active:
- secure
eureka:
instance:
leaseRenewalIntervalInSeconds: 10
health-check-url-path: /actuator/health
metadata-map:
startup: ${random.int} # needed to trigger info and endpoint update after restart
client:
registryFetchIntervalSeconds: 5
serviceUrl:
defaultZone: http://localhost:8761/eureka/
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
```
--------------------------------
### Configure Eureka Instance Metadata for CloudFoundry
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/server
When deploying to CloudFoundry, ensure that `vcap.application.application_id` and `vcap.application.instance_index` are added to the Eureka instance metadata for correct registration with Spring Boot Admin Server. This configuration snippet shows how to set these metadata properties.
```yaml
eureka:
instance:
hostname: ${vcap.application.uris[0]}
nonSecurePort: 80
metadata-map:
applicationId: ${vcap.application.application_id}
instanceId: ${vcap.application.instance_index}
```
--------------------------------
### Configure Logfile Viewer
Source: https://docs.spring-boot-admin.com/3.5.6/docs/client/client-features
Enable the logfile actuator endpoint by configuring Spring Boot to write to a logfile using `logging.file.path` or `logging.file.name`. The file log pattern can be customized to include ANSI colors for better readability in the Spring Boot Admin UI.
```properties
logging.file.name=/var/log/sample-boot-application.log (1)
logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx (2)
```
--------------------------------
### Configure Server Actuator Credentials via Properties
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/security
Configure the SBA server to use default or service-specific credentials for accessing secured actuator endpoints. Ensure `spring.boot.admin.instance-auth.enabled` is true. Metadata from clients will override these properties.
```yaml
spring.boot.admin:
instance-auth:
enabled: true
default-user-name: "${some.user.name.from.secret}"
default-password: "${some.user.password.from.secret}"
service-map:
my-first-service-to-monitor:
user-name: "${some.user.name.from.secret}"
user-password: "${some.user.password.from.secret}"
my-second-service-to-monitor:
user-name: "${some.user.name.from.secret}"
user-password: "${some.user.password.from.secret}"
```
--------------------------------
### Generate Build Info with Maven
Source: https://docs.spring-boot-admin.com/3.5.6/docs/client/client-features
Use the spring-boot-maven-plugin's build-info goal to generate build information for Spring Boot applications. This information is typically stored in META-INF/build-info.properties.
```xml
org.springframework.boot
spring-boot-maven-plugin
build-info
```
--------------------------------
### Configure Custom Brand HTML
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Set custom HTML content for the navigation header, replacing the default Spring Boot Admin logo and name. Ensure the image path is accessible.
```properties
spring.boot.admin.ui.brand=
```
--------------------------------
### Add Spring Boot Admin Client Dependency
Source: https://docs.spring-boot-admin.com/3.5.6/docs/installation-and-setup
Include this dependency in your pom.xml to enable Spring Boot Admin Client functionality. Ensure spring-boot-starter-security is also present for security features.
```xml
de.codecentric
spring-boot-admin-starter-client
3.5.6
org.springframework.boot
spring-boot-starter-security
```
--------------------------------
### Implement Custom Notifier in Java
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/notifications
Extend AbstractEventNotifier to create a custom notifier. Override doNotify to handle instance events and log relevant information. Requires an InstanceRepository.
```java
public class CustomNotifier extends AbstractEventNotifier {
private static final Logger LOGGER = LoggerFactory.getLogger(CustomNotifier.class);
public CustomNotifier(InstanceRepository repository) {
super(repository);
}
@Override
protected Mono doNotify(InstanceEvent event, Instance instance) {
return Mono.fromRunnable(() -> {
if (event instanceof InstanceStatusChangedEvent statusChangedEvent) {
LOGGER.info("Instance {} ({}) is {}", instance.getRegistration().getName(), event.getInstance(),
statusChangedEvent.getStatusInfo().getStatus());
}
else {
LOGGER.info("Instance {} ({}) {}", instance.getRegistration().getName(), event.getInstance(),
event.getType());
}
});
}
}
```
--------------------------------
### Stream All Events (SSE)
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/Events
Returns a continuous stream of instance events using Server-Sent Events (SSE). This is ideal for real-time monitoring and keeping the UI updated dynamically.
```APIDOC
## GET /instances/events (SSE)
### Description
Returns a continuous stream of instance events using Server-Sent Events (SSE).
### Method
GET
### Endpoint
/instances/events
### Parameters
#### Query Parameters
None
#### Headers
- **Accept** (string) - Required - `text/event-stream`
### Request Example
```
GET /instances/events HTTP/1.1
Host: your-spring-boot-admin-host
Accept: text/event-stream
```
### Response
#### Success Response (200)
- **event stream** (stream) - A stream of events in SSE format.
#### Response Example
```
event: InstanceRegisteredEvent
data: {"timestamp":1678886400000,"type":"InstanceRegisteredEvent","instance":{"id":"instance-1","name":"MyApplication","healthUrl":"http://localhost:8080/actuator/health","managementUrl":"http://localhost:8080/actuator","serviceUrl":"http://localhost:8080","metadata":{}}}
event: InstanceStatusChangedEvent
data: {"timestamp":1678886460000,"type":"InstanceStatusChangedEvent","instance":{"id":"instance-1","name":"MyApplication","healthUrl":"http://localhost:8080/actuator/health","managementUrl":"http://localhost:8080/actuator","serviceUrl":"http://localhost:8080","metadata":{}},"status":{"oldValue":"UNKNOWN","newValue":"UP"}}
```
```
--------------------------------
### Configure FilteringNotifier Bean
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/notifications
Sets up the FilteringNotifier bean, delegating to other notifiers and using an InstanceRepository. This bean is then used by the RemindingNotifier.
```java
@Configuration(proxyBeanMethods = false)
public class NotifierConfig {
private final InstanceRepository repository;
private final ObjectProvider> otherNotifiers;
public NotifierConfig(InstanceRepository repository, ObjectProvider> otherNotifiers) {
this.repository = repository;
this.otherNotifiers = otherNotifiers;
}
@Bean
public FilteringNotifier filteringNotifier() { // (1)
CompositeNotifier delegate = new CompositeNotifier(this.otherNotifiers.getIfAvailable(Collections::emptyList));
return new FilteringNotifier(delegate, this.repository);
}
@Primary
@Bean(initMethod = "start", destroyMethod = "stop")
public RemindingNotifier remindingNotifier() { // (2)
RemindingNotifier notifier = new RemindingNotifier(filteringNotifier(), this.repository);
notifier.setReminderPeriod(Duration.ofMinutes(10));
notifier.setCheckReminderInverval(Duration.ofSeconds(10));
return notifier;
}
}
```
--------------------------------
### Enable Discovery Client in Spring Boot Application
Source: https://docs.spring-boot-admin.com/3.5.6/docs/installation-and-setup
Annotate your main Spring Boot application class with @EnableDiscoveryClient to activate service discovery integration.
```java
@EnableDiscoveryClient
@SpringBootApplication
@EnableAdminServer
public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
}
```
--------------------------------
### Disable Instance URLs in UI
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Completely disable instance URLs and associated UI actions. Setting `disable-instance-url` to true prevents URLs from being displayed or used.
```properties
spring.boot.admin.ui.disable-instance-url=true
```
--------------------------------
### Configure Routes for Custom Views in Spring Boot Admin
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
Define the necessary routes in `routes.txt` to enable navigation to custom views. This ensures that the paths for your custom views are recognized by the application.
```plaintext
/custom/**
/customSub/**
```
--------------------------------
### Configure Custom Favicon
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Set a custom favicon for the Spring Boot Admin UI, which is also used for desktop notifications. Provide paths for both the default and danger states.
```properties
spring.boot.admin.ui.favicon=assets/img/custom-favicon.png
```
```properties
spring.boot.admin.ui.favicon-danger=assets/img/custom-favicon-danger.png
```
--------------------------------
### Enable Spring Boot Admin Server Annotation
Source: https://docs.spring-boot-admin.com/3.5.6/docs/installation-and-setup
Annotate your main application class with @EnableAdminServer to activate the Spring Boot Admin Server functionality. This leverages Spring's autodiscovery.
```java
@SpringBootApplication
@EnableAdminServer
public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
}
```
--------------------------------
### Provide Custom HTTP Headers
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_http-headers
Implement a `HttpHeadersProvider` bean to add custom headers to requests. This is useful for authentication or passing specific metadata.
```java
@Bean
public HttpHeadersProvider customHttpHeadersProvider() {
return (instance) -> {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("X-CUSTOM", "My Custom Value");
return httpHeaders;
};
}
```
--------------------------------
### Add Simple External Link to Navbar
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
Configure a simple link to an external page in the Spring Boot Admin navbar. The link opens in a new tab.
```yaml
spring:
boot:
admin:
ui:
external-views:
- label: "🚀" #(1)
url: "https://codecentric.de" #(2)
order: 2000 #(3)
```
--------------------------------
### Configure RemindingNotifier in Java
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/notifications
Configure RemindingNotifier to send reminders for down/offline applications. Set reminder period and check interval. The notifier requires an instance of Notifier and InstanceRepository.
```java
@Configuration
public class NotifierConfiguration {
@Autowired
private Notifier notifier;
@Primary
@Bean(initMethod = "start", destroyMethod = "stop")
public RemindingNotifier remindingNotifier() {
RemindingNotifier notifier = new RemindingNotifier(notifier, repository);
notifier.setReminderPeriod(Duration.ofMinutes(10)); // (1)
notifier.setCheckReminderInverval(Duration.ofSeconds(10)); //(2)
return notifier;
}
}
```
--------------------------------
### Configure Eureka Client Actuator Credentials
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/security
Configure Eureka client to include username and password in its metadata map for accessing secured actuator endpoints. This allows the SBA server to authenticate with Eureka-registered clients.
```yaml
eureka:
instance:
metadata-map:
user.name: ${spring.security.user.name}
user.password: ${spring.security.user.password}
```
--------------------------------
### Configure Custom UI Theme Colors
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Set custom colors for the Spring Boot Admin UI theme, including the main color and a detailed palette for sidebar elements. Ensure the color values are valid CSS color strings.
```yaml
spring:
boot:
admin:
ui:
theme:
color: "#4A1420"
palette:
50: "#F8EBE4"
100: "#F2D7CC"
200: "#E5AC9C"
300: "#D87B6C"
400: "#CB463B"
500: "#9F2A2A"
600: "#83232A"
700: "#661B26"
800: "#4A1420"
900: "#2E0C16"
```
--------------------------------
### Stream Events for a Specific Instance (SSE)
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/Events
Streams Server-Sent Events for a single instance, identified by its unique ID. This allows for focused real-time monitoring of a particular application instance.
```APIDOC
## GET /instances/{id} (SSE)
### Description
Streams events for a single instance, identified by its ID, using Server-Sent Events (SSE).
### Method
GET
### Endpoint
/instances/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the instance.
#### Headers
- **Accept** (string) - Required - `text/event-stream`
### Request Example
```
GET /instances/instance-1 HTTP/1.1
Host: your-spring-boot-admin-host
Accept: text/event-stream
```
### Response
#### Success Response (200)
- **event stream** (stream) - A stream of events in SSE format for the specified instance.
#### Response Example
```
event: InstanceStatusChangedEvent
data: {"timestamp":1678886460000,"type":"InstanceStatusChangedEvent","instance":{"id":"instance-1","name":"MyApplication","healthUrl":"http://localhost:8080/actuator/health","managementUrl":"http://localhost:8080/actuator","serviceUrl":"http://localhost:8080","metadata":{}},"status":{"oldValue":"UNKNOWN","newValue":"UP"}}
```
```
--------------------------------
### Configure Custom Login Icon
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Specify a custom image to be displayed on the Spring Boot Admin login page. Place the image in a served resource location and reference its path.
```properties
spring.boot.admin.ui.login-icon=assets/img/custom-login-icon.svg
```
--------------------------------
### Create Dropdown with Multiple Links in Navbar
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
Aggregate multiple external links under a single dropdown item in the Spring Boot Admin navbar. Each child link opens in a new tab.
```yaml
spring:
boot:
admin:
ui:
external-views:
- label: Link w/o children
children:
- label: "📖 Docs"
url: https://codecentric.github.io/spring-boot-admin/current/
- label: "📦 Maven"
url: https://search.maven.org/search?q=g:de.codecentric%20AND%20a:spring-boot-admin-starter-server
- label: "🐙 GitHub"
url: https://github.com/codecentric/spring-boot-admin
```
--------------------------------
### Enable Pyctuator in Flask App
Source: https://docs.spring-boot-admin.com/3.5.6/docs/third-party/pyctuator
Integrate Pyctuator with your Flask application by initializing it with your app instance and Spring Boot Admin details. Ensure the SPRING_BOOT_ADMIN_URL environment variable is set.
```python
import os
from flask import Flask
from pyctuator.pyctuator import Pyctuator
app_name = "Flask App with Pyctuator"
app = Flask(app_name)
@app.route("/")
def hello():
return "Hello World!"
Pyctuator(
app,
app_name,
app_url="http://example-app.com",
pyctuator_endpoint_url="http://example-app.com/pyctuator",
registration_url=os.getenv("SPRING_BOOT_ADMIN_URL")
)
app.run()
```
--------------------------------
### Add Jolokia Core for Spring Boot 2
Source: https://docs.spring-boot-admin.com/3.5.6/docs/client/client-features
For Spring Boot 2 applications, include the jolokia-core dependency to enable JMX-bean management. Spring Boot 2 provides its own actuator, so only the core Jolokia dependency is needed.
```xml
org.jolokia
jolokia-core
```
--------------------------------
### Configure Consul Client Actuator Credentials
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/security
Configure Consul client to provide username and password in its discovery metadata for accessing secured actuator endpoints. Note that Consul metadata keys cannot contain dots; use dashes instead.
```yaml
spring.cloud.consul:
discovery:
metadata:
user-name: ${spring.security.user.name}
user-password: ${spring.security.user.password}
```
--------------------------------
### Configure Spring Boot Admin Client URL
Source: https://docs.spring-boot-admin.com/3.5.6/docs/installation-and-setup
Set the URL of the Spring Boot Admin Server in application.properties. Expose all management endpoints for monitoring and enable the info endpoint to provide additional details.
```properties
spring.boot.admin.client.url=http://localhost:8080
management.endpoints.web.exposure.include=*
management.info.env.enabled=true
```
--------------------------------
### Configure Custom Browser Window Title
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/customize_ui
Customize the text displayed in the browser's window title. This property allows for easy identification of different environments or applications.
```properties
spring.boot.admin.ui.title=My Custom Title
```
--------------------------------
### Add Hazelcast Dependency to Maven
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/Clustering
Include the Hazelcast dependency in your pom.xml to enable Hazelcast support.
```xml
com.hazelcast
hazelcast
```
--------------------------------
### Spring Boot Admin Client Credentials Configuration
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/security
Configure these properties in your Spring Boot Admin Client application to provide the necessary username and password for accessing the Spring Boot Admin server. This is crucial if the /instances endpoint is protected.
```yaml
spring.boot.admin.client:
username: sba-client
password: s3cret
```
--------------------------------
### Register Custom UI View with Spring Boot Admin
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
Implement and register a custom view using Vue.js for the Spring Boot Admin UI. This involves defining the view's properties and integrating translations.
```javascript
SBA.use({
install({ viewRegistry, i18n }) {
viewRegistry.addView({
name: "custom", //(1)
path: "/custom", //(2)
component: custom, //(3)
group: "custom", //(4)
handle,
order: 1000, //(6)
});
i18n.mergeLocaleMessage("en", {
custom: {
label: "My Extensions", //(7)
},
});
i18n.mergeLocaleMessage("de", {
custom: {
label: "Meine Erweiterung",
},
});
},
});
```
--------------------------------
### Vue Component for Custom Endpoint View
Source: https://docs.spring-boot-admin.com/3.5.6/docs/customize/extend_ui
This Vue component fetches and displays data from a custom actuator endpoint. It expects an 'instance' prop, which provides a preconfigured axios instance for making requests. The component renders the instance ID and the HTML content received from the endpoint.
```vue
```
--------------------------------
### Configure Custom HTTP Client for Mutual TLS
Source: https://docs.spring-boot-admin.com/3.5.6/docs/server/security
Configure a custom `ClientHttpConnector` bean to enable mutual TLS authentication for accessing actuator endpoints. Spring Boot Admin will automatically use this configured `WebClient.Builder`.
```java
@Bean
public ClientHttpConnector customHttpClient() {
SslContextBuilder sslContext = SslContextBuilder.forClient();
//Your sslContext customizations go here
HttpClient httpClient = HttpClient.create().secure(
ssl -> ssl.sslContext(sslContext)
);
return new ReactorClientHttpConnector(httpClient);
}
```