Cross-reference the reference documentation and sample guide for Spring Boot Actuator.
This commit is contained in:
@@ -1,30 +1,33 @@
|
||||
[[actuator]]
|
||||
== Spring Boot Actuator
|
||||
|
||||
Spring Boot for Apache Geode and Pivotal GemFire (SBDG) adds {spring-boot-docs-html}/production-ready.html[Spring Boot Actuator]
|
||||
support and dedicated `HealthIndicators` for Apache Geode and Pivotal GemFire. Equally, the provided `HealthIndicators`
|
||||
will even work with Pivotal Cloud Cache, which is backed by Pivotal GemFire, when pushing your Spring Boot applications
|
||||
to Pivotal CloudFoundry (PCC).
|
||||
Spring Boot for {apache-geode-name} and {pivotal-gemfire-name} (SBDG) adds {spring-boot-docs-html}/production-ready.html[Spring Boot Actuator]
|
||||
support and dedicated `HealthIndicators` for {apache-geode-name} and {pivotal-gemfire-name}. Equally, the provided
|
||||
`HealthIndicators` will even work with Pivotal Cloud Cache, which is backed by {pivotal-gemfire-name}, when pushing your
|
||||
Spring Boot applications to Pivotal CloudFoundry (PCC).
|
||||
|
||||
Spring Boot `HealthIndicators` provide details about the runtime operation and behavior of your Apache Geode
|
||||
or Pivotal GemFire based Spring Boot applications. For instance, by querying the right `HealthIndicator` endpoint,
|
||||
you would be able to get the current hit/miss count for your `Region.get(key)` data access operations.
|
||||
Spring Boot `HealthIndicators` provide details about the runtime operation and behavior of your {apache-geode-name}
|
||||
based Spring Boot applications. For instance, by querying the right `HealthIndicator` endpoint, you would be able to
|
||||
get the current hit/miss count for your `Region.get(key)` data access operations.
|
||||
|
||||
In addition to vital health information, SBDG provides basic, pre-runtime configuration meta-data about the Apache Geode
|
||||
/ Pivotal GemFire components that are monitored by Spring Boot Actuator. This makes it easier to see how
|
||||
In addition to vital health information, SBDG provides basic, pre-runtime configuration meta-data about the
|
||||
{apache-geode-name} components that are monitored by Spring Boot Actuator. This makes it easier to see how
|
||||
the application was configured all in one place, rather than in properties files, Spring config, XML, etc.
|
||||
|
||||
The provided Spring Boot `HealthIndicators` fall under one of three categories:
|
||||
|
||||
* Base `HealthIndicators` that apply to all Apache Geode/Pivotal GemFire, Spring Boot applications, regardless of
|
||||
cache type, such as Regions, Indexes and DiskStores.
|
||||
* Base `HealthIndicators` that apply to all {apache-geode-name}, Spring Boot applications, regardless of cache type,
|
||||
such as Regions, Indexes and DiskStores.
|
||||
* Peer `Cache` based `HealthIndicators` that are only applicable to peer `Cache` applications, such as
|
||||
`AsyncEventQueues`, `CacheServers`, `GatewayReceivers` and `GatewaySenders`.
|
||||
* And finally, `ClientCache` based `HealthIndicators` that are only applicable to `ClientCache` applications, such as
|
||||
`ContinuousQueries` and connection `Pools`.
|
||||
|
||||
The following sections give a brief overview of all the available Spring Boot `HealthIndicators` provided for
|
||||
Apache Geode/Pivotal GemFire, out-of-the-box.
|
||||
{apache-geode-name} out-of-the-box.
|
||||
|
||||
TIP: Refer to the corresponding Sample link:guides/boot-actuator.html[Guide] and {github-samples-url}/boot/actuator[Code]
|
||||
to see the Spring Boot Actuator for {apache-geode-name} in action!
|
||||
|
||||
[[actuator-base-healthindicators]]
|
||||
=== Base `HealthIndicators`
|
||||
@@ -32,10 +35,9 @@ Apache Geode/Pivotal GemFire, out-of-the-box.
|
||||
The following section covers Spring Boot `HealthIndicators` that apply to both peer `Cache` and `ClientCache`,
|
||||
Spring Boot applications. That is, these `HealthIndicators` are not specific to the cache type.
|
||||
|
||||
In both Apache Geode and Pivotal GemFire, the cache instance is either a peer `Cache` instance, which makes your
|
||||
Spring Boot application part of a GemFire/Geode cluster, or more commonly, a `ClientCache` instance that talks to
|
||||
an existing cluster. Your Spring Boot application can only be one cache type or the other and can only have a single
|
||||
instance of that cache type.
|
||||
In {apache-geode-name}, the cache instance is either a peer `Cache` instance, which makes your Spring Boot application
|
||||
part of a GemFire/Geode cluster, or more commonly, a `ClientCache` instance that talks to an existing cluster. Your
|
||||
Spring Boot application can only be one cache type or the other and can only have a single instance of that cache type.
|
||||
|
||||
[[actuator-base-healthindicators-cache]]
|
||||
==== GeodeCacheHealthIndicator
|
||||
@@ -403,7 +405,7 @@ The peer `Cache` based `HealthIndicators` provide additional details specificall
|
||||
applications. These `HealthIndicators` are only available when the Spring Boot application creates a peer `Cache`
|
||||
instance.
|
||||
|
||||
NOTE: The default cache instance created by Spring Boot for Apache Geode/Pivotal GemFire is a `ClientCache` instance.
|
||||
NOTE: The default cache instance created by Spring Boot for {apache-geode-name} is a `ClientCache` instance.
|
||||
|
||||
TIP: To control what type of cache instance is created, such as a "peer", then you can explicitly declare either the
|
||||
`@PeerCacheApplication`, or alternatively, the `@CacheServerApplication`, annotation on your `@SpringBootApplication`
|
||||
@@ -412,7 +414,7 @@ annotated class.
|
||||
[[actuator-peercache-healthindicators-cacheservers]]
|
||||
==== GeodeCacheServersHealthIndicator
|
||||
|
||||
The `GeodeCacheServersHealthIndicator` provides details about the configured Apache Geode/Pivotal GemFire `CacheServers`.
|
||||
The `GeodeCacheServersHealthIndicator` provides details about the configured {apache-geode-name} `CacheServers`.
|
||||
`CacheServer` instances are required to enable clients to connect to the servers in the cluster.
|
||||
|
||||
This `HealthIndicator` captures basic configuration meta-data and runtime behavior/characteristics of
|
||||
@@ -510,7 +512,7 @@ or serial.
|
||||
==== GeodeGatewayReceiversHealthIndicator
|
||||
|
||||
The `GeodeGatewayReceiversHealthIndicator` provide details about the configured (WAN) `GatewayReceivers`, which are
|
||||
capable of receiving events from remote clusters when using Apache Geode/Pivotal GemFire's
|
||||
capable of receiving events from remote clusters when using {apache-geode-name}'s
|
||||
{apache-geode-docs}/topologies_and_comm/multi_site_configuration/chapter_overview.html[multi-site, WAN topology].
|
||||
|
||||
This `HealthIndicator` captures configuration meta-data along with the running state for each `GatewayReceiver`:
|
||||
@@ -543,7 +545,7 @@ GatewayReceiver's port will be chosen.
|
||||
==== GeodeGatewaySendersHealthIndicator
|
||||
|
||||
The `GeodeGatewaySendersHealthIndicator` provides details about the configured `GatewaySenders`. `GatewaySenders` are
|
||||
attached to Regions in order to send Region events to remote clusters in Apache Geode/Pivotal GemFire's
|
||||
attached to Regions in order to send Region events to remote clusters in {apache-geode-name}'s
|
||||
{apache-geode-docs}/topologies_and_comm/multi_site_configuration/chapter_overview.html[multi-site, WAN topology].
|
||||
|
||||
This `HealthIndicator` captures essential configuration meta-data and runtime characteristics for each `GatewaySender`:
|
||||
@@ -584,4 +586,3 @@ between this GatewaySender and its receiving GatewayReceiver.
|
||||
this sending GatewaySender and its receiving GatewayReceiver will block.
|
||||
|
||||
|=====================================================================================================================
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
[[geode-samples-boot-actuator]]
|
||||
= Spring Boot Actuator for Apache Geode & Pivotal GemFire
|
||||
:apache-geode-version: {apache-geode-doc-version}
|
||||
:apache-geode-docs: https://geode.apache.org/docs/guide/{apache-geode-version}
|
||||
= Spring Boot Actuator for Apache Geode & VMware Tanzu GemFire
|
||||
:geode-version: {apache-geode-doc-version}
|
||||
:geode-name: Apache Geode
|
||||
:geode-docs: https://geode.apache.org/docs/guide/{geode-version}
|
||||
:gemfire-name: VMware Tanzu GemFire
|
||||
:images-dir: ./images
|
||||
:spring-boot-docs: https://docs.spring.io/spring-boot/docs/current/reference/html
|
||||
:spring-framework-docs: https://docs.spring.io/spring/docs/current/spring-framework-reference
|
||||
@@ -13,16 +15,19 @@
|
||||
|
||||
|
||||
This guide walks through using {spring-boot-docs}/production-ready.html[Spring Boot Actuator] to assess the state
|
||||
of your running Apache Geode or Pivotal GemFire, Spring Boot application.
|
||||
of your running {geode-name} or {gemfire-name}, Spring Boot application.
|
||||
|
||||
The goal for SBDG's Spring Boot Actuator integration is to enable users to effectively manage and monitor their
|
||||
Spring Boot applications using Apache Geode or Pivotal GemFire in a production environment.
|
||||
Spring Boot applications using {geode-name} or {gemfire-name} in a production environment.
|
||||
|
||||
In particular, SBDG's integration with Spring Boot Actuator currently focuses on enabling
|
||||
{spring-boot-docs}/production-ready-endpoints.html#production-ready-health[Health Information]
|
||||
for your application. In the future, SBDG will provide dedicated support for https://micrometer.io/[Micrometer] metrics.
|
||||
|
||||
This guide assumes you are already familiar with Spring Boot and Apache Geode (or Pivotal GemFire).
|
||||
This guide assumes you are already familiar with Spring Boot and {geode-name}.
|
||||
|
||||
TIP: Refer to the link:../index.html#actuator[Spring Boot Actuator] chapter in the reference documentation
|
||||
for more information.
|
||||
|
||||
[#index-link]
|
||||
link:../index.html[Index]
|
||||
@@ -57,7 +62,7 @@ However in this case, we simply model the `TemperatureReading` as:
|
||||
include::{samples-dir}/boot/actuator/src/main/java/example/app/temp/model/TemperatureReading.java[tags=class]
|
||||
----
|
||||
|
||||
The `TemperatureReading` class is annotated with SDG's `@Region` mapping annotation to declare the Apache Geode Region
|
||||
The `TemperatureReading` class is annotated with SDG's `@Region` mapping annotation to declare the {geode-name} Region
|
||||
in which `TemperatureReadings` will be persisted.
|
||||
|
||||
[[geode-samples-boot-actuator-example-temperatureevent]]
|
||||
@@ -98,12 +103,11 @@ along with 2 `@Query` annotated query methods using raw OQL queries.
|
||||
[[geode-samples-boot-actuator-example-temperaturemonitor]]
|
||||
=== TemperatureMonitor service class
|
||||
|
||||
To receive temperature change events, we need a class to monitor changes. This capability is built on Apache Geode's
|
||||
{apache-geode-docs}/developing/continuous_querying/chapter_overview.html[Continuous Query (CQ)] functionality.
|
||||
To receive temperature change events, we need a class to monitor changes. This capability is built on {geode-name}'s
|
||||
{geode-docs}/developing/continuous_querying/chapter_overview.html[Continuous Query (CQ)] functionality.
|
||||
|
||||
With Apache Geode (or Pivotal GemFire) you can register an (OQL) Query with the servers in the cluster that runs
|
||||
continuously, sending notifications back to the client anytime data changes to match the predicate in our query,
|
||||
or queries.
|
||||
With {geode-name} you can register an (OQL) Query with the servers in the cluster that runs continuously, sending
|
||||
notifications back to the client anytime data changes to match the predicate in our query, or queries.
|
||||
|
||||
For our purposes, we will simply monitor the temperature anytime it rises above boiling (212 °F)
|
||||
or drops below freezing (32 °F):
|
||||
@@ -154,7 +158,7 @@ data access operations.
|
||||
|
||||
Now, we need a couple of main application classes to actually have the application do something useful.
|
||||
|
||||
We start with an Spring Boot, Apache Geode Server application functioning as the temperature sensor (device)
|
||||
We start with an Spring Boot, {geode-name} Server application functioning as the temperature sensor (device)
|
||||
using the `TemperatureSensor` class:
|
||||
|
||||
.BootGeodeServerApplication main class
|
||||
@@ -166,26 +170,26 @@ include::{samples-dir}/boot/actuator/src/main/java/example/app/temp/geode/server
|
||||
This class is annotated with `@SpringBootApplication` making it a proper Spring Boot application. It uses Spring Boot's
|
||||
`SpringApplicationBuilder` to configure and bootstrap the server application.
|
||||
|
||||
This class is also annotated with SDG's `@CacheServerApplication` making it a proper Apache Geode Server with a peer
|
||||
This class is also annotated with SDG's `@CacheServerApplication` making it a proper {geode-name} Server with a peer
|
||||
`Cache` instance along with a `CacheServer` to accept client connections. This effectively overrides SBDG's default
|
||||
`ClientCache` instance.
|
||||
|
||||
Additionally, the class enables several other features, such as Spring's _Scheduling Service_, Apache Geode Statistics,
|
||||
Additionally, the class enables several other features, such as Spring's _Scheduling Service_, {geode-name} Statistics,
|
||||
and entity-defined Regions making the creation of our server-side, partitioned "TemperatureReadings" Region simple.
|
||||
|
||||
By enabling Apache Geode statistics, we allow Spring Boot's Actuator, `HealthIndicators` to collect metrics about
|
||||
our running Apache Geode Server as well.
|
||||
By enabling {geode-name} statistics, we allow Spring Boot's Actuator, `HealthIndicators` to collect metrics about
|
||||
our running {geode-name} Server as well.
|
||||
|
||||
Because we have enabled scheduling (with `@EnableScheduling`) and declared the `TemperatureSensor` class as a bean
|
||||
in the Spring application context, the application will immediately start generating temperature readings, which are
|
||||
recorded to the "TemperatureReadings" Region.
|
||||
|
||||
Finally, our class registers a couple Apache Geode Region Indexes to make the Actuator `HealthIndicator` information
|
||||
Finally, our class registers a couple {geode-name} Region Indexes to make the Actuator `HealthIndicator` information
|
||||
more interesting, particularly since we are running continuous queries.
|
||||
|
||||
This is a Servlet-based application as well since our Actuator, `HealthIndicator` endpoints are exposed via HTTP.
|
||||
|
||||
TIP: There are multiple ways to configure and bootstrap an Apache Geode Server, and the server-side of our application.
|
||||
TIP: There are multiple ways to configure and bootstrap an {geode-name} Server, and the server-side of our application.
|
||||
Using Spring Boot is one of the easier ways.
|
||||
|
||||
[[geode-samples-boot-actuator-example-client]]
|
||||
@@ -234,7 +238,7 @@ The `gradlew` command and `runServer` Gradle Task sets the configuration (e.g. S
|
||||
command is ran in the directory where you cloned the `spring-boot-data-geode` project (**not** in
|
||||
`spring-boot-data-geode/spring-geode-samples/boot/actuator/`).
|
||||
|
||||
If you wish to adjust the log levels of Apache Geode or Spring Boot while running the client and server applications,
|
||||
If you wish to adjust the log levels of {geode-name} or Spring Boot while running the client and server applications,
|
||||
then you can set the log levels of the individual Loggers (i.e. `org.apache` and `org.springframework`)
|
||||
in `src/main/resources/logback.xml`:
|
||||
|
||||
@@ -324,7 +328,7 @@ Both the server and client will continue to run, generating and logging temperat
|
||||
|
||||
After the application has been running for some time, we can inspect the Spring Boot Actuator, HealthIndicator Endpoints
|
||||
provided by SBDG to monitor our application's health and runtime performance in addition to basic configuration
|
||||
meta-data used to configure Apache Geode at runtime.
|
||||
meta-data used to configure {geode-name} at runtime.
|
||||
|
||||
[[geode-samples-boot-actuator-example-monitor-client]]
|
||||
=== Client Health Information
|
||||
@@ -383,7 +387,7 @@ All of this was made possible by including the following dependency on our appli
|
||||
<dependency>
|
||||
<groupId>org.springframework.geode</groupId>
|
||||
<artifactId>spring-geode-starter-actuator</artifactId>
|
||||
</dependency
|
||||
</dependency>
|
||||
----
|
||||
|
||||
Additionally, in Spring Boot `application.properties`, you must enable the following:
|
||||
@@ -397,11 +401,11 @@ management.endpoint.health.show-details=always
|
||||
[[geode-samples-boot-actuator-conclusion]]
|
||||
== Conclusion
|
||||
|
||||
Hopefully this guide has shown you how to use the Spring Boot Actuator feature for Apache Geode and Pivotal GemFire.
|
||||
Hopefully this guide has shown you how to use the Spring Boot Actuator feature for {geode-name} and {gemfire-name}.
|
||||
|
||||
You are encouraged to read more about {spring-boot-docs}/production-ready.html[Spring Boot's Actuator] functionality.
|
||||
|
||||
Additonally, you can find out more about Apache Geode Statistics
|
||||
in the {apache-geode-docs}/managing/statistics/chapter_overview.html[User Guide].
|
||||
Additionally, you can find out more about {geode-name} Statistics
|
||||
in the {geode-docs}/managing/statistics/chapter_overview.html[User Guide].
|
||||
|
||||
link:../index.html#geode-samples[Back to Samples]
|
||||
|
||||
Reference in New Issue
Block a user