Commit Graph

287 Commits (573f736374b9790ccba3b2f820b484a103b7e7a4)

Author SHA1 Message Date
Madhura Bhave fddc9e9c7e Support multiple paths in DispatcherServletPathProvider
Closes gh-13603
6 years ago
Andy Wilkinson a5d20ffed7 Avoid NPE when creating method tag for WebFlux req with non-standard method
Previously, a NullPointerException would occur when WebFluxTags
attempted to create a method Tag for a request with a non-standard
method.

This commit updates WebFluxTags to use getMethodValue(), which will
never return null, rather than getMethod(), which may return null,
when determining the tag's value for the given request.

Closes gh-13596
6 years ago
Andy Wilkinson 911453d478 Merge branch '1.5.x' into 2.0.x 6 years ago
Madhura Bhave ed734d7e43 Trace filter ignores invalid requests
Fixes gh-12987
7 years ago
Phillip Webb 571c50e43f Switch to functional web code to use static imports
Update the samples and tests to use the more idiomatic static import
style.
7 years ago
Madhura Bhave 60a4d67b13 Handle special characters in TraceableHttpServletRequest
Fixes gh-13273
7 years ago
Andy Wilkinson ea51cfabca Avoid uri tag explosion when use of path variable is undetected
Previously, WebMvcTags would fall back to using the request’s path
info if Spring MVC’s best matching path pattern attribute was not
available. For non-Spring MVC web frameworks that support path
variables, such as Jersey, this led to an explosion of URI tags that
could exhaust the heap.

Closes gh-12447
7 years ago
Stephane Nicoll faa9910e46 Enable cache when a SecurityContext parameter is used
This commit restores caching for the main read operation when the
SecurityContext does not expose a principal (i.e. guest access).

Closes gh-13238
7 years ago
Stephane Nicoll 4259817572 Fix extension discovery when endpoint instance is sub-classed
This commit fixes endpoint extension discovery when the related endpoint
is sub-classed. Previously, a strict by type check was applied against
the `endpoint` attribute of `EndpointExtension`.

Rather than using a `Class` check, this commit extracts the id of an
endpoint and uses it to match its extension, if any.

Closes gh-13082
7 years ago
Johnny Lim bd2053aa17 Use more Tag constants
Closes gh-13286
7 years ago
Johnny Lim f385a1cb11 Polish
Closes gh-13243
7 years ago
Phillip Webb 2dc4f1df00 Polish 7 years ago
Johnny Lim 75639aa682 Polish
Closes gh-13192
7 years ago
Stephane Nicoll 2be1c8f527 Polish "Set classloader for JMX endpoints to application classloader"
Closes gh-12209
7 years ago
David Herberth e44c81672f Set classloader for JMX endpoints to application classloader
See gh-12209
7 years ago
dreis2211 e6a23fa3ff Remove unnecessary semicolons
Closes gh-13144
7 years ago
Andy Wilkinson c826310fd1 Polish 7 years ago
Phillip Webb 975e986fef Polish 7 years ago
Phillip Webb 5b3cb8a698 Update copyright header year for changed files 7 years ago
Phillip Webb 57bfbfb3ad Fix checkstyle errors 7 years ago
Phillip Webb 6e09e497f2 Formatting 7 years ago
Phillip Webb 2d70a7ae5e Polish caught exception names
Prefer `ex` over `e`.
7 years ago
Phillip Webb 41efea51a7 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
7 years ago
Phillip Webb e125085993 Merge branch '1.5.x' into 2.0.x 7 years ago
Andy Wilkinson f019d5c85b Merge branch '1.5.x' into 2.0.x 7 years ago
Stephane Nicoll 2b98b11c12 Polish "Less object instantiation in WebMvcTags"
Closes gh-12894
7 years ago
Jon Schneider d676147680 Less object instantiation in WebMvcTags
See gh-12894
7 years ago
Stephane Nicoll 0bc7bef5e5 Properly handle InvalidEndpointRequestException
This commit makes sure that `InvalidEndpointRequestException` is wrapped
in a `ReflectionException` when invoked via JMX.

Closes gh-12857
7 years ago
dreis2211 2bbf438c36 Fix duplicate words in comments
Closes gh-12866
7 years ago
Stephane Nicoll fa542bacc0 Translate user-defined exception when invoking JMX operation
This commit makes sure to respect the MBeanServer#invoke contract by
wrapping any user-defined exception in an MBeanException. Also, any
exception not from the JDK is translated, as it may lead to unexpected
issue on the client if that class isn't present. This is consistent
with our operation result mapping strategy.

Closes gh-10448
7 years ago
Brian Clozel b2e7be17ab Polish gh-11514
As pointed out by Rossen in gh-11514 comments, a handler might commit
the response and then send an error signal in the pipeline. In this
case, adding a callback to `beforeCommit` is useless because it won't be
triggered. In those cases, we need to collect metrics right away.
7 years ago
Brian Clozel 3fa8fe85af Deprecate RouterFunctionMetrics
Spring Boot now deploys both annotation-based and functional endpoints
under the same `HttpHandler`; this means the currently auto-configured
`MetricsWebFilter` is instrumenting all endpoints to produce metrics.

There is no need for a WebFlux functional specific support.
This commit removes mentions of `RouterFunctionMetrics` in the docs and
deprecates that class.

Closes gh-12833
7 years ago
Brian Clozel 77be10e7bc Fix "status" metrics tag for error responses
Prior to this commit, the metrics `WebFilter` would handle exceptions
flowing through the pipeline and extract tag information right away.
Since error handling turns the exception information into error HTTP
responses later in the chain, the information extracted from the
response earlier is invalid.
In this case, the "status" information could be "200" whereas error
handlers would later set that status to "500".

This commit delays the tags extraction later in the process, right
before the response is comitted. The happy path is not changed, as
handlers signal that the response is fully taken care of at that point.

Fixes gh-11514
7 years ago
Stephane Nicoll e8fac7d9c4 Properly discover endpoints that are proxied
Previously to this commit, if a `@ControllerEndpoint`,
`@RestControllerEndpoint` or `@ServletEndpoint` annotated bean was
proxied, the endpoint wasn't properly detected.

This commit makes sure that annotation retrieval works on the user class
while preserving the get (vs. find) retrieval semantic

Closes gh-12441
7 years ago
Stephane Nicoll 86b96254a1 Migrate to ApplicationContextRunner 7 years ago
Johnny Lim f03849d502 Polish
See gh-12812
7 years ago
Andy Wilkinson 8d5b9f37d5 Merge branch '1.5.x' 7 years ago
Phillip Webb 598e9bb842 Polish 7 years ago
Brian Clozel f6d16c8b99 Align WebFluxTags uri support on WebMvcTags
This commit ensures that `WebFluxTags` not only relies on
`BEST_MATCHING_PATTERN_ATTRIBUTE` or request URI to provide the "uri"
tag information.

To avoid cardinality explosion, HTTP not found and redirects are
assigned fixed uri tags.

Closes gh-12685
7 years ago
Phillip Webb 98a2a91d16 Polish 7 years ago
Brian Clozel ebb2f70e0b Make WebMvgTags use matched patterns for HTTP 404
Prior to this commit, `WebMvcTags' would always mark as "NOT_FOUND" or
"REDIRECTION" *any* exchange with responses of 404 and 3xx status, even
if those responses are actually returned by Controller handlers.

This commit checks inverts those checks and first considers if the
"BEST_MATCHING_PATTERN_ATTRIBUTE" request attribute is present and uses
it - then falls back to "NOT_FOUND" and "REDIRECTION" to avoid
cardinality explosion.

Fixes gh-12577
7 years ago
Madhura Bhave 8b29823885 Prevent StackOverFlowException in metadata processor
Fixes gh-11037
7 years ago
dreis2211 3b0f6e7168 Use Supplier variants of Assert methods
See gh-12630
7 years ago
Johnny Lim 625bf93598 Polish
See gh-12584
7 years ago
Phillip Webb 78534a753d Polish "Iterate map by using lambda function"
See gh-12528
7 years ago
igor-suhorukov ffc883b005 Iterate map by using lambda function
Closes gh-12528
7 years ago
Phillip Webb 6e2ecb8a43 Fix broken endpoint integration tests
Ensure that JSON response is returned when extracting data from the
error details.

See gh-12513
7 years ago
Andy Wilkinson 2da4897aa8 Polish 7 years ago
Johnny Lim 2e6914ea88 Add missing super() calls
Closes gh-12459
7 years ago
dreis2211 8626daf135 Replace Mockito.times(0) with Mockito.never()
Closes gh-12475
7 years ago