Commit Graph

1252 Commits

Author SHA1 Message Date
dreis2211 7a49651e09 Remove management.health.status.order from docs
See gh-18170
2019-09-09 14:13:04 +02:00
Stephane Nicoll 14a676052f Polish
This commit moves `@ConfigurationProperties` to the `@Bean` factory
method as this is unusual to put it at class level if it's exposed
that way.

As HealthIndicatorProperties has a constructor, this makes sure that
the annotation processor enables JavaBean binding mode.
2019-09-09 13:37:54 +02:00
Andy Wilkinson 0c0e2dd54b Merge branch '2.1.x'
Closes gh-18186
2019-09-09 11:16:30 +01:00
Andy Wilkinson 674d3dd262 Polish health endpoint documentation for groups and nesting
Closes gh-14022
2019-09-09 11:02:39 +01:00
Andy Wilkinson 7b1e10ed00 Use one sentence per line in Actuator and Gradle plugin doc source
Closes gh-18185
2019-09-09 10:59:49 +01:00
freekry e1611287c8 Simplify some code
See gh-18077
2019-09-01 09:05:53 +02:00
Phillip Webb cbcfd9de6f Merge branch '2.1.x' 2019-08-30 16:28:03 -07:00
Phillip Webb db26d9dc91 Fix EndpointRequest ignore logic
Fixup ignore logic in `EndpointRequest`.

See gh-18012
2019-08-30 16:25:07 -07:00
Phillip Webb 1283bc05d7 Merge branch '2.1.x'
Closes gh-18021
2019-08-30 14:41:36 -07:00
Phillip Webb 5938ca78b6 Fix request matcher management context support
Fix caching issues in `ApplicationContextRequestMatcher` and allow
subclasses to ignore an application context entirely. Update existing
matcher implementations so that they deal with the management context
correctly.

Prior to this commit, the `ApplicationContextRequestMatcher` would
return a context cached from the first request. It also didn't
provide any way to ignore a context. This meant that if the user was
running the management server on a different port the matching results
could be inconsistent depending on if the first request arrived on
the regular context or the management context. It also meant that we
could not distinguish between the regular context and the management
context when matching.

Closes gh-18012
2019-08-30 14:36:16 -07:00
Madhura Bhave 2726540e76 Merge branch '2.1.x'
Closes gh-17980
2019-08-28 13:13:48 +05:30
Madhura Bhave 674f2f5a6c EndpointRequest should match @ServletEndpoint
This commit also changes the request matcher for MVC
endpoints to use an AntPathRequestMatcher instead of an
MvcRequestMatcher. The endpoint is always available
under the mapped endpoint path and this way the same matcher
can be used for both MVC and Jersey.

Fixes gh-17912

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-08-28 11:48:53 +05:30
Phillip Webb fb846f434f Merge branch '2.1.x'
Fixes gh-17959
2019-08-25 21:37:07 -07:00
Phillip Webb 4c446c38a6 Only add management error page for Spring MVC
Move management `ErrorPage` registration from the
`WebMvcEndpointChildContextConfiguration` to
`WebMvcEndpointChildContextConfiguration` and only add it when the
error controller is registered.

Fixes gh-17938
2019-08-25 21:34:25 -07:00
Stephane Nicoll 52bcdac7b0 Polish 2019-08-23 13:44:24 +02:00
Andy Wilkinson b43827d626 Configure ping (formerly application) health indicator by default
This commit renames ApplicationHealthIndicator to PingHealthIndicator
and changes the auto-configuration so that it is now always configured
by default.

Closes gh-17926
2019-08-22 14:50:10 +01:00
Phillip Webb e03f822c6d Add support for health indicator groups
Update the `HealthEndpoint` to support health groups. The
`HealthEndpointSettings` interface has been replaced with
`HealthEndpointGroups` which provides access to the primary group
as well as an optional set of additional groups.

Groups can be configured via properties and may have custom
`StatusAggregator` and `HttpCodeStatusMapper` settings.

Closes gh-14022

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-08-21 18:43:25 -07:00
Phillip Webb f09e0264d9 Migrate HealthIndicator auto-configurations
Migrate all `HealthIndicator` configuration to `HealthContributor`
configurations instead.

See gh-14022
2019-08-21 18:43:25 -07:00
Phillip Webb 3c535e0de3 Add HealthContributor and refactor HealthEndpoint
Overhaul `HealthEndpoint` support to make it easier to support health
groups. Prior to this commit the `HealthIndicator` interface was used
for both regular indicators and composite indicators. In addition the
`Health` result was used to both represent individual, system and
composite health. This design unfortunately means that all health
contributors need to be aware of the `HealthAggregator` and could not
easily support heath groups if per-group aggregation is required.

This commit reworks many aspects of the health support in order to
provide a cleaner separation between a `HealthIndicator`and a
composite. The following changes have been made:

- A `HealthContributor` interface has been introduced to represent
  the general concept of something that contributes health information.
  A contributor can either be a `HealthIndicator` or a
  `CompositeHealthContributor`.

- A `HealthComponent` class has been introduced to mirror the
  contributor arrangement. The component can be either
  `CompositeHealth` or `Health`.

- The `HealthAggregator` interface has been replaced with a more
  focused `StatusAggregator` interface which only deals with `Status`
  results.

- `CompositeHealthIndicator` has been replaced with
  `CompositeHealthContributor` which only provides access to other
  contributors. A composite can no longer directly return `Health`.

- `HealthIndicatorRegistry` has been replaced with
  `HealthContributorRegistry` and the default implementation now
  uses a copy-on-write strategy.

- `HealthEndpoint`, `HealthEndpointWebExtension` and
  `ReactiveHealthEndpointWebExtension` now extend a common
  `HealthEndpointSupport` class. They are now driven by a
  health contributor registry and `HealthEndpointSettings`.

- The `HealthStatusHttpMapper` class has been replaced by a
  `HttpCodeStatusMapper` interface.

- The `HealthWebEndpointResponseMapper` class has been replaced
  by a `HealthEndpointSettings` strategy. This allows us to move
  role related logic and `ShowDetails` to the auto-configure module.

- `SimpleHttpCodeStatusMapper` and `SimpleStatusAggregator`
  implementations have been added which are configured via constructor
  arguments rather than setters.

- Endpoint auto-configuration has been reworked and the
  `CompositeHealthIndicatorConfiguration` class has been replaced
  by `CompositeHealthContributorConfiguration`.

- The endpoint JSON has been changed make `details` distinct from
  `components`.

See gh-17926
2019-08-21 18:43:25 -07:00
Madhura Bhave 55c6ee71c1 Include logger group with configuredLevel in docs
Closes gh-17772
2019-08-20 22:48:26 -07:00
Andy Wilkinson f916e1a1ce Document response structure for retrieving a logger group
Closes gh-17909
2019-08-19 14:18:41 +01:00
lijuny 200de49c11 Replace Collection#addAll to call constructor
See gh-17847
2019-08-14 08:42:13 +02:00
Stephane Nicoll 2784fc1506 Merge branch '2.1.x'
Closes gh-17764
2019-08-02 13:57:22 +02:00
Stephane Nicoll 308a5e9360 Fix bean name for reactive Cassandra health indicator
Closes gh-17763
2019-08-02 13:56:16 +02:00
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
2019-07-31 15:11:43 +01:00
Madhura Bhave b444c3c545 Fix asciidoc section ids 2019-07-30 16:28:59 -07:00
Madhura Bhave 61b86ff231 Polish "Add support for configuring logging groups"
See gh-17515

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-07-30 11:28:58 -07:00
HaiTao Zhang b9047c22e0 Add support for configuring logging groups via endpoint
See gh-17515
2019-07-30 11:13:07 -07:00
Stephane Nicoll b405f8ecf2 Introduce PushRegistry abstraction
This commit introduces a separate layer between PushRegistry and
StepRegistry-based implementations.

See gh-17699
2019-07-30 17:39:47 +02:00
dreis2211 8d2f2b75bd Upgrade to AssertJ 3.13.1
See gh-17690
2019-07-30 09:48:33 +02:00
Phillip Webb 3b28b1cade Don't use static final security matcher
Using static final matchers breaks the build because they have state
that's not reset across tests.

See gh-17525
2019-07-29 12:13:31 +01:00
Phillip Webb 6675f49334 Switch to multi-line security configuration
Now that we have lambda style security configuration we can further
improve readability by switching to one statement per line.

See gh-17525
2019-07-29 11:28:51 +01:00
Madhura Bhave 39a7b9da38 Switch to lambda style security configuration
Closes gh-17525
2019-07-26 14:41:49 -07:00
Phillip Webb 8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Stephane Nicoll 94c35ae1de Polish "Make Actuator dedicated ConversionService configurable"
See gh-16449
2019-07-23 12:27:00 +02:00
chao.chang 2aea437536 Make Actuator dedicated ConversionService configurable
See gh-16449
2019-07-23 11:16:27 +02:00
Stephane Nicoll be988d7072 Polish "Add HealthIndicator for Hazelcast"
See gh-17499
2019-07-18 15:00:53 +02:00
Dmytro Nosan fca5a2b824 Add HealthIndicator for Hazelcast
See gh-17499
2019-07-18 14:58:18 +02:00
Andy Wilkinson 3bf5cf1124 Merge branch '2.1.x'
Closes gh-17562
2019-07-18 07:22:24 +01:00
Andy Wilkinson b725c60177 Deprecate DeploymentInfo customization with reactive Undertow
Fixes gh-17555
2019-07-18 06:54:38 +01:00
Phillip Webb d567261790 Polish 2019-07-17 21:38:44 +01:00
Phillip Webb eff1147ccc Rename classpath runner package
Remove `runner` since we're no longer tied to JUnit 4.

See gh-17491
2019-07-15 13:40:26 +01:00
Phillip Webb 1117fdb2b3 Make ModifiedClassPathExtension package private
Meta-annotate `ClassPathExclusions` and `ClassPathOverrides` with
so that the `ModifiedClassPathExtension` no longer needs to be
used directly.

See gh-17491
2019-07-15 13:38:26 +01:00
dreis2211 0f0278e69b Migrate ModifiedClassPath tests to JUnit 5
Migrate the remaining JUnit 4 tests to JUnit 5, making use of the
new `ModifiedClassPathExtension`.

See gh-17491
2019-07-15 00:31:03 +01:00
Phillip Webb 0cb6a7f47d Polish 2019-07-15 00:24:19 +01:00
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb c3816bfe7b Polish output capture names 2019-07-15 00:24:18 +01:00
Madhura Bhave d590c3ed10 Merge branch '2.1.x'
Closes gh-17486
2019-07-10 15:32:22 -07:00
Madhura Bhave 773dda3d55 Log file location should be evaluated just once
Using a random value for the logfile name caused
the logfile endpoint to return a 404 as the name
was resolved from the environment on every request.
This commit registers a bean for LogFile which is then
used by the logfile endpoint.

Fixes gh-17434
2019-07-10 14:46:09 -07:00
dreis2211 25586a2e23 Use Assertions.contentOf() where possible
See gh-17444
2019-07-10 06:40:52 +01:00
Andy Wilkinson 2816635418 Polish 2019-07-04 17:51:20 +01:00
Madhura Bhave 39b15af5d6 Polish "Provide links / when using a separate management port"
See gh-17418
2019-07-03 16:19:40 -07:00
HaiTao Zhang c108629311 Provide links for actuators at / when using a separate management port
See gh-17418
2019-07-03 16:19:40 -07:00
Andy Wilkinson c5cae28261 Add support for plain text thread dumps to the threaddump endpoint
When a request that accepts text/plain is received, the threaddump
endpoint will now return a thread dump in plain text. The format of
this text is modelled after the output produced by JVisualVM when
connecting to a remote process over JMX. Note that this output does
not include all of the information in, for example, JStack's output
as it is not available via Java 8's ThreadInfo API.

Rather than the custom formatting logic, using ThreadInfo's toString()
method was considered but its output is documented as being undefined
and implementation specific. The implementation used while developing
this feature produced output that did not match that of JStack or
JVisualVM and truncated stack traces quite considerably.

At the time of writing the format produced by the endpoint could be
consumed by both Thread Dump Analyzer [1] and https://fastthread.io.

Closes gh-2339

[1] https://github.com/irockel/tda
2019-07-03 21:51:56 +01:00
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Andy Wilkinson 0b8247bd62 Merge branch '2.1.x'
Closes gh-17408
2019-07-02 14:11:23 +01:00
Andy Wilkinson e57579461a Prevent endpoint's shutdown() method from being a destroy method
Closes gh-17407
2019-07-02 14:05:49 +01:00
Phillip Webb fcbcc9d309 Merge branch '2.1.x'
Closes gh-17387
2019-07-01 11:04:54 -07:00
Phillip Webb a81f37dd68 Escape '{reference}' elements in asciidoc files
Escape lines that look like variable references but should actually be
included verbatim.

Closes gh-17386
2019-07-01 11:02:05 -07:00
Phillip Webb 605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Phillip Webb c62b6b4ccd Merge branch '2.1.x' 2019-06-28 12:22:45 -07:00
Phillip Webb de35efd1ef Merge branch '2.0.x' into 2.1.x 2019-06-28 12:21:57 -07:00
Phillip Webb bb34846630 Merge branch '1.5.x' into 2.0.x 2019-06-28 12:19:46 -07:00
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
Stephane Nicoll 403d868611 Polish "Use constants for HTTP headers"
See gh-17199
2019-06-21 16:20:46 +02:00
Johnny Lim a57df0f595 Use constants for HTTP headers
See gh-17199
2019-06-21 15:58:34 +02:00
Stephane Nicoll 9eb2650c0f Merge branch '2.1.x' 2019-06-21 09:09:49 +02:00
Stephane Nicoll 86ace26049 Fix broken link to Spring Integration reference guide
Closes gh-17279
2019-06-21 09:09:01 +02:00
Stephane Nicoll 45d2f1d7d1 Merge branch '2.1.x'
Closes gh-17269
2019-06-19 15:31:50 +02:00
Stephane Nicoll 7e5ca6d280 Merge branch '2.0.x' into 2.1.x
Closes gh-17268
2019-06-19 15:30:13 +02:00
Stephane Nicoll 11dee3c0d8 Merge branch '1.5.x' into 2.0.x 2019-06-19 15:27:49 +02:00
Andy Wilkinson cffc870fd6 Fix test failures on Windows
Since the move to JUnit 5, a number of tests were failing on Windows.
The majority were failing due to open file handles preventing the
clean up of the tests' temporary directory. This commit addresses
these failures by updating the tests to close JarFiles, InputStreams,
OutputStreams etc.

A change has also been made to CachingOperationInvokerTests to make
a flakey test more robust. Due to System.currentTimeMillis() being
less precise on Windows than it is on *nix platforms, the test could
fail as it would not sleep for long enough for the TTL period to have
expired.
2019-06-13 09:24:31 +01:00
Stephane Nicoll 46c2da4a19 Polish "Use existing properties field"
See gh-17129
2019-06-13 09:54:51 +02:00
Ingyu Hwang 725cbd9bc8 Use existing properties field
See gh-17129
2019-06-13 09:54:31 +02:00
Phillip Webb 266d6334b2 Fix checkstyle RedundantModifier test violations 2019-06-07 20:46:33 -07:00
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 2019-06-07 12:25:54 +01:00
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
2019-06-07 11:00:44 +01:00
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
2019-06-07 10:50:34 +01:00
Andy Wilkinson c6c139d980 Merge branch '1.5.x' into 2.0.x 2019-06-07 10:46:31 +01:00
Phillip Webb d306b31ce9 Merge branch '2.1.x' 2019-06-04 02:08:00 -07:00
Phillip Webb ccfbd03482 Merge branch '2.0.x' into 2.1.x 2019-06-04 02:07:14 -07:00
Phillip Webb b442d3b906 Merge branch '1.5.x' into 2.0.x 2019-06-04 01:49:03 -07:00
Phillip Webb 14349518c9 Polish "Avoid using deprecated NCSARequestLog"
See gh-16987
2019-06-02 15:04:59 -07:00
dreis2211 4af3badbea Avoid using deprecated NCSARequestLog
See gh-16987
2019-06-02 10:52:16 -07:00
Andy Wilkinson 0644a79401 Repackage output capture and always use extension declaratively
Closes gh-17029
2019-05-31 18:33:10 +01:00
Phillip Webb d11d5ceb29 Split up JUnit 5 OutputCapture class
Split the JUnit 5 `OutputCapture` class into separate `OutputExtension`
and `CapturedOutput` classes. The JUnit 5 callback methods are now
contained only in the `OutputExtension` class so no longer pollute the
public API that users will interact with.

The `CapturedOutput` class has also been updated to capture System.err
and System.out separately to allow distinct assertions if required.

Closes gh-17029
2019-05-30 23:44:35 -07:00
Phillip Webb 68a3fbd7a0 Extract AutoTimer interface for metrics
Refactor `Autotime` from a properties object to an interface and
change the existing metric recording implementations. The `AutoTimer`
interface is a general purpose callback that can be applied to a
`Timer.Builder` to configure it. Autotime properties are now located
in `spring-boot-actuator-autoconfigure` and have become an
implementation of the interface.

Closes gh-17026
2019-05-30 16:03:34 -07:00
Phillip Webb 68aec8b6ee Polish 2019-05-30 11:30:27 -07:00
Andy Wilkinson b603cd5d4b Disable Tomcat's MBean Registry by default
Closes gh-16498
2019-05-28 15:21:31 +01:00
Andy Wilkinson 080a2f5c3b Align with Framework’s removal of charset attribute from application/json
Closes gh-16979
2019-05-28 10:58:23 +01:00
dreis2211 27ca7e17d9 Fix deprecated StandardAnnotationMetadata usages
Closes gh-16930
2019-05-22 14:05:15 +02:00
Stephane Nicoll 26df55761d Merge enablement and exposure conditions for Actuator endpoints
This commit merges the conditions for determining if an endpoint is
available in a single condition, deprecating
`ConditionalOnEnabledEndpoint` in the process.

Closes gh-16169
2019-05-20 13:52:59 +02:00
Johnny Lim 4900117c71 Restore HttpTraceAutoConfigurationTests.configuresServletFilter()
Closes gh-16885
2019-05-20 08:47:30 +02:00
Phillip Webb 3a9ca5fa30 Update copyright header of changed files 2019-05-14 21:05:53 -07:00
Phillip Webb 79e05c770f Merge branch '2.1.x' 2019-05-14 21:05:05 -07:00
Phillip Webb ed998ef0d3 Update copyright header of changed files 2019-05-14 21:04:50 -07:00
Stephane Nicoll 4d8df3cc47 Polish "Allow configuration of auto-timed metrics"
This commit makes sure the "auto-time-requests" property is still
available in a deprecated fashion.

See gh-15988
2019-05-14 11:20:59 +02:00
Madhura Bhave 1db1c8b03c Validate our own tests work with JUnit5 and the vintage engine
Closes gh-14737

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-05-08 16:05:44 +02:00
Madhura Bhave 07d6eb6397 Disable auditing infrastructure by default
Prior to this commit, the audit auto-configuration provided
an `InMemoryAuditEventRepository` bean. This commit changes the auto-config
so that an `AuditEventRepository` is not provided and instead the auto-config
is conditional on the presence of a `AuditEventRepository` bean. This is done
to encourage the use of a custom implementation of `AuditEventRepository`
since the in-memory one is quite limited and not suitable for production.
A flag is available if the auto-configuration needs to be turned off even
in the presence of a bean.

Closes gh-16110
2019-05-03 13:48:29 -07:00
Madhura Bhave e2b15c3f2a Fix tests
See gh-15039
2019-05-03 12:32:06 -07:00
Madhura Bhave de128fed20 Disable HttpTrace infrastructure by default
Prior to this commit, the http trace auto-configuration provided
an `InMemoryHttpTraceRepository` bean. This commit changes the auto-config
so that an `HttpTraceRepository` is not provided and instead the auto-config
is conditional on the presence of a `HttpTraceRepository` bean. This is done
to encourage the use of a custom implementation of `HttpTraceRepository`
since the in-memory one is quite limited and not suitable for production.
A flag is available if the auto-configuration needs to be turned off even
in the presence of a bean.

Closes gh-15039
2019-05-03 12:00:37 -07:00
Madhura Bhave cc99b13ecb Merge branch '2.1.x' 2019-05-01 10:26:31 -07:00
Madhura Bhave c9752f165f Fix javadoc 2019-05-01 10:23:52 -07:00
Stephane Nicoll 8045bf1f50 Polish "Allow configuration of auto-timed metrics"
Closes gh-15988
2019-05-01 08:17:06 +02:00
Tadaya Tsuyukubo 4df6f5dee0 Allow configuration of auto-timed metrics
When `management.metrics.web.server.auto-time-requests` is enabled
(default=true), Spring Boot collects metrics on controller methods even
when they are not annotated with `@Timed`.

When this happens, created metrics are based on the default
`@Timed` configuration and there is no way to customize the
configuration of those auto-timed controller metrics.

This commit adds default configurations to auto-timed requests on both
client and server sides.

See gh-15988
2019-05-01 08:16:42 +02:00
Phillip Webb 17aaf26590 Use consistent javadoc style for annotation links
Closes gh-13920
2019-04-24 19:37:59 -07:00
Phillip Webb 1e44aba772 Fix compiler warnings and polish
Fix various compiler warnings and apply a little polish.
2019-04-24 19:37:42 -07:00
Andy Wilkinson 4754386361 Merge branch '2.1.x'
Closes gh-16644
2019-04-24 15:09:41 +01:00
Andy Wilkinson 6b20d13b3d Polish "Prevent double update of metrics when CompositeMeterRegistry exists"
See gh-16221
2019-04-24 15:02:58 +01:00
Johnny Lim cc285d92dd Prevent double update of metrics when CompositeMeterRegistry exists
See gh-16221
2019-04-24 14:54:30 +01:00
Phillip Webb b879972d0d Migrate to MergedAnnotations API
Migrate away from `AnnotationUtils` and `AnnotatedElementUtils`
when possible to the new `MergedAnnotations` API.

Closes gh-16551
2019-04-18 15:40:02 -07:00
Phillip Webb 2dfd916c96 Polish 2019-04-15 17:51:08 -07:00
Vedran Pavic bbaa98175f Upgrade to Hazelcast 3.12
Closes gh-16503
2019-04-11 12:38:47 +02:00
Stephane Nicoll f42b6199ae Polish 2019-04-09 12:21:28 +02:00
Stephane Nicoll a828072132 Migrate tests to use withBean
See gh-16011
2019-04-09 12:15:05 +02:00
Stephane Nicoll 84735f58f3 Fix build failure 2019-04-06 18:00:13 +02:00
Madhura Bhave ce0282406f Skip lazy init for beans that explicitly set lazy to false
This commit also adds tests to ensure that the child
management context works when lazy initialization is
enabled. Also, it adds a BeanFactoryPostProcessor to
the child context so that the server is created and
listening for requests but other beans in the child
context are not created until requested.

See gh-16184
2019-04-05 18:02:26 -07:00
Andy Wilkinson ff1e5076dc Merge branch '2.1.x'
Closes gh-16473
2019-04-05 17:37:24 +01:00
Andy Wilkinson c0a91478f1 Only start management server once main server is initialized
Closes gh-15378
2019-04-05 17:36:20 +01:00
Stephane Nicoll c432288ed1 Migrate ApplicationContext to common hierarchy
This commit migrates `AnnotationConfigReactiveWebApplicationContext`
parent to the `GenericApplicationContext` abstraction. Any use of
`AnnotationConfigWebApplicationContext` is also removed as it also
inherits from the `AbstractRefreshableApplicationContext` outdated
hierarchy.

A new `AnnotationConfigServletWebApplicationContext` context is
introduced instead, extending from `GenericApplicationContext` and
providing the counter part of the reactive context for the Servlet-based
web app tests.

See gh-16096
2019-04-05 14:17:41 +02:00
Phillip Webb ad7eebee9e Merge branch '2.1.x' 2019-04-03 17:00:25 -07:00
Phillip Webb f12ab1ff90 Update copyright header of changed files 2019-04-03 16:13:00 -07:00
Phillip Webb 34fee1adfa Polish 2019-04-03 16:12:37 -07:00
Andy Wilkinson c5c53849ce Merge branch '2.1.x' 2019-04-03 14:41:15 +01:00
Andy Wilkinson ca0119950f Align with new fail-fast behaviour in Micrometer 1.1.4
Closes gh-16425
2019-04-03 14:39:29 +01:00
Phillip Webb 2376f973f4 Merge branch '2.1.x' 2019-04-02 13:46:36 -07:00
Phillip Webb 47c6bf741d Merge branch '2.0.x' into 2.1.x 2019-04-02 13:40:21 -07:00
Phillip Webb 07c000c5b7 Merge branch '1.5.x' into 2.0.x 2019-04-02 13:34:28 -07:00
Andy Wilkinson e1a6726d76 Polish "Update CORS handling according to Framework changes"
See gh-16410
2019-04-02 12:48:00 +01:00
Sebastien Deleuze 2f9db7eec6 Update CORS handling according to Framework changes
This commit updates CORS handling according to Framework changes
introduced via [1]. It also fixes tests according to the new behavior.

See gh-16410

[1] d27b5d0ab6.
2019-04-02 12:47:07 +01:00
Stephane Nicoll f4c4b1d3f0 Polish "Permit use of https for configuring Prometheus push gateway"
Closes gh-16084
2019-03-29 17:03:28 +01:00
Dmytro Nosan eed4e9ea56 Permit use of https for configuring Prometheus push gateway
See gh-16084
2019-03-29 16:48:27 +01:00
simionAndrei 26cfbe04b2 Add Spring-specific styling to Actuator's API documentation
This commit replaces the default Asciidoctor styling with
Spring specific styling.

First, we need to unzip the contents of the Spring Asciidoctor
documentation resources provided by the
`io.spring.docsresources:spring-docs-resources` distribution zip. This
is done in a `/target/refdocs` folder. We then copy all files from
`src/main/asciidoc` to the same location, and then launch the generation
process.

See gh-16326
2019-03-29 15:35:45 +01:00
Spring Operator fb242c27d2 Use HTTPS for external links wherever possible
See gh-16276
2019-03-28 12:07:01 +00:00
Andy Wilkinson 878a635bfb Merge branch '2.1.x' 2019-03-28 11:48:47 +00:00
Spring Operator 9fc3ac7d49 Use HTTPS for external links wherever possible
See gh-16320
2019-03-28 09:49:30 +00:00
Andy Wilkinson 864942ad4f Merge branch '2.0.x' into 2.1.x 2019-03-28 09:35:53 +00:00
Spring Operator 1a4c6f2dac Use HTTPS for external links wherever possible
See gh-16319
2019-03-27 20:06:52 +00:00
Andy Wilkinson ba4671f0ab Merge branch '1.5.x' into 2.0.x 2019-03-27 19:59:36 +00:00
Stephane Nicoll b055410ab4 Fix outdated tests
Closes gh-16298
2019-03-25 11:58:09 +01:00
Valery_Yalauchuk c880e10c41 Fix LogFile conditions to check for exposure as well
Closes gh-16298
2019-03-25 11:34:32 +01:00
Stephane Nicoll 76ca467d92 Merge branch '2.1.x' 2019-03-25 11:31:24 +01:00
Stephane Nicoll bd2cc6f48b Add missing condition on LogFile endpoint
See gh-16298
2019-03-25 11:30:45 +01:00
Andy Wilkinson 36c1c051b8 Merge branch '2.1.x' 2019-03-20 16:55:10 +00:00
Andy Wilkinson e23f72c8b0 Merge branch '2.0.x' into 2.1.x 2019-03-20 16:53:48 +00:00
Andy Wilkinson 9fbd38ab3c Merge branch '1.5.x' into 2.0.x 2019-03-20 16:45:26 +00:00
Madhura Bhave 3d0219c315 Merge branch '2.1.x' 2019-03-15 18:09:47 -07:00
Johnny Lim c5b5f752ed Polish
Closes gh-16219
2019-03-15 17:54:48 -07:00
Stephane Nicoll c115ee1550 Fix build failure 2019-03-14 19:34:19 +01:00
Stephane Nicoll 0e0ea7f00a Fix checkstyle violation 2019-03-14 13:22:43 +01:00
Stephane Nicoll fcdc414646 Remove use of `@Autowired` for configuration properties bean
See gh-8762
2019-03-14 11:03:10 +01:00
Madhura Bhave 223f2be7d2 Inject InfoContributors instead of exposing them on InfoEndpoint
Closes gh-13586
2019-03-13 13:16:47 -07:00
Stephane Nicoll 81def1f21d Polish 2019-03-13 08:25:39 +01:00
Madhura Bhave e8cb75bba8 Enable git remote linking automatically on CF
Closes gh-13586
2019-03-12 17:30:00 -07:00
Andy Wilkinson 68bfb020aa Reduce need for bean method proxying and disable where not needed
Closes gh-9068
2019-03-12 13:18:42 +00:00
Andy Wilkinson 4b98fa7d94 Alias proxyBeanMethods on annotations meta-annotated with @Configuration
Closes gh-16201
2019-03-12 09:24:20 +00:00
Phillip Webb 64a2e8d67f Update copyright year for changed files 2019-03-11 22:15:36 -07:00
Phillip Webb dd3e8154d9 Merge branch '2.1.x' 2019-03-11 22:15:19 -07:00
Phillip Webb fc3aa43cc2 Update copyright year for changed files 2019-03-11 22:14:53 -07:00
Phillip Webb f02887b6c6 Merge branch '2.0.x' into 2.1.x 2019-03-11 22:14:21 -07:00
Phillip Webb 9c3af103e0 Fix ScheduledTasksEndpointAutoConfigurationTests
Update the `CustomEndpointConfiguration` class in
`ScheduledTasksEndpointAutoConfigurationTests` to be package private
so that it can be enhanced by cglib.

Prior to merge commit 361437f4 the class was a lite configuration so
it didn't matter that it was a private class.
2019-03-11 22:12:36 -07:00
Andy Wilkinson aa2008bc5a Merge branch '2.1.x' 2019-03-11 16:40:19 +00:00
Andy Wilkinson 8c3cec8f13 Merge branch '2.0.x' into 2.1.x 2019-03-11 16:14:19 +00:00
Andy Wilkinson 361437f4e2 Merge branch '1.5.x' into 2.0.x 2019-03-11 15:53:34 +00:00
Stephane Nicoll 430571b37b Perform binding at creation time if possible
Previously, environment binding always happened in a post processor once
the bean has been created. Constructor binding requires to perform the
binding at creating time so this commit performs binding at creation
time if possible.

When this happens, a special `ConfigurationPropertiesBeanDefinition` is
created with a supplier that invokes the binder. To avoid a case where
a bean is processed twice, the post-processor now ignores any bean that
has already been bound to the environment.

Closes gh-8762

Co-authored-by: Madhura Bhave <mbhave@pivotal.io>
2019-03-08 15:50:44 +01:00
Brian Clozel 8325fce53e Fix formatting 2019-03-07 21:02:41 +01:00
Brian Clozel 6586bae889 Guard Endpoint bean declarations with ConditionalOnExposedEndpoint
This commit adds the newly introduced `@ConditionalOnExposedEndpoint`
conditional annotation to all auto-configured `Endpoint` in Actuator.

With that change, `EndPoint` instances and related infrastructure will
only be created when they are meant to be exposed and used. This will
save CPU and memory resources when Actuator is present.

Closes gh-16093
2019-03-07 20:13:44 +01:00
Brian Clozel 4ffbe6c9e8 Add @ConditionalOnExposedEndpoint condition
Prior to this commit, Actuator `Endpoint` instantiations would be
guarded by `@ConditionalOnEnabledEnpoint` condition annotations. This
feature saves resources as disabled endpoints aren't unnecessarily
instantiated.

By default, only `"health"` and `"info"` endpoints are exposed over the
web and all endpoints are exposed over JMX.

As of gh-16090, JMX is now disabled by default. This is an opportunity
to avoid instantiating endpoints if they won't be exposed at all, which
is more likely due to the exposure defaults.

This commit adds a new `@ConditionalOnExposedEndpoint` conditional
annotation that checks the `Environment` for configuration properties
under `"management.endpoints.web.exposure.*"` and
`"management.endpoints.jmx.exposure.*"`. In the case of JMX, an
additional check is perfomed, checking that JMX is enabled first.
The rules implemented in the condition itself are following the ones
described in `ExposeExcludePropertyEndpointFilter`.

See gh-16093
2019-03-07 20:05:23 +01:00
Brian Clozel ce9626d00f Disable JMX by default
This commit switches the default value for the `spring.jmx.enabled`
configuration property.
JMX is now disabled by default and can be enabled with
`spring.jmx.enabled=true`.

Closes gh-16090
2019-03-05 18:51:00 +01:00
Stephane Nicoll 715db153e3 Polish "Remove code deprecated in 2.1"
Closes gh-16013
2019-02-27 11:15:48 +01:00
Stephane Nicoll 7b0004d6c3 Fix formatting 2019-02-21 14:17:34 +01:00
Andy Wilkinson f2e3e274a8 Merge branch '2.1.x' 2019-02-21 08:19:43 +00:00
Andy Wilkinson 53326695ea Polish 2019-02-21 08:13:54 +00:00
Madhura Bhave 6f045d8891 Merge branch '2.1.x' 2019-02-20 16:13:20 -08:00
Madhura Bhave c3e47541ad EndpointRequest should check that the request is to the mgmt context
Fixes gh-15702
2019-02-20 16:08:26 -08:00
Andy Wilkinson de0c065625 Inject single-use configuration dependencies into bean methods
Closes gh-15751
2019-02-20 17:02:43 +00:00
Andy Wilkinson e6764bdc5a Merge branch '2.1.x' 2019-02-19 09:39:38 +00:00
Andy Wilkinson 55426208ab Provide type information for optional thread dump endpoint response fields
Closes gh-15989
2019-02-19 09:12:54 +00:00
Madhura Bhave 862ffcbbf4 Merge branch '2.1.x' 2019-02-13 13:33:14 -08:00
Madhura Bhave bbe555a4f5 Split Jersey management context configuration
This commit splits the management context configuration for jersey
into two separate configurations depending on if the type is SAME or
CHILD. The configuration for the SAME context should only kick in if
there is no existing ResourceConfig bean.

Fixes gh-15891
2019-02-13 13:27:54 -08:00
Andy Wilkinson 22192c2b5c Polish "Make auto-config of RestTemplate metrics back off with no builder bean"
Closes gh-15842
2019-02-12 14:35:38 +00:00
Raheela 8f3c4dbc64 Make auto-config of RestTemplate metrics back off with no builder bean
See gh-15842
2019-02-12 14:28:48 +00:00
Madhura Bhave 4d69e127c8 Merge branch '2.1.x' 2019-02-08 18:38:21 -08:00
Madhura Bhave 26da45aa9a Configure a JerseyApplicationPath bean for the actuators
This commit also ensures that Jersey-based actuator endpoints are
available before the user has configured a `ResourceConfig` bean

Fixes gh-15625
Fixes gh-15877
2019-02-08 18:38:01 -08:00
Stephane Nicoll 380d7ec01c Merge branch '2.1.x' 2019-02-08 09:21:06 +01:00
Johnny Lim 885c28891b Polish
Closes gh-15873
2019-02-08 09:20:15 +01:00
Andy Wilkinson ecb7e240eb Merge branch '2.1.x' 2019-02-05 12:33:19 +00:00
Andy Wilkinson 59c66eaf41 Correct documented path for locked synchronizer's identity hashcode
Closes gh-15847
2019-02-05 12:30:46 +00:00
Andy Wilkinson ebcc53a9b7 Include tasks with custom triggers in scheduledtasks endpoint output
Closes gh-15815
2019-02-05 12:12:07 +00:00
Stephane Nicoll 002fa405a8 Merge branch '2.1.x' 2019-01-31 16:26:37 +01:00
Stephane Nicoll ede23caace Polish "Inject Map directly rather than via ObjectProvider"
Closes gh-15798
2019-01-31 16:25:18 +01:00
ayudovin 3a2e85ce75 Inject Map directly rather than via ObjectProvider
See gh-15798
2019-01-31 16:24:18 +01:00
Andy Wilkinson f23a0a5969 Inject InfoContributorProperties more precisely
Closes gh-15750
2019-01-21 16:56:39 +00:00
Stephane Nicoll 6baa6b291e Polish contribution
Closes gh-15695
2019-01-14 08:11:20 -05:00
Johnny Lim af3ed9ff9f Polish
See gh-15695
2019-01-14 08:09:32 -05:00
Phillip Webb 2f77ef7722 Merge branch '2.1.x' 2019-01-11 16:45:05 -08:00
Phillip Webb 9e58942698 Update copyright year for changed files 2019-01-11 16:42:02 -08:00
Phillip Webb 6a901199f5 Polish 2019-01-11 16:42:02 -08:00
Stephane Nicoll 5e736c0d1f Merge branch '2.1.x' 2019-01-07 13:46:23 +01:00
Stephane Nicoll 6ad01a6dfc Optimize ConditionalOnEnabledEndpoint usage
Closes gh-15451
2019-01-07 13:45:53 +01:00
Stephane Nicoll 2d2aa96c05 Allow ConditionalOnEnabledEndpoint to be set at class level
See gh-15451
2019-01-07 13:45:35 +01:00
Madhura Bhave 2dc7a89bd4 Merge branch '2.1.x' 2019-01-02 14:00:10 -08:00
Madhura Bhave 5b990605dc Polish "Order actuator security config after resource-server config"
Closes gh-15472
2019-01-02 13:57:49 -08:00
Stephen Doxsee 4597e7cc82 Order actuator security config after resource-server config
See gh-15472
2019-01-02 13:57:40 -08:00
Stephane Nicoll d57f831f50 Polish "Use Optional value in more functional style"
Closes gh-15575
2018-12-29 11:26:56 +01:00
igor-suhorukov 8ced867e95 Use Optional value in more functional style
See gh-15575
2018-12-29 11:26:27 +01:00
Stephane Nicoll fd12e696b0 Polish "Replace redundant call to class isInstance() with instanceof"
Closes gh-15554
2018-12-23 15:51:39 +01:00
igor-suhorukov 7424f48803 Replace redundant call to class isInstance() with instanceof
See gh-15554
2018-12-23 15:50:22 +01:00
Stephane Nicoll 9d67400afa Merge branch '2.1.x' 2018-12-20 17:54:08 +01:00
igor-suhorukov e578d30722 Replace anonymous inner class with lambda
See gh-15438
2018-12-20 17:47:29 +01:00
Andy Wilkinson 3a7406fe3a Merge branch '2.0.x' into 2.1.x 2018-12-20 15:58:03 +00:00
Andy Wilkinson 0741c90489 Avoid blocking on a Mono indefinitely
Closes gh-15535
2018-12-20 15:31:39 +00:00
Andy Wilkinson 9d2d6d5812 Merge branch '2.1.x' 2018-12-20 15:30:51 +00:00
Andy Wilkinson 9a33d1a2f9 Merge branch '2.0.x' into 2.1.x 2018-12-20 15:30:42 +00:00
Andy Wilkinson 8c68da0882 Avoid blocking on a Mono indefinitely
Closes gh-15535
2018-12-20 15:24:53 +00:00
Andy Wilkinson de599819ae Merge branch '2.1.x' 2018-12-19 16:57:19 +00:00
Andy Wilkinson 33fb1fa9a3 Avoid creating meter binders before registry has been customized
Previously, MeterRegistryPostProcessor would trigger the creation of all
meter binders and meter registry customizers before applying the
customizers and calling the binders. In some situations with complex
dependency graphs where the creation of a binder and the injection of
its dependencies inadvertently triggered some meter binding, this
could result in meters being bound before the registry had been
customized.

This commit reworks MeterRegistryPostProcessor and MeterRegistryConfigurer
to defer the retrieval of registry customizers and meter binders until
just before they are needed. As a result, customizers are now retrieved
and applied before the binders are retrieved.

Closes gh-15483
2018-12-19 16:47:30 +00:00
Andy Wilkinson 064f6478df Move back to JUnit 4 until SUREFIRE-1614 has been resolved
See gh-14736
See gh-14737
See gh-14738
2018-12-12 16:49:30 +00:00
Andy Wilkinson 2b453bbb16 Minimise dependencies on Log4j2
Closes gh-15441
2018-12-12 08:19:34 +00:00
Andy Wilkinson 71b29684b3 Remove redundant field type configuration
See gh-15435
2018-12-11 08:30:24 +00:00
Andy Wilkinson 55d7c19c06 Merge branch '2.1.x' 2018-12-10 17:59:50 +00:00
Andy Wilkinson d05ae40c99 Remove redundant field type and optional configuration
See gh-15435
2018-12-10 17:59:26 +00:00
Andy Wilkinson 393decff35 Merge branch '2.1.x' 2018-12-10 17:58:00 +00:00
Andy Wilkinson ef4ea591b3 Mark nested optional fields as optional
See gh-15435
2018-12-10 17:49:41 +00:00
igor-suhorukov 2b1653d009 Simplify code by using try-with-resources statement
Closes gh-15427
2018-12-10 09:05:33 +01:00
igor-suhorukov 5c1813aef8 Replace this lambda with a method reference
See gh-15401
2018-12-07 11:01:42 +01:00
Madhura Bhave 59d2b0a3fb Upgrade tests to Junit5
See gh-14737
2018-12-05 17:49:09 -08:00
Andy Wilkinson 0f474ec08f Merge branch '2.1.x' 2018-12-03 13:01:56 +00:00
Andy Wilkinson 07065532fe Replace accidental use of code shaded by Testcontainers
See gh-15371
2018-12-03 13:01:27 +00:00
dreis2211 f57f16c190 Avoid premature declaration of variables
Closes gh-15215
2018-12-03 10:59:20 +01:00
Stephane Nicoll 7939b8b4da Polish "Rename logging.file to logging.file.name"
Closes gh-15089
2018-12-03 10:42:30 +01:00
TwinProduction 21da4a5d12 Rename logging.file to logging.file.name
See gh-15089
2018-12-03 10:42:30 +01:00
Phillip Webb ba1ef52e39 Merge branch '2.0.x' 2018-11-29 15:32:48 -08:00
Phillip Webb 74376aa023 Polish 2018-11-29 15:30:28 -08:00
Madhura Bhave 427d494d57 Merge branch '2.0.x' 2018-11-28 21:32:05 -08:00
Madhura Bhave 02a1c43587 Fix tests 2018-11-28 21:26:47 -08:00
Madhura Bhave fc6c07ad3c Merge branch '2.0.x' 2018-11-28 17:41:11 -08:00
Madhura Bhave decaacddce Account for application path for Jersey servlet endpoints
Closes gh-14895
2018-11-28 17:25:32 -08:00
Brian Clozel d12e42e8d5 Polish
Closes gh-15211
2018-11-28 19:48:35 +01:00
artsiom 0a4ba499df Add Actuator health checks for Elasticsearch REST clients
This commit adds `ElasticsearchRestHealthIndicator`, a new
`HealthIndicator` for Elasticsearch, using the Elasticsearch "low level
rest client" provided by the
`"org.elasticsearch.client:elasticsearch-rest-client"` dependency.

Note that Spring Boot will auto-configure both low and high level REST
clients, but since the high level one is using the former, a single
health indicator will cover both cases.

See gh-15211
2018-11-28 19:48:35 +01:00
Stephane Nicoll 114347107e Polish key description 2018-11-28 11:31:48 +01:00
Alon Bar-Lev 108f28417e Allow to disable SSL client authentication on the management port
When server and management are at different ports, and when server
requires TLS client authentication, then there is no simple method to
disable TLS client authentication for management port.

This commit adds an additional "none" option to ssl.client-auth.

Example:

    server.port=8080
    server.ssl.enabled=true
    server.ssl.client-auth=need
    management.server.port=8081
    management.server.ssl.enabled=true
    management.server.ssl.client-auth=none

See gh-14985
2018-11-28 11:29:21 +01:00
Stephane Nicoll 476fe6ed17 Stop configuring metrics if hibernate is not available
Closes gh-15317
2018-11-28 10:54:56 +01:00
Stephane Nicoll 5f145ac482 Merge branch '2.0.x' 2018-11-28 10:23:44 +01:00
Stephane Nicoll b103e0c869 Polish "Unwrap DataSource target rather than plain instanceof calls"
Closes gh-15227
2018-11-28 10:18:28 +01:00
dreis2211 17f04b8b75 Replace DirectFieldAccessor usages by hasFieldOrPropertyWithValue
Closes gh-15312
2018-11-28 08:47:41 +01:00
Andy Wilkinson dad6d4beca Merge branch '2.0.x' 2018-11-27 20:37:35 +00:00
Andy Wilkinson 2b22b23aad Polish 2018-11-27 20:35:30 +00:00
Andy Wilkinson c1bbcb6908 Merge branch '2.0.x' 2018-11-26 11:41:55 +00:00
Andy Wilkinson 4bc32e6358 Use a HandlerInterceptor for timing long tasks
Closes gh-15204
2018-11-26 11:30:06 +00:00
Andy Wilkinson 5a246ce24d Merge branch '2.0.x' 2018-11-23 17:00:24 +00:00
Andy Wilkinson 8772f90e2f Polish 2018-11-23 17:00:16 +00:00
Andy Wilkinson 1797040e1a Merge branch '2.0.x' 2018-11-23 16:42:13 +00:00
Andy Wilkinson a54de61e61 Polish
Revert change inadvertently committed as part of gh-15017
2018-11-23 16:41:25 +00:00
Andy Wilkinson deeb961c6e Merge branch '2.0.x' 2018-11-23 15:23:14 +00:00
Andy Wilkinson 1f39b5dd7a Align MeterRegistryConfigurer's javadoc with its implementation
Closes gh-15017
2018-11-23 15:22:09 +00:00
Phillip Webb dbf09de203 Merge branch '2.0.x' 2018-11-15 13:29:09 -08:00
Phillip Webb e87664f295 Add JettyAccessLogCustomizer
Add a `JettyAccessLogCustomizer` to customize management access logs
when the management server is running on a different port.

Closes gh-15041
2018-11-15 13:28:51 -08:00
Brian Clozel 8e86bcafc1 Improve actuator endpoint mapping debug logging
Closes gh-14292
2018-11-14 14:36:52 +01:00
dreis2211 3b4b0641d9 Polish some Map operations
Closes gh-15153
2018-11-12 09:08:25 +01:00
Johnny Lim fd5aa3ebf1 Polish
See gh-15134
2018-11-11 11:03:13 +01:00
Stephane Nicoll 2c3b455b8b Merge branch '2.0.x' 2018-11-11 10:58:44 +01:00
Johnny Lim 8470d649bc Polish
See gh-15134
2018-11-11 10:58:31 +01:00
Stephane Nicoll f42a653604 Merge branch '2.0.x' 2018-11-03 16:38:16 +01:00
Stephane Nicoll f5ba9952db Make UndertowAccessLogCustomizer conditional on class
Closes gh-15065
2018-11-03 16:35:03 +01:00
Phillip Webb f3fa20b2d1 Polish 2018-10-29 14:25:45 -07:00
Andy Wilkinson 290e8886c9 Polish "Handle StepRegistry connect/read timeout deprecation"
Closes gh-14886
2018-10-29 21:11:11 +00:00
artsiom fe63342f52 Handle StepRegistry connect/read timeout deprecation
See gh-14886
2018-10-29 20:56:25 +00:00
Andy Wilkinson de674db454 Merge branch '2.0.x' 2018-10-29 12:03:47 +00:00
dreis2211 62ca9e47b8 Use MeterRegistry.isClosed() for tests
Closes gh-14975
2018-10-29 11:57:16 +00:00
dreis2211 fb03139c59 Fix MetricsAutoConfigurationTests
Closes gh-14972
2018-10-26 16:54:11 -07:00
Phillip Webb c393f6262e Merge branch '2.0.x' 2018-10-26 16:36:02 -07:00
Phillip Webb 33c7a74bee Update copyright year for changed files 2018-10-26 16:35:28 -07:00
Vedran Pavic 6e967fe860 Upgrade to Hazelcast 3.11
Closes gh-14949
2018-10-25 15:57:59 -07:00
dreis2211 4857b45ea5 Replace lambdas with method reference or call
Closes gh-14937
2018-10-24 10:12:36 +02:00
Andy Wilkinson 4d9714a0cb Start building against Micrometer snapshots for 1.1.0
See gh-14890
2018-10-19 17:50:07 +01:00
Andy Wilkinson cefc7842d6 Merge branch '2.0.x' 2018-10-18 15:38:17 +01:00
Andy Wilkinson 9b8ead825c Polish 2018-10-18 15:38:06 +01:00
Andy Wilkinson 3177584588 Back off auto-config of Log4J2Metrics when context is backed by SLF4J
Closes gh-14883
2018-10-18 10:31:10 +01:00
Johnny Lim c8c3f59e93 Polish
Closes gh-14884
2018-10-18 09:36:27 +02:00
Stephane Nicoll 474da80b4d Revert "Restructure of security packages"
See gh-14412
2018-10-17 12:22:51 +02:00
Stephane Nicoll fd0e8815b1 Polish 2018-10-16 18:00:55 +02:00
Stephane Nicoll 5f2517f889 Auto-configure AppOptics metrics
Closes gh-14819
2018-10-16 17:35:23 +02:00
Stephane Nicoll 134682a7de Add error metadata for properties removed recently 2018-10-16 15:55:07 +02:00
Andy Wilkinson bd0a41d82d Merge branch '2.0.x' 2018-10-16 13:31:35 +01:00
Andy Wilkinson d4cad5e916 Polish "Servlet path not explicitly required for EndpointRequest"
Closes gh-14503
2018-10-16 13:01:49 +01:00
Madhura Bhave 0fd873f0f9 Servlet path not explicitly required for EndpointRequest 2018-10-16 11:58:07 +01:00
Andy Wilkinson 98d95268e1 Align with changes to CouchbaseReactiveHealthIndicator
Closes gh-14799
2018-10-16 11:14:36 +01:00
Johnny Lim 7f9671fd14 Polish
Closes gh-14843
2018-10-16 11:38:51 +02:00
Hanope c3f3240e2c Fix typos
closes gh-14844
2018-10-16 01:04:28 -07:00
Phillip Webb 29707bf75a Complete restructure of security packages
Complete the restructuring of the security auto-configuration
packages by removing the direct import of web configuration from
the main security auto-configuration.

Closes gh-14412
2018-10-16 01:01:11 -07:00
Madhura Bhave f835f82582 Preliminary restructure of security packages
Restructure the security auto-configuration packages to better reflect
the part of the system that the configuration applies to.

See gh-14412
2018-10-16 01:01:10 -07:00
Phillip Webb d558a1a762 Merge branch '2.0.x' 2018-10-15 22:01:25 -07:00
Phillip Webb 8ecb659a35 Deprecate SecurityPrerequisite
Deprecate `SecurityPrerequisite` interface since we don't support it
in Spring Boot 2.

Closes gh-14846
2018-10-15 21:00:53 -07:00
Phillip Webb 6b37d87497 Allow multiple endpoint PathMapper beans
Update `WebEndpointDiscoverer` and related classes to that multiple
`PathMapper` beans can be registered. Mappers are now tried in order
until one returns a non-null value.

Closes gh-14841
2018-10-15 18:25:42 -07:00
Phillip Webb f0f999a27d Merge branch '2.0.x' 2018-10-15 14:47:11 -07:00
Phillip Webb 5d219bcd19 Polish 2018-10-15 14:45:49 -07:00
Phillip Webb 734e9e4b74 Merge branch '2.0.x' 2018-10-15 14:22:44 -07:00
Phillip Webb b25e222136 Retain original case when mapping endpoint paths
Update `MappingWebEndpointPathMapper` to keep the original case rather
than using a lower-case version.

Closes gh-14773
2018-10-15 14:20:16 -07:00
Stephane Nicoll e901a0bd0e Merge branch '2.0.x' 2018-10-15 23:18:26 +02:00
Stephane Nicoll 935d621a42 Fix mapping of Wavefront base properties
Closes gh-14839
2018-10-15 23:18:12 +02:00
Stephane Nicoll 94b2092218 Add base test for StepRegistryPropertiesConfigAdapter 2018-10-15 23:05:54 +02:00
Andy Wilkinson 1e2d5a1382 Auto-configure Micrometer's HumioMeterRegistry
Closes gh-14804
2018-10-15 18:10:35 +01:00
Stephane Nicoll edf4045c3b Add missing tests for Kairos config adapter
Closes gh-14821
2018-10-15 17:55:07 +02:00
Andy Wilkinson e53e8bf79f Merge branch '2.0.x' 2018-10-15 15:29:10 +01:00
Andy Wilkinson 0fedf8d2af Keep Liquibase-specific DataSource open for use by LiquibaseEndpoint
Closes gh-13832
2018-10-15 15:26:26 +01:00
Andy Wilkinson a4eb636913 Merge branch '2.0.x' 2018-10-15 13:58:17 +01:00
Andy Wilkinson 6d98851fb5 Use Couchbase's DiagnosticsReport to determine its health
Previously, Couchbase's health was determined by retrieving the bucket info
from the cluster info. This retrieval could take over one minute in some
cases even when Couchbase is health. This latency is too large for a health
check.

The Couchbase team have recommended the of a Cluster#diagnostics instead.
This provides a much lower latency view of the cluster's health. This
commit updates CouchbaseHealthIndicator to use Cluster#diagnostics while
retaining support, in a deprecated form, for the old info-based mechanism
should anyone want to opt back into that in 2.0.x.

Closes gh-14685
2018-10-15 13:44:42 +01:00
Stephane Nicoll 89349c6eb9 Auto-configure KairosDB metrics
Closes gh-14821
2018-10-15 14:13:10 +02:00
Stephane Nicoll 1a0d53dec0 Replace ReflectionTestUtils usage by hasFieldOrPropertyWithValue
Closes gh-14696
2018-10-15 08:25:10 +02:00
Phillip Webb 18319ac276 Remove deprecated Endpoint ID methods
See gh-14773
2018-10-14 13:55:13 -07:00
Phillip Webb 1bf97e9b5e Merge branch '2.0.x' 2018-10-14 13:53:28 -07:00
Phillip Webb a00ee15e16 Use lowercase default endpoint paths
Update `MappingWebEndpointPathMapper` to use the lowercase version of
the endpoint ID when no explicit path mapping has been set. An endpoint
with the ID 'myEndpoint' will now be mapped to the path 'myendpoint'.

See gh-14773
2018-10-14 13:45:05 -07:00
Phillip Webb df5dfbf4be Support mixed case endpoint includes/excludes
Update `ExposeExcludePropertyEndpointFilter` so that mixed case
endpoint IDs are supported. Prior to this commit it was not easy for
an endpoint to be missed by the filter due to the formatting of the
property value.

See gh-14773
2018-10-14 13:45:05 -07:00
Phillip Webb 674a909bab Support mixed case endpoint IDs with enabled
Update `OnEnabledEndpointCondition` so that mixed case endpoint IDs
are supported. Prior to this commit an
`InvalidConfigurationPropertyNameException` would be thrown when trying
to enabled or disable an endpoint with a camel case ID.

See gh-14773
2018-10-14 13:45:05 -07:00
Phillip Webb 138d85477d Support mixed case endpoint IDs with time-to-live
Update the endpoint time-to-live binding logic so that mixed case
endpoint IDs are supported. Prior to this commit an
`InvalidConfigurationPropertyNameException` would be thrown when using
a camel case endpoint ID.

See gh-14773
2018-10-14 13:45:04 -07:00
Phillip Webb 3105a38884 Introduce EndpointID to enforce naming rules
Add an `EndpointID` class to enforce the naming rules that we support
for actuator endpoints. We now ensure that all endpoint names contain
only letters and numbers and must begin with a lower-case letter.

Existing public classes and interfaces have been changes so that String
based `endpointId` methods are deprecated and strongly typed versions
are preferred instead. A few public classes that we're not expecting
to be used directly have been changed without deprecated methods being
introduced.

See gh-14773
2018-10-14 13:45:04 -07:00
Phillip Webb c5786c218d Polish 2018-10-14 11:24:10 -07:00
Andy Wilkinson 7ad94299d6 Stop relying on server customizer ordering for Tomcat metrics binding
Closes gh-14784
2018-10-13 11:52:51 +01:00
Andy Wilkinson 2b11ee4389 Auto-configure binding of Micrometer's JettyServerThreadPoolMetrics
Closes gh-14591
2018-10-13 11:52:51 +01:00
Madhura Bhave 6df9555d6a Update micrometer tests following upstream changes 2018-10-12 18:58:11 -07:00
Stephane Nicoll 0ff1b25f52 Polish "Improve Micrometer histogram properties support"
Closes gh-14139
2018-10-12 14:23:21 +02:00
Alexander Abramov c1c79ab1c2 Improve Micrometer histogram properties support
This commit adds configuration properties for Micrometer histogram
settings: "minimumExpectedValue" and "maximumExpectedValue".

See gh-14139
2018-10-12 14:23:21 +02:00
Andy Wilkinson 19232ad87a Merge branch '2.0.x' 2018-10-12 11:25:17 +01:00
Andy Wilkinson 861587ec78 Allow @ConditionalOnEnabledEndpoint to be used on any component
Closes gh-14787
2018-10-12 11:24:33 +01:00
Andy Wilkinson 5e3b5ae14f Polish
See gh-14780 and gh-14467
2018-10-11 17:25:54 +01:00
Andy Wilkinson 5f0d7dd6c7 Merge branch '2.0.x' 2018-10-11 17:20:35 +01:00
Andy Wilkinson 2a2908e74e Order MeterFilters and MeterRegistryCustomizers
Closes gh-14780
2018-10-11 17:15:47 +01:00
Andy Wilkinson 2216b78f1e Merge branch '2.0.x' 2018-10-08 15:53:09 +01:00
Andy Wilkinson d3b3c8c64e Honour management.metrics.web.server.auto-time-requests with WebFlux
Closes gh-13895
2018-10-08 15:52:50 +01:00
Stephane Nicoll 7da3396555 Merge branch '2.0.x' 2018-10-08 10:45:49 +02:00
dreis2211 55ec016bac Remove unused fields in tests
Closes gh-14707
2018-10-08 10:40:04 +02:00
Phillip Webb 20ecf73cd1 Polish "Add Prometheus push gateway support"
Rework Prometheus push gateway support so that the central class can
be used outside of auto-configuration. The shutdown flags have also
been replaced with a single "shutdown-operation" property since it's
unlikely that both "push" and "delete" will be required.

It's also possible now to supply a `TaskScheduler` to the manager.

See gh-14353
2018-10-05 18:12:41 -07:00
David J. M. Karlsen 4e71981f77 Add Prometheus push gateway support
Add support for Prometheus push gateway so that short lived processes
(for example batch jobs) can still submit metrics to Prometheus.

Closes gh-14353
2018-10-05 18:12:19 -07:00
Stephane Nicoll 35752a54d2 Adapt to latest change in Micrometer 1.1 2018-10-05 23:42:16 +02:00
Phillip Webb 01b8667dd7 Update copyright year for changed files 2018-10-05 13:40:07 -07:00
Andy Wilkinson 72e2313fe8 Polish "Auto-configure Micrometer's Jersey 2 server instrumentation"
Closes gh-12482
2018-10-05 16:40:57 +01:00
Michael Weirauch dd126faf5a Auto-configure Micrometer's Jersey 2 server instrumentation
See gh-12482

Co-authored-by: Michael J. Simons <michael@simons.ac>
2018-10-05 16:07:10 +01:00
Stephane Nicoll bdd8e53124 Improve filtering of actuator auto-configurations
This commit splits auto-configurations that require different
environments so that they can be filtered early.

Closes gh-12260
2018-10-05 14:57:17 +02:00
Stephane Nicoll 91b4dc2f69 Polish "Add reactive health indicator for Couchbase"
Closes gh-13926
2018-10-05 13:57:31 +02:00
Mikalai Lushchytski 20ff0d97e4 Add reactive health indicator for Couchbase
See gh-13926
2018-10-05 13:57:17 +02:00
Andy Wilkinson c9da881322 Polish "Drop support for "all" from management.metrics.distribution.sla"
Closes gh-14684
2018-10-05 09:25:10 +01:00
artsiom ccb964e886 Drop support for "all" from management.metrics.distribution.sla
See gh-14684
2018-10-05 09:22:43 +01:00
Andy Wilkinson ef7c2bc6ea Merge branch '2.0.x' 2018-10-05 08:37:45 +01:00
Andy Wilkinson e7f100d5d7 Improve test coverage of PropertiesMeterFilter
Closes gh-14689
2018-10-05 08:37:19 +01:00
Stephane Nicoll 5d0e812afe Merge branch '2.0.x' 2018-10-04 15:53:26 +02:00
Stephane Nicoll 1b10d3fcbf Fix missing metadata for nested POJO
This commit fixes missing descriptions and default values when
applicable for `management.server.ssl`, `server.compression`,
`server.http2`, `server.servlet.jsp`, `server.servlet.session` and
`server.ssl`.

Those nested namespace are managed by a POJO that is declared outside
of the module of the target @ConfigurationProperties type using it. As
a result, the annotation processor has no access to the source model and
can't extract the description and the default value, if any.

This commit migrates the misleading field-level Javadoc to manual meta
data for the time being.

Closes gh-14669
2018-10-04 15:49:04 +02:00
Phillip Webb d76bba5e6f Migrate from ExpectedException rule to AssertJ
Replace ExpectedException JUnit rules with AssertJ exception
assertions.

Closes gh-14336
2018-10-02 10:55:28 -07:00
Johnny Lim 1e756db966 Use Commons Logging for OnlyOnceLoggingDenyMeterFilter
Closes gh-14637
2018-09-30 17:47:18 -04:00
Johnny Lim 698bbd6a9e Polish
Closes gh-14597
2018-09-26 11:45:21 -04:00
Hanope e5ed5ebf8b Fix "Query Parameters" section name
Closes gh-14600
2018-09-25 14:24:34 -04:00
Stephane Nicoll 5765ed00e8 Polish 2018-09-24 10:53:22 +02:00
Andy Wilkinson 6e00d13d68 Polish 2018-09-23 15:53:14 +01:00
Andy Wilkinson 4c3e2d10d1 Auto-configure Micrometer's Elastic registry
Closes gh-14523
2018-09-23 15:52:29 +01:00
Andy Wilkinson 95ecbc736b Update example for disk space health indicator to use DataSize
See gh-14549
2018-09-23 12:05:57 +01:00
Stephane Nicoll 47f9379305 Adapt to changes in latest Micrometer snapshot
See gh-14522
2018-09-22 20:02:28 +02:00
Andy Wilkinson 977f8b4479 Auto-configure Micrometer's Kafka consumer metrics
Closes gh-14525
2018-09-21 19:56:29 +01:00
Stephane Nicoll cbae22f0c9 Polish "Migrate size properties to DataSize"
Closes gh-14549
2018-09-21 16:27:28 +02:00
Andy Wilkinson 258c4838b1 Auto-configure Micrometer's Log4j2 metrics
Closes gh-14524
2018-09-21 14:45:20 +01:00
Andy Wilkinson fe75f966ff Auto-configure Micrometer's Dynatrace meter registry
Closes gh-14522
2018-09-21 13:11:33 +01:00
Andy Wilkinson 426ff3ada7 Store ObjectProvider rather than their Streams to allow reuse
Generally speaking, methods on configuration classes will only be called once
and, therefore, it should be safe to hold a reference to a Stream for later
one-time usage. However, there are some scenarios in Spring Fu where functional
registration results in an attempt being made to use a Stream more than use.

This commit protects against multiple use by storing the ObjectProvider and
getting a new ordered Stream each time it's needed.

Closes gh-14467
2018-09-20 16:16:42 +01:00
Andy Wilkinson cc6cf880cf Stop using ObjectProvider<List> and ObjectProvider<Collection>
Closes gh-14467
2018-09-20 13:19:40 +01:00
Madhura Bhave 6c1915e81f Merge branch '2.0.x' 2018-09-11 17:03:38 -07:00
Madhura Bhave 7af6665a0e Ignore management.server.port for war
Fixes gh-14148
2018-09-11 16:56:03 -07:00
Stephane Nicoll a170bfcc76 Deprecate micrometer meter's enabled flags
This commit deprecates the few 'enabled' flags that control whether
certain meter binders are registered in the context.

Metrics auto-configuration for the JVM, Logback and System-related
information have been moved to individual auto-configurations so that
they can be excluded rather than using the now deprecated flag.

This harmonizes our policy with regards to disabling behaviour,
especially since other similar auto-configurations do not have such
flag.

Closes gh-13408
2018-09-06 15:08:39 +02:00
Stephane Nicoll 45ef926a90 Merge branch '2.0.x' 2018-09-06 12:18:12 +02:00
Stephane Nicoll ff8b8c55c6 Remove reference to "management.metrics.binders.integration.enabled"
Closes gh-14319
2018-09-06 12:17:57 +02:00
Phillip Webb c3de4c84f2 Polish 2018-09-05 12:54:20 -07:00
Madhura Bhave f0d7533e0b Merge branch '2.0.x' 2018-09-04 17:09:52 -07:00
Madhura Bhave 9c82d5c382 Make ApplicationContextServerWebExchangeMatcher and subclasses thread-safe
Fixes gh-14161
2018-09-04 17:06:24 -07:00
Andy Wilkinson 8ee4775820 Polish 2018-09-04 20:46:35 +01:00
Stephane Nicoll 1ceb076035 Harmonize Metrics test
This commit harmonizes metrics test to rely on `MetricRun.simple()`
rather than configuring a simple `MeterRegistry` manually. Rather than
applying related auto-configurations automatically, `MetricsRun` only
enable the absolute minimum.

See gh-14255
2018-09-04 15:04:02 +02:00
Stephane Nicoll 3d732e86f4 Merge branch '2.0.x' 2018-09-04 08:52:35 +02:00
Johnny Lim ca57e58ee5 Polish
See gh-14293
2018-09-04 08:52:13 +02:00
Stephane Nicoll 4634811c7c Polish 2018-08-31 14:45:17 +02:00
Stephane Nicoll 7bee9dfc22 Harmonize HTTP client metrics
This commit harmonizes the auto-configurations for RestTemplate and
WebClient in a single `HttpClientMetricsAutoConfiguration`. Doing so
allows to give a better scope for the shared `MeterFilter`.

As a result`WebClientMetricsAutoConfiguration` has moved to the `client`
package.

Closes gh-14269
2018-08-31 14:45:03 +02:00
Stephane Nicoll 6c26315cd1 Merge branch '2.0.x' 2018-08-30 13:08:42 +02:00
Stephane Nicoll 0625443d27 Polish "Limit metrics collection of incoming requests"
Closes gh-14173
2018-08-30 12:59:07 +02:00
Dmytro Nosan 81a6701914 Limit metrics collection of incoming requests
See gh-14173
2018-08-30 12:26:06 +02:00
dreis2211 422a436df1 Polish some Collectors
See gh-13727
2018-08-27 18:09:02 +02:00
Stephane Nicoll dd9209c7d9 Merge branch '2.0.x' 2018-08-22 10:48:35 +02:00
Stephane Nicoll 000cb94323 Polish "Fix String concatenation in a loop"
Closes gh-14153
2018-08-22 10:47:05 +02:00
Hiroaki Yoshida 43acc37587 Fix String concatenation in a loop
See gh-14153
2018-08-22 10:46:14 +02:00
Stephane Nicoll f5d922c712 Upgrade to Spring Integration 5.1.0.M2
Upgrade to M2 broke a test that was looking for a particular bean that
is configured by Spring Integration (`HeaderChannelRegistry`).

It looks like INT-4517 is related to the regression as it registers the
bean too late for the auto-configuration to see it.

This commit changes the condition to a more central bean that is created
very early on.

Closes gh-14142
2018-08-21 09:56:19 +02:00
Stephane Nicoll b60fbe5a1f Merge branch '2.0.x' 2018-08-20 17:00:36 +02:00
Stephane Nicoll b0d388830f Polish test 2018-08-20 17:00:21 +02:00
Vedran Pavic 644ab5f3e4 Align SessionsEndpoint with Spring Session API improvements
This commit aligns SessionsEndpoint with
FindByIndexNameSessionRepository API improvements that simplifies
retrieval of sessions by principal name.

Closes gh-14124
2018-08-18 11:27:35 +02:00
Madhura Bhave d724f154f4 Merge branch '2.0.x' 2018-08-16 15:45:20 -07:00
Madhura Bhave b93c2b9a9f Allow actuator endpoints to be used with mvcMatchers
This commit changes AbstractWebMvcEndpointHandlerMapping to
be a MatchableHandlerMapping. Additionally, EndpointRequest,
now delegates to MvcRequestMatcher for Spring MVC applications.

For all other applications, AntPathRequestMatcher is used as
a delegate.

Closes gh-13962
2018-08-16 15:41:02 -07:00
Johnny Lim 101cc59b7d Polish
Closes gh-14023
2018-08-09 09:32:10 +02:00
Stephane Nicoll a12ca0a0dc Merge branch '2.0.x' 2018-08-08 16:05:34 +02:00
Stephane Nicoll a023bd030a Add configurable timeout for Couchbase health indicator
This commit makes sure to use a configurable timeout to check if the
Couchbase cluster is up, rather than relying on the default that can be
quite long.

Closes gh-13879
2018-08-08 16:01:58 +02:00
Stephane Nicoll 14a9ec8711 Polish 2018-08-06 14:44:44 +02:00
Stephane Nicoll e6b44189e0 Polish "Add global support for JMX unique names"
This commit ensures that the new "spring.jmx.unique-names" property
deprecates the Endpoint's specific property as they share the same goal.

If both are set with an incompatible value, an exception is thrown
inviting the user to update their configuration.

Closes gh-13990
2018-08-06 14:35:18 +02:00
Stephane Nicoll 624c1306fd Merge branch '2.0.x' 2018-08-03 18:25:24 +02:00
Stephane Nicoll 737b4a275b Polish 2018-08-03 18:24:59 +02:00