This commit ensures that Health probes are automatically enabled when
the application runs on Cloud Foundry. This was already the case for
Kubernetes, but now that Cloud Foundry supports this feature we should
do the same.
Closes gh-39804
As of spring-projects/spring-framework#24560, Spring provides additional
metadata for scheduled tasks:
* next execution time
* last execution outcome (including status, time and raised exception)
This commit leverages this information to enhance the existing
`scheduledtasks` Actuator endpoint.
Closes gh-17585
- Deprecate Deprecate @MockBean and @SpyBean in favor of Spring
Framework 6.2's @MockitoBean and @MockitoSpy
- Migrate usages of @MockBean and @SpyBean to @MockitoBean and
@MockitoSpy
Signed-off-by: Jakob Wanger <jakobwanger@gmail.com>
See gh-39864
Depending on what tests had already run, Otel tests in
BaggagePropagationIntegrationTests could fail due to missing baggage
related entries in the MDC. The entries were missing if Otel's
ContextStorageWrappers had been marked as initialized without an
EventPublishingContextWrapper containing event publisher that will
publish to Slf4JBaggageEventListener.
ContextStorageWrappers uses a static so this commit avoids to problem
by forking a new classpath in BaggagePropagationIntegrationTests. This
ensures that any previous static state in ContextStorageWrappers has
no effect upon BaggagePropagationIntegrationTests.
This adds a property to provide some indicator that a set of
applications are part of a larger "business application" so that they
can be viewed in metrics, portals, traces and more.
See gh-39957
There are now three new properties, which control the trace exporting on
a more fine-grained level:
- management.otlp.tracing.export.enabled
- management.wavefront.tracing.export.enabled
- management.zipkin.tracing.export.enabled
They default to null, and if set, take precedence over the global
management.metrics.enabled property.
Closes gh-34620
Prior to this commit, applications could declare Actuator Endpoints
using web framework-specific annotations, such as `@ServletEndpoint`,
@ControllerEndpoint and @RestControllerEndpoint.
Such annotations are closely tied to the programming model of specific
web technologies, such as Servlet or Spring MVC. Unlike other
`@Endpoint` support, they are not portable and will not work
transparently over blocking/reactive and transports.
Because of the strong adherence of this support with the underlying
infrastructure, it makes it impossible to evolve the implementation of
Actuator support without breaking this use case. The reference
documentation has been advocating for using `@Endpoint` and
`@*Operation` for custom endpoints for a long time now.
This commit deprecates this specific support in favor of the recommended
approach.
Closes gh-31768
Prior to this commit, the `ClientObservationConventionAdapter` would
overwrite a request builder attribute. This would happen when the
request is not fully built when the observation starts. At that point,
the tags are built for long task timers, but not for the actual metric.
This effectively overrides the correct value of the URI template in the
builder.
This commit removes this builder update which was invalid in the first
place.
Fixes gh-40330
Deprecates the support for simpleclient but ensures that it can work in
conjunction with support for the latest Prometheus client
auto-configuration.
This involves breaking changes to update public classes to support the
latest Prometheus client. Deprecated support for Prometheus simpleclient
is provided in renamed classes.
See gh-40023
Properties under `server.ssl.server-name-bundles` and
`management.server.ssl.server-name-bundles` can be used to configure
mappings of host names to SSL bundles to support SNI in embedded web
servers.
Closes gh-26022
Update `ZipkinHttpClientSenderTests` to use one mock server per test
rather than a shared static. For some reason the mock server sometimes
seems to get itself in a deadlock state which causes the client to
fail with a `HttpTimeoutException`.
This commit simplifies the generics used for SessionRepository and
FindByIdNameSessionRepository as their type signatures already declare
that `S` extends from `Session`.
See gh-39751
Brave can work without zipkin2 on the classpath, OpenTelemetry can't.
To not force users to have zipkin2 on the classpath, move it into the
OpenTelemetry auto-configuration.
See gh-39049
This commit moves the "micrometer.observations.*" configuration
properties to "management.observations.*" namespace, as it was
introduced in the wrong namespace initially.
The former configuration property is deprecated and will be removed in a
future version.
Fixes gh-39600
At present, Actuator sessions endpoint is supported only on a Servlet stack and also requires an indexed session repository. With Spring Session moving to non-indexed session repositories as a default for some session stores, this means that sessions endpoint won't be available unless users opt into a (non-default) indexed session repository.
This commit updates SessionEndpoint so that it is able to work with a non-indexed session repository. In such setup, it exposes operations for fetching session by id and deleting the session.
Additionally, this also adds support for reactive stack by introducing ReactiveSessionEndpoint and its auto-configuration support.
See gh-32046
Prior to this commit, the Micrometer annotations support (`@Timed`,
`@Counted`...) was guarded by the presence of both Micrometer and
AspectJ on the classpath.
This signal is too weak, considering the startup performance impact and
the fact that the AspectJ dependency can be brought transitively in many
cases.
This commit adds a new `micrometer.observations.annotations.enabled`
property that is set to `false` by default to only process the
annotations support when this property is enabled.
Fixes gh-39128
This is a follow-on from afad358 and ensures that the auto-configured
security for Actuator in a WebFlux app has an authentication manager
to back its use of HTTP basic and form login.
Fixes gh-39069
This auto-configuration ensures, if Micrometer Tracing is on the
classpath, that there is always a tracer. It backs off if there is
already a tracer, for example contributed by the Brave or the Otel
auto-configurations, which are run before.
See gh-38568
Prior to this commit, we set in gh-37388 the ObservationRegistry on the
auto-configured JmsTemplate bean. This enables observations and context
propagation when sending JMS messages.
This commit applies the same to the `DefaultJmsListenerContainerFactory`
and the `DefaultJmsListenerContainerFactoryConfigurer`, in order to
enable observations on `@JmsListener` annotated methods.
This commit also refactors the support implemented in gh-37388 to avoid
relying on a bean post processor and instead set the observation
registry directly in the main auto-configuration: while Micrometer core
is an actuator-only dependency, Micrometer Observation API is a compile
dependnecy for spring-jms itself and there is no need to separate
concerns there.
Fixes gh-38613
Previously, the child management context was created when the
parent context's web server was initialized and it wasn't stopped
or closed until the parent context was closed. This resulted in
the child context being left running when the parent context was
stopped. This would then cause a failure when the parent context
was started again as another web server initialized event would be
received and a second child management context would be started.
This commit updates the initialization of the child management
context to integrate it with the lifecycle of the parent context.
The management context is now created the first time the parent
context is started. It is stopped when the parent context is
stopped and restarted if the parent context is started again.
This lifecycle management is done using a phase that ensures
that the child context is not started until the parent context's
web server has been started.
Fixes gh-38502
The mocks being static meant that their state was shared across each
test in the class. This resulted in the tests being order dependent.
This commit uses instance variables to hold the mocks, thereby
ensuring that they're recreated for each test as part of the standard
JUnit lifecycle.
Closes gh-38363
This introduces two different attributes for, e.g. the Spring Framework
version: the "normal" one, e.g. 6.1.0-SNAPSHOT, and the Antora one,
e.g. 6.1.
Spring Framework's reference documentation is still broken when using
SNAPSHOT versions, see spring-framework/gh-31480.
See gh-38000