Commit 49d00be8 by Johannes Edmeier

Polish docs

parent 1f04e23f
[[monitoring-spring-boot-1.5.x]]
== Monitoring Spring Boot Applciations 1.5.x ==
== Monitoring Spring Boot 1.5.x ==
It is possible to monitor Spring Boot 1.5.x applications with Spring Boot Admin 2.x. The old Spring Boot Admin Client is
able to register at a newer server. Since the API has slight changes for you need to set the following property:
......
......@@ -9,15 +9,13 @@ If you include the `spring-boot-admin-server-ui-login` in your dependencies it w
A Spring Security configuration could look like this:
[source,java]
----
include::{samples-dir}/spring-boot-admin-sample/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java[tags=configuration-spring-security]
include::{samples-dir}/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java[tags=configuration-spring-security]
----
For a complete sample look at https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample/[spring-boot-admin-sample].
For a complete sample look at https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-servlet/[spring-boot-admin-sample-servlet.
NOTE: If you protect the `/api/applications` endpoint don't forget to configure the username and password on your SBA-Client using `spring.boot.admin.client.username` and `spring.boot.admin.instance.password`.
TIP: There are more samples (e.g. using OAuth2) in https://github.com/joshiste/spring-boot-admin-samples[joshiste/spring-boot-admin-samples^].
=== Securing Client Actuator Endpoints ===
When the actuator endpoints are secured using HTTP Basic authentication the SBA Server needs credentials to access them. You can submit the credentials in the metadata when registering the application. The `BasicAuthHttpHeaderProvider` then uses this metadata to add the `Authorization` header to access your application's actuator endpoints. You can provide your own `HttpHeadersProvider` to alter the behaviour (e.g. add some decryption) or add extra headers.
......@@ -30,8 +28,8 @@ spring.boot.admin.client:
url: http://localhost:8080
instance:
metadata:
user.name: ${security.user.name}
user.password: ${security.user.password}
user.name: ${spring.security.user.name}
user.password: ${spring.security.user.password}
----
Submitting the credentials using Eureka:
......@@ -41,8 +39,8 @@ Submitting the credentials using Eureka:
eureka:
instance:
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.password}
user.name: ${spring.security.user.name}
user.password: ${spring.security.user.password}
----
NOTE: The SBA Server masks certain metadata in the HTTP interface to prevent leaking of sensitive information.
......
......@@ -35,11 +35,11 @@ spring:
management.context-path: /actuator
----
==== Other DiscoveryClient implementations (Eureka, Zookeeper, Consul, ...) ====
Spring Boot Admin supports all other implementation of Spring Cloud's `DiscoveryClient`. You need to add it to the Spring Boot Admin Server and configure it properly.
==== Other DiscoveryClients ====
Spring Boot Admin supports all other implementations of Spring Cloud's `DiscoveryClient` (Eureka, Zookeeper, Consul, ...). You need to add it to the Spring Boot Admin Server and configure it properly.
An <<discover-clients-via-spring-cloud-discovery,example setup using Eureka>> is shown above.
==== Converting ServiceInstances into monitored applications ====
==== Converting ServiceInstances ====
The information from the service registry are converted by the `ServiceInstanceConverter`. Spring Boot Admin ships with a default and Eureka converter implementation. The correct one is selected by AutoConfiguration.
......
=== Notifications ===
[reminder-notifications]
[[reminder-notifications]]
==== Reminder notifications ====
The `RemindingNotifier` sends reminders for down/offline applications, it delegates the sending of notifications to another notifier.
......@@ -34,6 +35,7 @@ public class NotifierConfiguration {
<1> The reminders will be sent every 5 minutes.
<2> Schedules sending of due reminders every 60 seconds.
[[filtering-notifications]]
==== Filtering notifications ====
The `FilteringNotifier` allows you to filter certain notification based on rules you can add/remove at runtime. It delegates the sending of notifications to another notifier.
......@@ -75,6 +77,7 @@ public class NotifierConfiguration {
TIP: This example combines the reminding and filtering notifiers. This allows you to get notifications after the deployed application hasn't restarted in a certain amount of time (until the filter expires).
[[mail-notifications]]
==== Mail notifications ====
......@@ -128,6 +131,7 @@ spring.boot.admin.notify.mail.to=admin@example.com
| `+++"#{application.name} (#{application.id})\nstatus changed from #{from.status} to #{to.status}\n\n#{application.healthUrl}"+++`
|===
[[pagerduty-notifications]]
==== PagerDuty notifications ====
To enable https://www.pagerduty.com/[PagerDuty] notifications you just have to add a generic service to your PagerDuty-account and set `spring.boot.admin.notify.pagerduty.service-key` to the service-key you received.
......@@ -219,7 +223,8 @@ To enable https://www.opsgenie.com/[OpsGenie] notifications you just have to add
|
|===
[hipchat-notifications]
[[hipchat-notifications]]
==== Hipchat notifications ====
To enable https://www.hipchat.com/[Hipchat] notifications you need to create an API token from you Hipchat account and set the appropriate configuration properties.
......@@ -257,7 +262,8 @@ To enable https://www.hipchat.com/[Hipchat] notifications you need to create an
|
|===
[slack-notifications]
[[slack-notifications]]
==== Slack notifications ====
To enable https://slack.com/[Slack] notifications you need to add a incoming Webhook under custom integrations on your Slack
account and configure it appropriately.
......@@ -296,7 +302,8 @@ account and configure it appropriately.
|
|===
[letschat-notifications]
[[letschat-notifications]]
==== Let's Chat notifications ====
To enable https://sdelements.github.io/lets-chat/[Let's Chat] notifications you need to add the host url and add the API token and username from Let's Chat
......@@ -334,7 +341,8 @@ To enable https://sdelements.github.io/lets-chat/[Let's Chat] notifications you
|
|===
[ms-teams-notifications]
[[ms-teams-notifications]]
==== Microsoft Teams notifications ====
To enable Microsoft Teams notifications you need to setup a connector webhook url and set the appropriate configuration property.
......@@ -355,7 +363,8 @@ To enable Microsoft Teams notifications you need to setup a connector webhook ur
|
|===
[telegram-notifications]
[[telegram-notifications]]
==== Telegram notifications ====
To enable https://telegram.org/[Telegram] notifications you need to create and authorize a telegram bot and set the appropriate configuration properties for auth-token and chat-id.
......
......@@ -3,7 +3,7 @@ spring:
name: eureka-example
# tag::configuration-eureka[]
eureka: #1
eureka: #<1>
instance:
leaseRenewalIntervalInSeconds: 10
client:
......@@ -15,7 +15,7 @@ management:
endpoints:
web:
exposure:
include: "*" #2
include: "*" #<2>
# end::configuration-eureka[]
endpoint:
health:
......
......@@ -43,8 +43,8 @@ public class SpringBootAdminApplication {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
@Configuration
@Profile("insecure")
@Configuration
public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
......@@ -53,8 +53,9 @@ public class SpringBootAdminApplication {
}
}
@Configuration
@Profile("secure")
// tag::configuration-spring-security[]
@Configuration
public static class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
private final String adminContextPath;
......@@ -80,6 +81,7 @@ public class SpringBootAdminApplication {
// @formatter:on
}
}
// end::configuration-spring-security[]
@Configuration
public static class NotifierConfig {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment