Commit Graph

1029 Commits

Author SHA1 Message Date
Phillip Webb
0d157e046f Fix checkstyle violations
See gh-21015
2020-12-08 18:12:30 -08:00
izeye
8c55803931 Polish
See gh-24306
2020-12-08 12:08:35 -08:00
Phillip Webb
837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
Stephane Nicoll
9763ba56ba Start building against Spring Framework 5.2.12 snapshots
See gh-24276
2020-11-30 16:04:27 +01:00
Andy Wilkinson
08b9d1da57 Polish "Ensure that MeterRegistry bean is defined before SI looks for it"
See gh-24095
2020-11-20 11:20:31 +00:00
Artem Bilan
7d712aaa2d Ensure that MeterRegistry bean is defined before SI looks for it
Previously, it was possible for Spring Integration, including its
built-in Micrometer support, to be auto-configured before the
Micrometer auto-configuration had defined the MeterRegistry bean. This
resulted in missing Spring Integration metrics.

Spring Integration is unusual in having its own built-in Micrometer
support that it configures itself. Rather than providing
auto-configuration for Integration's Micrometer support (Which isn't
needed), this commit introduces some auto-configuration that just
affects the ordering of the auto-configuration classes. This ordering
ensures that the MeterRegistry bean has been defined by Spring
Integration is auto-configured. This ensures that the MeterRegistry
bean is known to the BeanFactory when Spring Integration goes looking
for it.

See gh-24095
2020-11-20 11:18:09 +00:00
Andy Wilkinson
30a0ccab02 Remove use of @PostConstruct from main code
When running on Java 11 (where `@PostConstruct` is no longer part of
the JRE) and without a dependency on jakarta-annotation-api,
`@PostContruct` annotions are silently dropped. This leads to obscure and
hard-to-track down changes in the behaviour of our auto-configuration
as the `@PostConstruct`-annotated methods are not invoked.

To allow users to run on Java 11 without having jakarta-annotation-api
on the classpath, this commit removes use of `@PostConstruct` from main
code. A Checkstyle rule has also been added to prevent its usage in
main code from being reintroduced.

Closes gh-23723
2020-11-03 13:59:38 +00:00
Andy Wilkinson
b9516bc77c Await registration of http.server.requests meter
Previously, the test would make an HTTP request and, as soon as the
response was received, it would check the presence and value of the
http.server.requests meter. This create a race condition between the
meter being registered once the response had been flushed and the
meter's presence being checked. If the check won the race, the test
would fail.

This commit updates the test to wait for up to 5 seconds for the
meter to be present and have a count of 1, matching the single request
that has been made.

Fixes gh-23919
2020-10-27 15:54:22 +00:00
Andy Wilkinson
5d20660c8a Disable proxyBeanMethods on all management context config classes
Fixes gh-23301
2020-09-15 12:30:32 +01:00
Andy Wilkinson
627ede8bff Remove duplicate jackson-datatype-jsr310 dependency
Closes gh-23123
2020-08-28 12:38:42 +01:00
Phillip Webb
4e76138ebc Update copyright year of changed files 2020-08-18 15:37:59 -07:00
Phillip Webb
10da595302 Polish 'Order metrics auto-configurations correctly'
See gh-21134
2020-08-17 16:10:18 -07:00
Martin Benda
02b7ec787e Order metrics auto-configurations correctly
Update metrics auto-configurations so that they are auto-configured
after `CompositeMeterRegistryAutoConfiguration` in order to ensure
the `MeterRegistry` bean has been defined.

Prior to this commit, metrics auto-configurations that depended on a
`MeterRegistry` has `@AutoConfigureAfter(MetricsAutoConfiguration.class)`
which is not sufficient since `MetricsAutoConfiguration` does not export
a `MeterRegistry`.

See gh-21134
2020-08-17 16:03:27 -07:00
Stephane Nicoll
f61a632a37 Polish "Fix conditions that lead to auto-configure PushGateway"
See gh-22919
2020-08-13 11:47:43 +02:00
smlc
c355b95f6c Fix conditions that lead to auto-configure PushGateway
See gh-22919
2020-08-13 11:41:49 +02:00
Madhura Bhave
f39f33bb8d Fix documentation related to the health endpoint's inner details
Closes gh-22490
2020-08-06 17:57:56 -07:00
Andy Wilkinson
71ffb44a3c Remove WebClient's in-memory buffer size limit for endpoint tests
Previously, the endpoints' responses could occasionally exceed
WebClient's in-memory buffer limt, for example if the threads endpoint
was reporting a large number of threads or the threads had large
stacks.

This commit disables WebClient's in-memory buffer size limit so that
the tests passing is not dependent on the size of the endpoints'
responses.

Closes gh-22743
2020-08-05 17:37:44 +01:00
Stephane Nicoll
16aa8fbc88 Fix actuator dependency on Jackson JSR 310 module
This commit harmonizes dependency declarations for Jackson in the
actuator. Both Jackson and JSR 310 are back to optional in the core
actuator module and mandatory when using the auto-configuration.

Closes gh-22624
2020-07-28 16:26:11 +02:00
Andy Wilkinson
ce7210c4f0 Merge branch '2.1.x' into 2.2.x
Closes gh-22563
2020-07-25 09:06:11 +01:00
Nelson Osacky
585aed8f8f Add generated-snippets as output to test goal
The generated snippets were not declared as an output to the
`spring-boot-actuator-autoconfigure` test goal so when the test was
pulled from the cache, it did not contain the `generated-snippets`
directory. This directory is required as an input to the Asciidoctor
plugin.

See gh-22555
2020-07-25 08:26:15 +01:00
Phillip Webb
e6eb02603c Polish 'Inherit show-details property in health groups'
Rework the inheritance so that the property metadata JSON more
accurately reflects the default value.

See gh-22022
2020-06-22 23:01:37 -07:00
Leo Li
10de88884f Inherit show-details property in health groups
Update `Group` properties so that the `showDetails` value does not
inherit `Show.NEVER`. Prior to this commit, the `Group` properties
would not correctly inherit a `showDetails` value from the main
`management.endpoint.health.show-details` property.

See gh-22022
2020-06-22 22:54:34 -07:00
Scott Frederick
0fa1d0ef2e Handle bind exceptions in management context
This commit updates the logic for handling binding exceptions in the
management context when it is separate from the application context.
The changes allow the exception details to be visible to
DefaultErrorAttributes without causing the servlet container to
detect an error condition.

Fixes gh-21036
2020-06-10 13:53:04 -05:00
Phillip Webb
0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Madhura Bhave
573cb98d90 Make management security configuration back off when SAML present
Fixes gh-21620
2020-06-01 13:39:46 -07:00
Phillip Webb
49a21ded7a Create endpoint beans as late as possible
Update `EndpointDiscoverer` so that `@Endpoint` and `@EndpointExtension`
beans are created as late as possible.

Prior to this commit, endpoint beans and extension beans would be
created during the discovery phase which could cause early bean
initialization. The problem was especially nasty when using an embedded
servlet container since `ServletEndpointRegistrar` is loaded as the
container is initialized. This would trigger discovery and load all
endpoint beans, including the health endpoint, and all health indicator
beans.

Fixes gh-20714
2020-05-13 19:10:54 -07:00
Phillip Webb
5157a75119 Polish 2020-05-13 11:36:02 -07:00
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
2020-05-12 11:44:28 -05:00
Stephane Nicoll
8ac3ab5551 Add missing metadata for removed configuration keys
Closes gh-20846
2020-04-23 14:39:10 +02:00
Stephane Nicoll
311952730e Merge branch '2.1.x' into 2.2.x
Closes gh-21097
2020-04-23 14:07:31 +02:00
Stephane Nicoll
291165f060 Order additional metadata according to lexicographic order
Closes gh-21095
2020-04-23 13:58:49 +02:00
Phillip Webb
102729b5e1 Merge branch '2.1.x' into 2.2.x
Closes gh-21082
2020-04-22 11:58:39 -07:00
Phillip Webb
b3d33754a5 Remove outdated FIXMEs from tests
Closes gh-19782
2020-04-22 11:55:35 -07:00
Andy Wilkinson
3065c88d6f Fix typo in IncludeExcludeEndpointFilter's name
Closes gh-21061
2020-04-21 13:27:35 +01:00
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
2020-04-20 13:10:59 -07:00
Phillip Webb
83553ee504 Fix test checkstyle issues
Fix checkstyle issues from forward merge.

See gh-21022
2020-04-19 16:51:59 -07:00
Phillip Webb
5757c0864c Merge branch '2.1.x' into 2.2.x
Closes gh-21022
2020-04-19 16:03:49 -07:00
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
2020-04-19 15:58:20 -07:00
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
2020-04-19 16:35:16 +02:00
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
2020-04-05 15:12:42 +02:00
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
2020-04-05 14:57:25 +02:00
Phillip Webb
16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00
Stephane Nicoll
7be3db2d4d Merge branch '2.1.x' into 2.2.x
Closes gh-20618
2020-03-23 14:22:30 +01:00
Stephane Nicoll
bcce6f9f07 Document that Jackson is a required dependency of the Actuator
Closes gh-19564
2020-03-23 14:16:55 +01:00
dreis2211
4eaaf88b2d Remove redundant code
See gh-20339
2020-02-27 12:56:43 -08:00
Madhura Bhave
ea8f2a7276 Fix tests following changes to EndpointRequest
See gh-20329
2020-02-26 17:05:16 -08:00
Madhura Bhave
cdae79dad9 Cache management port type in EndpointRequestMatcher
Closes gh-20329
2020-02-26 14:59:54 -08:00
Dave Syer
dcaaf9785f Remove duplicate auto-configuration class
See gh-20168
2020-02-14 10:25:19 +01:00
Stephane Nicoll
10643b7702 Polish "Stop time web metrics when autotime is disabled"
See gh-19981
2020-02-04 10:03:08 +01:00
babjo
e323e05eea Stop time web metrics when autotime is disabled
See gh-19981
2020-02-04 09:50:49 +01:00