Commit Graph

1209 Commits

Author SHA1 Message Date
Phillip Webb e4164d0143 Fix package tangle in endpoint package
Fix package tangle in the actuator endpoint package by relocating a
few classes.

The `Producible` and `ProducibleOperationArgumentResolver` classes have
been moved from `endpoint.annotation` to `endpoint` since they aren't
directly tied to annotations.

The `ApiVersion` class has been moved from `endpoint.http` to
`endpoint` since it needs to implement `Producible` and isn't really
tied to HTTP.

Closes gh-25914
2021-04-07 16:54:37 -07:00
Phillip Webb 807ea1af0d Update copyright year of changed files 2021-04-06 14:59:52 -07:00
Stephane Nicoll b11602aeaa Polish "Add Quartz actuator endpoint"
This commit reworks the initial proposal so that jobs and triggers are
treated as first class concepts.

`/actuator/quartz` now returns the group names for jobs and triggers.

`actuator/quartz/jobs` returns the job names, keyed by the available
group names, while `/actuator/quartz/triggers` does the same for
triggers.

`/actuator/jobs/{groupName}` provides an overview of a job group. It
provides a map of job names with the class name of the job.
implementation

`/actuator/triggers/{groupName}` provides an overview of a trigger
group. There are five supported trigger implementations: cron, simple,
daily time interval, calendar interval, and custom for any other
implementation. Given that each implementation has specific settings,
triggers are split in five objects.

`/actuator/jobs/{groupName}/{jobName}` provides the full details of a
particular job. This includes a sanitized data map and a list of
triggers ordered by next fire time.

`/actuator/triggers/{groupName}/{triggerName}` provides the full details
of a particular trigger. This includes the state, its type, and a
dedicate object containing implementation-specific settings.

See gh-10364
2021-04-06 12:13:28 +02:00
Vedran Pavic 9795061360 Add Quartz actuator endpoint
See gh-10364
2021-04-06 11:36:54 +02:00
Stephane Nicoll dd916f908f Merge branch '2.4.x'
Closes gh-25880
2021-04-04 11:19:13 +02:00
izeye 852e5778a3 Polish
See gh-25875
2021-04-04 11:12:03 +02:00
Brian Clozel 72a1eb6384 Allow to manually tag request metrics with exceptions
Prior to this commit, some exceptions handled at the controller or
handler function level would:

* not bubble up to the Spring Boot error handling support
* not be tagged as part of the request metrics

This situation is inconsistent because in general, exceptions handled at
the controller level can be considered as expected behavior.
Also, depending on how the exception is handled, the request metrics
might not be tagged with the exception.
This will be reconsidered in gh-23795.

This commit prepares a transition to the new situation. Developers can
now opt-in and set the handled exception as a request attribute. This
well-known attribute will be later read by the metrics support and used
for tagging the request metrics with the exception provided.

This mechanism is automatically used by the error handling support in
Spring Boot.

Closes gh-24028
2021-04-01 21:09:46 +02:00
Andy Wilkinson 03e92d794b Merge branch '2.4.x'
Closes gh-25845
2021-03-31 17:29:33 +01:00
Andy Wilkinson 0e4b66a3ea Merge branch '2.3.x' into 2.4.x
Closes gh-25844
2021-03-31 17:29:11 +01:00
Andy Wilkinson 1a84b0610e Align PushGatewayManager's exception handling with PushMeterRegistry's
Previously, would log an error for any exception and also stop
publishing for an UnknownHostException. By constrast, Micrometer's
PushMeterRegistry treats all exceptions the same, logging a warning
and continuing with subsequent push attempts.

This commit updates the push gateway manager's behaviour to match
PushMeterRegistry. UknownHostExceptions no longer receive special
treatment and push (and delete) failures are now logged as warnings
rather than errors.

Fixes gh-25804
2021-03-31 17:01:08 +01:00
Phillip Webb 8c31d29acf Merge branch '2.4.x' 2021-03-30 09:29:59 -07:00
Phillip Webb a28a3ae090 Merge branch '2.3.x' into 2.4.x 2021-03-30 09:25:46 -07:00
Phillip Webb 9c8a97809d Consistent use of @deprecated since
Restore the patch version number for consistency with `@since`
tags.

See gh-25808
2021-03-30 09:20:30 -07:00
Andy Wilkinson d9ce30b15c Merge branch '2.3.x' into 2.4.x
See gh-25825
2021-03-30 09:23:24 +01:00
Andy Wilkinson 8b6eef6f1d Consistent use of @deprecated since
See gh-25808
2021-03-30 09:22:45 +01:00
Phillip Webb 44b1751bb4 Merge branch '2.4.x'
Closes gh-25826
2021-03-29 15:48:20 -07:00
Phillip Webb 363f5829d1 Merge branch '2.3.x' into 2.4.x
Closes gh-25825
2021-03-29 15:46:50 -07:00
Phillip Webb 26dd1b9a26 Update deprecations with for removal targets
Update all deprecation tags to include a removal target.

Closes gh-25808
2021-03-29 15:44:58 -07:00
Brian Clozel 61573fbf14 Record server metrics for cancelled connections
Prior to this commit, the Actuator instrumentation for WebFlux servers
would not record metrics in two cases:

* the client disconnects before the response has been sent
* a server timeout is triggered before the response is sent

This commit improves the existing instrumentation to record metrics in
these cases. Since the causes of timeouts/disconnections can vary a lot,
the chosen "outcome" tag for metrics is "UNKNOWN".

Closes gh-23606
2021-03-29 21:31:18 +02:00
Andy Wilkinson 9cc7f0b54d Generalize script-based DB initialization and add R2DBC initializer
See gh-24741
2021-03-29 11:51:02 +01:00
Phillip Webb 38584f0694 Merge branch '2.4.x'
Closes gh-25785
2021-03-24 12:24:14 -07:00
Phillip Webb 5274cf2459 Merge branch '2.3.x' into 2.4.x
Closes gh-25784
2021-03-24 12:23:44 -07:00
Phillip Webb 130cc5b036 Chain caught InvalidEndpointRequestExceptions
Update `AbstractWebMvcEndpointHandlerMapping` to chain any caught
InvalidEndpointRequestExceptions so that a more complete stacktrace
is available. The exception has also been updated to a
`ResponseStatusException` so that the reason can be propagated.

Fixes gh-25642
2021-03-24 12:22:26 -07:00
Andy Wilkinson 90b4ced7a6 Move DataSource init auto-config out of DataSourceAutoConfiguration
Previously, the auto-configuration for DataSource initialization and
the properties used to configure it were part of the general
DataSource auto-configuration and properties.

This commit moves the auto-configuration of DataSource initialization
out into a separate top-level auto-configuration class. Similarly,
the properties for configuring DataSource initialization have been
moved from `spring.datasource.*` into `spring.sql.init.*`.

The old initialization-related `spring.datasource.*` properties have
been deprecated but can still be used. When they are used, they new,
separate initialization auto-configuration will back off. In other
words, the initialization related `spring.datasource.*` properties
and the `spring.sql.init.*` properties cannot be used in combination.

Closes gh-25323
2021-03-24 14:57:29 +00:00
Phillip Webb 11a94ee6f0 Merge branch '2.3.x' into 2.4.x 2021-03-23 12:52:07 -07:00
Phillip Webb 82127fdaa3 Update copyright year of changed files 2021-03-23 12:50:49 -07:00
Andy Wilkinson ce3dfc5792 Merge branch '2.4.x'
Closes gh-25767
2021-03-23 13:42:15 +00:00
Andy Wilkinson 33cf8b3bc4 Merge branch '2.3.x' into 2.4.x
Closes gh-25765
2021-03-23 13:06:35 +00:00
Andy Wilkinson bf6f36a783 Apply any root URI to RestTemplate metric's URI tag
Previously, a root URI configured via RestTemplateBuilder's rootUri
method and RootUriTemplateHandler was not taken into account when
generated the URI tag for RestTemplate request metrics.

This commit updates MetricsClientHttpRequestInterceptor to be aware
of RootUriTemplateHandler and capture the URI template once the
root URI has been applied.

Fixes gh-25744
2021-03-23 13:05:54 +00:00
Phillip Webb 26ee346510 Polish 'Support OpenMetrics text format with Prometheus'
Closes gh-25564
2021-03-18 20:50:43 -07:00
Andy Wilkinson 11b4a19dee Support OpenMetrics text format with Prometheus
Update `PrometheusScrapeEndpoint` so that it can produce both classic
Prometheus text output as well as Openmetrics output.

See gh-25564
2021-03-18 20:50:40 -07:00
Phillip Webb c81a0223cc Refine 'Allow operations to produce different output'
Refine the new `Producible` support so that it can also be used with
`@ReadOperation`, `@WriteOperation` and `@DeleteOperation` annotations.

This update allows the same enum to be used both as an argument and as
an indicator of the media-types that an operation may produce.

Closes gh-25738
2021-03-18 20:50:27 -07:00
Andy Wilkinson 1ec49cee8b Allow operations to produce different output
Update the actuator @Enpoint` infrastructure code so that operations
may inject enums that indicate the type of output to produce. A new
`Producible` interface can be implemented by any enum that indicates
the mime-type that an enum value produces.

The new `OperationArgumentResolver` provides a general strategy for
resolving operation arguments with `ProducibleOperationArgumentResolver`
providing support for `Producible` enums. Existing injection support has
been refactored to use the new resolver.

See gh-25738
2021-03-18 20:36:18 -07:00
Phillip Webb 663fd8ce5e Update copyright year of changed files 2021-03-18 14:49:52 -07:00
Stephane Nicoll 2c8e78b082 Merge branch '2.4.x'
Closes gh-25574
2021-03-10 15:15:42 +01:00
Stephane Nicoll 6840440220 Merge branch '2.3.x' into 2.4.x
Closes gh-25573
2021-03-10 15:15:21 +01:00
Stephane Nicoll f38e863fbc Properly subscribe to CloseableConnectionFactory#close
Closes gh-25565
2021-03-10 15:03:27 +01:00
Stephane Nicoll 36f8a7b9a6 Upgrade copyright year of changed files
See gh-25451
2021-02-27 11:23:07 +01:00
izeye c823f44e76 Polish
See gh-25451
2021-02-27 11:22:05 +01:00
Andy Wilkinson f09630f73c Allow additional keys to be configured for value sanitization
Closes gh-25384
2021-02-24 19:28:29 +00:00
Andy Wilkinson 10ef991e1d Sanitize sensitive portion of the value of url and urls keys
Closes gh-25387
2021-02-24 14:42:25 +00:00
izeye 9f0f7d59ef Fix Javadoc since tag for ConfigurationPropertiesReportEndpointWebExtension
See gh-25314
2021-02-16 14:32:47 +01:00
Stephane Nicoll a16a2de3c3 Merge branch '2.4.x'
Closes gh-25296
2021-02-15 10:13:16 +01:00
Stephane Nicoll 0bc03c7141 Associate application classloader to auto-configured Hazelcast instance
Closes gh-24836
2021-02-15 10:08:23 +01:00
Stephane Nicoll b92bb9332b Polish "Filter properties with a particular prefix"
See gh-24718
2021-02-10 17:32:18 +01:00
bono007 ad7c69a9cd Filter properties with a particular prefix
This commit improves the configprops endpoint to allow filtering
properties based on a particular prefix

See gh-24718
2021-02-10 15:30:02 +01:00
Stephane Nicoll 948f61b4ca Polish contribution
See gh-25006
2021-02-09 09:10:56 +01:00
dreis2211 634dd979d1 Migrate from deprecated methods in AbstractWebFluxEndpointHandlerMapping
See gh-25006
2021-02-09 09:10:42 +01:00
Andy Wilkinson db781a0d84 Merge branch '2.4.x'
See gh-25077
2021-02-02 15:14:18 +00:00
Andy Wilkinson 788a42d694 Merge branch '2.3.x' into 2.4.x
See gh-25076
2021-02-02 15:12:27 +00:00
Andy Wilkinson 67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb 61502bde9a Replace deprecated constructor with mutate builder
Update `ControllerEndpointHandlerMapping` to use the new `mutate()`
builder rather than deprecated constructors.

Closes gh-24999
2021-01-26 22:42:18 -08:00
Phillip Webb c9a2c4e326 Merge branch '2.4.x' 2021-01-26 19:06:48 -08:00
Phillip Webb d06407ec0a Update copyright year of changed files 2021-01-26 19:06:14 -08:00
Phillip Webb ab0a628d81 Merge branch '2.4.x' 2021-01-26 17:38:11 -08:00
Phillip Webb d95d7a0245 Update code for Spring Framework 5.3.4
See gh-24998
2021-01-26 17:35:54 -08:00
Andy Wilkinson d15ec4cdb4 Upgrade to Liquibase 4.2.2
Closes gh-24952
2021-01-21 09:47:58 +00:00
Stephane Nicoll 012a199773 Remove Spring Data Solr support
In preparation to the upgrade to Spring Data 2021.0, this commit removes
auto-configuration for Spring Data Solr.

Closes gh-24939
2021-01-20 15:03:42 +01:00
Andy Wilkinson 48002e969f Merge branch '2.4.x'
Closes gh-24882
2021-01-19 10:53:41 +00:00
Andy Wilkinson 3ad2832cb2 Fix pattern extraction when MVC is using a PathPatternParser
Fixes gh-24874
2021-01-19 10:34:11 +00:00
Stephane Nicoll 0669f5604d Merge branch '2.4.x'
Closes gh-24873
2021-01-18 17:09:01 +01:00
Stephane Nicoll 59b01324ae Merge branch '2.3.x' into 2.4.x
Closes gh-24872
2021-01-18 17:08:36 +01:00
Stephane Nicoll 1ad5a3fe2e Update copyright of changed file
See gh-24753
2021-01-18 17:01:31 +01:00
izeye ddfa1e632b Make MetricsClientHttpRequestInterceptor defensive against metrics recoding failures
See gh-24753
2021-01-18 17:00:26 +01:00
Stephane Nicoll 2c2c160579 Remove deprecated code
See gh-24806
2021-01-15 14:14:33 +01:00
Phillip Webb 304c49d73f Merge branch '2.4.x'
Closes gh-24795
2021-01-12 17:38:27 -08:00
Phillip Webb 26f143b8d3 Support @Name annotation on /actuator/configprops
Update `ConfigurationPropertiesReportEndpoint` so that supports
constructor parameters annotated with `@Name`.

Fixes gh-24713
2021-01-12 17:38:17 -08:00
Stephane Nicoll 632c1239e6 Polish "Add support for GET requests for /actuator/startup"
See gh-24717
2021-01-11 09:12:53 +01:00
bono007 4b8d6efc12 Add support for GET requests for /actuator/startup
See gh-24717
2021-01-11 08:49:06 +01:00
Phillip Webb 45ca4a5a56 Merge branch '2.4.x'
Closes gh-24673
2021-01-06 12:34:13 -08:00
Phillip Webb ac4243d615 Merge branch '2.3.x' into 2.4.x
Closes gh-24672
2021-01-06 12:33:53 -08:00
Phillip Webb 52e47c4275 Fix test for JSR-350 @Nonnull
Closes gh-24647
2021-01-06 12:33:25 -08:00
Phillip Webb 2dfb9b0911 Merge branch '2.4.x'
Closes gh-24671
2021-01-06 12:24:05 -08:00
Phillip Webb 2b497b6aff Merge branch '2.3.x' into 2.4.x
Closes gh-24670
2021-01-06 12:23:45 -08:00
Phillip Webb 848ed65f5b Add test for JSR-350 @Nonnull
Closes gh-24647
2021-01-06 12:04:58 -08:00
Phillip Webb bd3dd0a526 Merge branch '2.4.x'
Closes gh-24655
2021-01-05 14:08:57 -08:00
Phillip Webb ab8080353e Merge branch '2.3.x' into 2.4.x
Closes gh-24654
2021-01-05 14:08:41 -08:00
Phillip Webb 2ad9a47d08 Support JSR-305 annotations on endpoint methods
Update `OperationMethodParameter` to additionally support JSR-305 based
`@Nullable` annotations.

Closes gh-24647
2021-01-05 14:07:22 -08:00
Stephane Nicoll 5da27ea57a Polish "Reduce the overhead of char[] creation"
See gh-24204
2020-12-21 10:24:46 +01:00
Marten Deinum 5121ca5d17 Reduce the overhead of char[] creation
See gh-24204
2020-12-21 10:21:49 +01:00
Phillip Webb 72d36e0c07 Update copyright year of changed files 2020-12-10 10:46:04 -08:00
Stephane Nicoll 105cf591bf Merge branch '2.3.x'
See gh-24418
2020-12-10 13:52:49 +01:00
Stephane Nicoll ab99de4349 Polish
See gh-24418
2020-12-10 13:52:11 +01:00
Stephane Nicoll 0d472d6f74 Start building against Spring Data 2020.0.2 snapshots
See gh-24284
2020-12-09 14:16:47 +01:00
Phillip Webb 30c27274e2 Merge branch '2.3.x'
Closes gh-24339
2020-12-04 18:31:55 -08:00
Phillip Webb 5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
2020-12-04 18:21:57 -08:00
Phillip Webb d8a05090b3 Fix checkstyle BDD Mockito violations
See gh-24337
2020-12-04 18:06:54 -08:00
Phillip Webb 837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
dreis2211 0389a07f7c Remove deprecated code in EndpointDiscoverer
See gh-24317
2020-12-03 16:59:29 -08:00
Scott Frederick 01478a25b4 Handle wrapper types in Env actuator
This commit modifies the actuator `EnvironmentEndpoint` to allow
primitive wrapper types to be serialized in the response data
structure.

Fixes gh-24307
2020-12-01 15:12:13 -06:00
Stephane Nicoll b1678ee6ad Merge branch '2.3.x'
Closes gh-24251
2020-11-25 14:36:16 +01:00
Stephane Nicoll 9b992af34b Merge branch '2.2.x' into 2.3.x
Closes gh-24250
2020-11-25 14:31:30 +01:00
Stephane Nicoll d506f0c73e Polish "Reduce redis health indicator info command result size"
See gh-24208
2020-11-25 14:27:07 +01:00
xJoeWoo 99cc3f4bfc Reduce redis health indicator info command result size
See gh-24208
2020-11-25 14:23:57 +01:00
Andy Wilkinson 11c81ad245 Merge branch '2.3.x'
Closes gh-24223
2020-11-20 11:48:51 +00:00
Andy Wilkinson 7efa1e47aa Merge branch '2.2.x' into 2.3.x
Closes gh-24222
2020-11-20 11:48:25 +00:00
Andy Wilkinson 12f2529be5 Allow actuator endpoint to have responses with custom HTTP statuses
Fixes gh-24123
2020-11-20 11:38:31 +00:00
Stephane Nicoll e708667fc0 Merge branch '2.3.x'
Closes gh-24194
2020-11-18 10:09:23 +01:00
Stephane Nicoll 76912d1952 Merge branch '2.2.x' into 2.3.x
Closes gh-24193
2020-11-18 10:09:03 +01:00
Stephane Nicoll d3440880c4 Polish "Avoid unnecessary pattern compilation in WebFluxTags"
See gh-24147
2020-11-18 09:58:03 +01:00