Commit Graph

1177 Commits (6134ff19f94f73bb262cab2d28d18b2c55db4121)

Author SHA1 Message Date
Phillip Webb 12381467da Polish 5 years ago
Phillip Webb 6a1f61c1bf Merge branch '2.2.x' 5 years ago
Phillip Webb 5157a75119 Polish 5 years ago
Stephane Nicoll 23c5549832 Polish 5 years ago
Andy Wilkinson a03426af57 Configure the Asciidoctor revnumber in a central location
See gh-20934
5 years ago
Madhura Bhave 376098d080 Set asciidoctor revnumber to null
Closes gh-20934
5 years ago
Scott Frederick 0d00947735 Closes gh-21428 5 years ago
Scott Frederick 6b8d08a6e3 Handle exceptions in management context
Prior to this commit, details about an exception would get dropped when
the management context was separate from the application context and
an actuator endpoint threw a binding exception.

This commit adds some logic to capture the exception so the management
context error handlers can add the appropriate attributes to the error
response.

Fixes gh-21036
5 years ago
Scott Frederick 158933c3e5 Improve API of ErrorAttributes and DefaultErrorAttributes
This commit improves the backward-compatibility of the ErrorAttributes
interfaces by providing a default implementation of a new method. It
also encapsulates several parameters that control the inclusion or
exclusion of error attributes into a new ErrorAttributeOptions type to
make it easier and less intrusive to add additional options in the
future. This encapsulation also makes the handling of the
includeException option more similar to other options.

Fixes gh-21324
5 years ago
Andy Wilkinson f6d8c7d23c Simplify ReactiveWebServerApplicationContext.ServerManager
Closes gh-21315
5 years ago
Phillip Webb d52bf83ab2 Polish 5 years ago
Scott Frederick a30740f8d2 Separate server properties for message and errors
Prior to this commit, there was a property server.error.include-details
that allowed configuration of the message and errors attributes in a
server error response.

This commit separates the control of the message and errors attributes
into two separate properties named server.error.include-message and
server.error.include-binding-errors. When the message attribute is
excluded from a servlet response, the value is changed from a
hard-coded text value to an empty value.

Fixes gh-20505
5 years ago
Stephane Nicoll d16074d8fd Bind and unbind Kafka metrics as consumers and producers come and go
Fixes gh-21008

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
5 years ago
dreis2211 c1c90b11b8 Fix some deprecations
See gh-21212
5 years ago
Brian Clozel ec871d6752 Fix StatusAggregator static initialization
Prior to this commit, there was a cycle between `StatusAggregator` and
`SimpleStatusAggregator`, which caused a static initialization bug -
depending on which class (the implementation or its interface) was
loaded first.

This commit turns the static field of the `StatusAggregator` interface
into a static method to avoid this problem.

Fixes gh-21211
5 years ago
Brian Clozel dfdee3e00e Revert "Add support for Reactor Netty Micrometer metrics"
This commit removes the support for Reactor Netty metrics since it
seems that Spring Boot should not use this feature:

* HTTP metrics are already covered by WebFlux
* TCP metrics are only meant to TCP server/clients
* allocator metrics are already provided by Netty and there is
no specific API to enable them here.

Closes gh-19388
5 years ago
Brian Clozel 956afdcf97 Add support for Reactor Netty Micrometer metrics
This commit enables the production of TCP and buffer allocator metrics
for Reactor Netty, client and server.

When applications use auto-configured server
(`NettyReactiveWebServerFactory`) and client (through
`WebClient.Builder`) instances, metrics will be enabled.

Note that HTTP metrics are not enabled here, since similar metrics are
already produced at the WebFlux level. Also, to avoid cardinality
explosion of metrics (through the URI tag), Reactor Netty offers
configurable infrastructure to deduplicate URI tags by turning expanded
URI instances into templated URIs. This is not targeted for Spring
usage.

Closes gh-19388
5 years ago
Johnny Lim ef567388c1 Polish
See gh-21110
5 years ago
dreis2211 667033c149 Fix Actuator API PDF name
See gh-21054
5 years ago
dreis2211 5eb5bf0a2d Polish
See gh-21009
5 years ago
Stephane Nicoll 85e9f713b0 Update copyright year of changed files
See gh-21007
5 years ago
Johnny Lim 29717423a3 Remove this keyword on member method invocations
See gh-21007
5 years ago
Stephane Nicoll ddcd1bc7bb Remove metadata for configuration keys that were removed in 2.0
Closes gh-19706
5 years ago
Stephane Nicoll 623fbcbf8c Polish 5 years ago
Stephane Nicoll 1019dbbc47 Merge branch '2.2.x'
Closes gh-21100
5 years ago
Stephane Nicoll 8ac3ab5551 Add missing metadata for removed configuration keys
Closes gh-20846
5 years ago
Stephane Nicoll 6c02daf2bc Merge branch '2.2.x'
Closes gh-21098
5 years ago
Stephane Nicoll 311952730e Merge branch '2.1.x' into 2.2.x
Closes gh-21097
5 years ago
Stephane Nicoll 291165f060 Order additional metadata according to lexicographic order
Closes gh-21095
5 years ago
Andy Wilkinson d05c973e71 Polish 5 years ago
Stephane Nicoll fe90b2a251 Rename Service Level Agreement to Service Level Objective
This commit harmonizes our integration of Micrometer's Service Level
objectives.

Closes gh-21076
5 years ago
Phillip Webb 56711d678a Merge branch '2.2.x'
Closes gh-21083
5 years ago
Phillip Webb 102729b5e1 Merge branch '2.1.x' into 2.2.x
Closes gh-21082
5 years ago
Phillip Webb b3d33754a5 Remove outdated FIXMEs from tests
Closes gh-19782
5 years ago
Andy Wilkinson ab82e59aa1 Polish "Improve property name in thrown Micrometer ValidationException"
See gh-21069
5 years ago
Jon Schneider 507b062c43 Improve property name in thrown Micrometer ValidationException
See gh-21069
5 years ago
Stephane Nicoll f0fe7060df Polish 5 years ago
Phillip Webb bf41da5322 Update copyright year of changed files 5 years ago
Andy Wilkinson 60a76ce6e7 Polish "Update validation of Micrometer configuration"
See gh-21067
5 years ago
Jon Schneider 95798265b6 Update validation of Micrometer configuration
See gh-21067
5 years ago
Andy Wilkinson 8de0027757 Merge branch '2.2.x'
Closes gh-21062
5 years ago
Andy Wilkinson 3065c88d6f Fix typo in IncludeExcludeEndpointFilter's name
Closes gh-21061
5 years ago
Phillip Webb 49d20aea11 Merge branch '2.2.x'
Closes gh-21047
5 years ago
Phillip Webb df26e24605 Fix ConditionalOnAvailableEndpoint dashed matching
Update `ConditionalOnAvailableEndpoint` so that it now uses the same
matching code as the endpoint filter. This allows the condition to
match endpoint IDs that contain a dash.

In order to share logic, the `ExposeExcludePropertyEndpointFilter` class
has been deprecated and its logic moved to a new `expose` package
under `IncludExcludeEndpointFilter`. This filter is used by both the
`OnAvailableEndpointCondition` and the auto-configuration classes.

Fixes gh-21044
5 years ago
Stephane Nicoll 1eca70a84b Restore Graphite tags behaviour unless configured explicitly
This commit harmonizes how Graphite is configured. If tagsAsPrefix is
set, it is used transparently. Otherwise, the new native tagging system
is used.

See https://github.com/micrometer-metrics/micrometer/pull/2007

Closes gh-20884
5 years ago
Phillip Webb 0ad1ea4352 Merge branch '2.2.x' 5 years ago
Phillip Webb 83553ee504 Fix test checkstyle issues
Fix checkstyle issues from forward merge.

See gh-21022
5 years ago
Phillip Webb 2293cb1a41 Merge branch '2.2.x'
Closes gh-21023
5 years ago
Phillip Webb 5757c0864c Merge branch '2.1.x' into 2.2.x
Closes gh-21022
5 years ago
Phillip Webb 6a4d98a865 Allow exposure patterns to match dashed IDs
Update `ExposeExcludePropertyEndpointFilter` so that patterns will
also match endpoint IDs that contain a dash.

Closes gh-20997
5 years ago
Stephane Nicoll 90c0378a7d Apply configuration properties deprecation consistently
This commit makes sure that both the getter and the setter of a
deprecated configuration properties is flagged with `@Deprecated`.

Closes gh-20812
5 years ago
Phillip Webb e3b8478621 Polish 5 years ago
Scott Frederick f4c2714139 Support server.error config in management context
Prior to this commit, the ManagementErrorEndpoint used to handle error
responses for the management servlet excluded stacktrace and exception
message details from the response unconditionally.

With this commit, the endpoint honors the
`server.error.include-stacktrace` and `server.error.include-details`
properties to conditionally include error details for consistency
with non-management error handling.

Fixes gh-20989
5 years ago
Scott Frederick 70d4994502 Disable exception details on default error views
Prior to this commit, default error responses included the message
from a handled exception. When the exception was a BindException, the
error responses could also include an errors attribute containing the
details of the binding failure. These details could leak information
about the application.

This commit removes the exception message and binding errors detail
from error responses by default, and introduces a
`server.error.include-details` property that can be used to cause
these details to be included in the response.

Fixes gh-20505
5 years ago
Phillip Webb 5311c04437 Change HealthEndpointGroups customization support
Update the `HealthEndpointGroups` customization support to use a
post-processor rather than a mutable registry. Although this approach
is slightly less flexible, it removes a lot of complexity from the
`HealthEndpointGroups` code. Specifically, it allows us to drop the
`HealthEndpointGroupsRegistry` interface entirely.

The probe health groups are now added via the post-processor if they
aren't already defined. Unlike the previous implementation, users are
no longer able to customize status aggregation and http status code
mapping rules _unless_ they also re-define the health indicators that
are members of the group.

See gh-20962
5 years ago
Phillip Webb f32a37e289 Support `management.health.probes.enabled=false`
Update `AvailabilityProbesAutoConfiguration` to allow the
`management.health.probes.enabled` property to override the platform
detection logic. Prior to this commit, it was possible to use the
property to enable the probes, but it was not possible to disable
them when deploying to Kubernates.

See gh-20962
5 years ago
Phillip Webb 82cfd7c6c9 Restructure probes auto-configuration
Relocate probe auto-configuration from the `kubernetes` package to
`availability` since probes could also be used on other platforms.

The classes have also been renamed to named to `AvailabilityProbes...`

See gh-20962
5 years ago
Phillip Webb 71e4801e68 Rename probe health indicators
Rename `LivenessProbeHealthIndicator` to `LivenessStateHealthIndicator`
and `ReadinessProbeHealthIndicator` to `ReadinessStateHealthIndicator`.

Also introduce a general purpose `AvailabilityStateHealthIndicator`
class.

See gh-20962
5 years ago
Phillip Webb bb79c847b2 Allow custom availability states
Create a general purpose `AvailabilityState` interface and refactor
the existing `LivenessState` and `ReadinessState` to use it. A single
`AvailabilityChangeEvent` is now used to carry all availability state
updates.

This commit also renames `ApplicationAvailabilityProvider` to
`ApplicationAvailabilityBean` and extracts an `ApplicationAvailability`
interface that other beans can inject. The helps to hide the event
listener method, which is really internal.

Finally the state enums have been renamed as follows:

 - `LivenessState.LIVE` -> `LivenessState.CORRECT`
 - `ReadinessState.READY` -> `ReadinessState.ACCEPTING_TRAFFIC`
 - `ReadinessState.UNREADY` -> `ReadinessState.REFUSING_TRAFFIC`

See gh-20962
5 years ago
Vedran Pavic fec386b574 Harmonize naming of Elasticsearch auto-configuration classes 5 years ago
Stephane Nicoll 62ebe9c006 Adapt to Wavefront SDK 2.1
Closes gh-20854
5 years ago
Stephane Nicoll d571fb311f Add support for NewRelicClientProvider
Closes gh-20908
5 years ago
Stephane Nicoll 8cc61242e2 Use Micrometer's getDefaultSenderBuilder
This commit removes the duplication added temporarily in Spring Boot to
initialize a default WavefrontSender builder.

This commit also disables a test is failing at the moment, see
https://github.com/micrometer-metrics/micrometer/issues/1964

See gh-20854
5 years ago
Phillip Webb 3ca896e63f Polish 5 years ago
Phillip Webb d9fb4dd477 Don't use monospacing in documentation headings
Closes gh-20875
5 years ago
Stephane Nicoll 6764e5e2d0 Export metrics to Wavefront using WavefrontSender
This commit upgrades the Wavefront metrics export auto-configuration to
provide a `WavefrontSender` if necessary and use that to export metrics
rather than the http client Micrometer used previously.

As a result, the "read-timeout" and "connect-timeout" properties are no
longer honoured.

Closes gh-20810
5 years ago
Stephane Nicoll 9543ab1ca9 Update default value for Wavefront's step size
See gh-20833
5 years ago
Stephane Nicoll a8c026a558 Expose Prometheus#histogramFlavor property
Closes gh-20853
5 years ago
Stephane Nicoll f64f5a0f55 Expose Elastic's pipeline and indexDateSeparator properties
Closes gh-20852
5 years ago
Stephane Nicoll f293f6ad9b Expose AppOptics's floorTimes property
Closes gh-20850
5 years ago
Stephane Nicoll 888a81beba Migrate Kafka metrics to KafkaClientMetrics
Closes gh-20838
5 years ago
Stephane Nicoll 333ac279c3 Stop auto-configuring a StatsdMetrics bean
StatsD no longer publishes metrics about itself and StatsDMetrics is
deprecated as a result. This commit removes the auto-configuration of
it.

Closes gh-20836
5 years ago
Stephane Nicoll 30201a40e0 Update SLA boundaries to use double
See https://github.com/micrometer-metrics/micrometer/pull/1909

Closes gh-20837
5 years ago
Stephane Nicoll 4813606b70 Expose Graphite's graphiteTagsEnabled property
This commit exposes an additional property for Graphite that allows to
restore the previous default behaviour with regards to tags, i.e.
prefixing the ones defined by the "tagsAsPrefix" property.

Close gh-20834
5 years ago
Stephane Nicoll 08533c79e0 Update default value for Datadog's default uri
See gh-20833
5 years ago
Stephane Nicoll 7ca6359b43 Remove PushRegistry's numThreads deprecated property
See gh-20835
5 years ago
Stephane Nicoll a23700f323 Merge branch '2.2.x'
Closes gh-20845
5 years ago
Stephane Nicoll 1960c90d5f Deprecated PushRegistry's numThreads property
This property is a left-over and was never used in Micrometer so this
commit deprecates its use so that it can be removed in the next feature
release.

Closes gh-20835
5 years ago
Stephane Nicoll 72f2afe1f3 Merge branch '2.2.x'
Closes gh-20844
5 years ago
Stephane Nicoll 4641794fb5 Fix AtlasProperties hierarchy
This commit fixes the AtlasProperties hierarchy so that it no longer is
a StepRegistryProperties. The AtlasConfig on the Micrometer side of
things does not share the common config hierarchy either and some
properties have different default and lifecycle.

Closes gh-20843
5 years ago
Stephane Nicoll 2815e6ee2d Remove deprecated Humio's repository property
Closes gh-20808
5 years ago
Andy Wilkinson f238812cea Polish "Improve handling of non-existent path in disk space health check"
See gh-20580
5 years ago
Andreas Born db565cfc3a Improve handling of non-existent path in disk space health check
See gh-20580
5 years ago
Phillip Webb 9a33a723fe Update copyright year of changed files 5 years ago
Phillip Webb 16b5ea3414 Update copyright year of changed files 5 years ago
Brian Clozel 4be64e8f9c Add "management.health.probes.enabled" config property
Prior to this commit, we were relying on the
`"spring.main.cloud-platform"` property for overriding cloud platform
detection and enabling liveness and readiness probes. Changes made in
gh-20553 have now been reverted.

This commit adds the `"management.health.probes.enabled"` configuration
property. The auto-configuration now enables the HTTP Probes and
`HealthIndicator` if this property is enabled, or if the Kubernetes
cloud platform is detected.

This property is `false` by default for now, since enabling this for all
Spring Boot applications would be a breaking change. In this case, the
global `"/actuator/health"` endpoint could report `OUT_OF_SERVICE`
during startup time because the application now reports the readiness as
well.

See gh-19593
5 years ago
Stephane Nicoll 34b71561d3 Merge branch '2.2.x'
Closes gh-20619
5 years ago
Stephane Nicoll 7be3db2d4d Merge branch '2.1.x' into 2.2.x
Closes gh-20618
5 years ago
Stephane Nicoll bcce6f9f07 Document that Jackson is a required dependency of the Actuator
Closes gh-19564
5 years ago
dreis2211 ef9f1d39a3 Remove redundant MockitoAnnotations.initMocks()
See gh-20601
5 years ago
Brian Clozel ffdf9a422f Polish Liveness and Readiness support
This commit moves the core Liveness and Readiness support to its own
`availability` package. We've made this a core concept independent of
Kubernetes.

Spring Boot now produces `LivenessStateChanged` and
`ReadinessStateChanged` events as part of the typical application
lifecycle.

Liveness and Readiness Probes (`HealthIndicator` components and health
groups) are still configured only when deployed on Kubernetes.

This commit also improves the documentation around Probes best practices
and container lifecycle considerations.

See gh-19593
5 years ago
Brian Clozel fd0b2f6695 Add Kubernetes Liveness and Readiness Probes support
Prior to this commit and as of Spring Boot 2.2.0, we would advise
developers to use the Actuator health groups to define custom "liveness"
and "readiness" groups and configure them with subsets of existing
health indicators.

This commit addresses several limitations with that approach.

First, `LivenessState` and `ReadinessState` are promoted to first class
concepts in Spring Boot applications. These states should not only based
on periodic health checks. Applications should be able to track changes
(and adapt their behavior) or update states (when an error happens).

The `ApplicationStateProvider` can be injected and used by applications
components to get the current application state. Components can also
track specific `ApplicationEvent` to be notified of changes, like
`ReadinessStateChangedEvent` and `LivenessStateChangedEvent`.
Components can also publish such events with an
`ApplicationEventPublisher`. Spring Boot will track startup event and
application context state to update the liveness and readiness state of
the application. This infrastructure is available in the
main spring-boot module.

If Spring Boot Actuator is on the classpath, additional
`HealthIndicator` will be contributed to the application:
`"LivenessProveHealthIndicator"` and `"ReadinessProbeHealthIndicator"`.
Also, "liveness" and "readiness" Health groups will be defined if
they're not configured already.

Closes gh-19593
5 years ago
Brian Clozel b680db6cd8 Add HealthEndpointGroupsRegistry and its Customizer
Prior to this commit, `HealthContributor` would be exposed under the
main `HealthEndpoint` and subgroups, `HealthEndpointGroups`. Groups are
driven by configuration properties and there was no way to contribute
programmatically new groups.

This commit introduces the `HealthEndpointGroupsRegistry` (a mutable
version of `HealthEndpointGroups`) and a
`HealthEndpointGroupsRegistryCustomizer`. This allows configurations to
add/remove groups during Actuator auto-configuration.

Closes gh-20554
5 years ago
Andy Wilkinson ef9960c69f Allow additional tags to be contributed to WebMvc and WebFlux defaults
Closes gh-20175
5 years ago
Johnny Lim 8526e66939 Polish
See gh-20498
5 years ago
Stephane Nicoll 2d5a55fb0d Bind ConnectionPool beans that are exposed as ConnectionFactory
This commit relaxes the class condition to ConnectionFactory, checking
if the connection factory is a connection pool and bind its metrics to
the registry accordingly.

Closes gh-20349
5 years ago
Madhura Bhave 7634bfb179 Merge branch '2.2.x'
Closes gh-20340
5 years ago
dreis2211 4eaaf88b2d Remove redundant code
See gh-20339
5 years ago
Madhura Bhave 5bf1f7641b Merge branch '2.2.x' 5 years ago
Madhura Bhave ea8f2a7276 Fix tests following changes to EndpointRequest
See gh-20329
5 years ago