This commit introduces the OpenTelementryAttributes class that fetches
OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME environment variables
and merges it with user-defined resource attributes.
Besides that, this commit includes spec-compliant proper handling of
OTEL_RESOURCE_ATTRIBUTES in OtlpMetricsPropertiesConfigAdapter and
OpenTelemetryAutoConfiguration.
See gh-44394
Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
Previously, when Actuator expected to find multiple beans of the same
type, it used Map<String, Type> to inject them. Unfortunately, this
does not include beans that are not default candidates and there's
no way to request that autowiring includes such beans with Map-based
injection.
This commit switches from Map-based injection to querying the bean
factory for the desired beans. This is done using
SimpleAutowireCandidateResolver's new helper method,
resolveAutowireCandidates, that returns a Map<String, Type> of
beans including those that are not default candidates but excluding
those that are not autowire candidates.
Closes gh-43481
Prior to this commit, the Micrometer instrumentation support would
auto-configure a `ServerHttpObservationFilter` for creating observations
in Spring MVC applications.
As of Spring Framework 6.2, applications can extend this filter class to
get notified of the observation scope being opened.
This commit contributes a new `TraceHeaderObservationFilter`
implementation that writes the current Trace Id (if present) to the
`X-Trace-Id` HTTP response header.
This feature is disabled by default, applications will need to enable
`management.observations.http.server.requests.write-trace-header`.
`
Closes gh-40857
Previously, when health probes were enabled, the post-processor of
AutoConfiguredHealthEndpointGroups resulted in the bean no longer
implementing AdditionalPathMapper. This then caused a
ClassCastException when working with AdditionalPathMapper beans
in EndpointRequest's additional path mapping support.
This commit updates the type returned by the post-processor to
implement both HealthEndpointGroups and AdditionalPathMapper, as
AutoConfiguredHealthEndpointGroups does. Its implementation of
getAdditionalPaths produces a result that combines both the
additional paths of the original HealthEndpointGroups bean and its
own additional paths for the probes.
Fixes gh-44052
Previously, customization was performed in two places:
1. By customizers defined in the reactive and servlet web servlet
factory auto-configuration
- ServletWebServerFactoryAutoConfiguration
- ReactiveWebServerFactoryAutoConfiguration
2. By a ManagementWebServerFactoryCustomizer that delegates to
customizers of certain types found in the application context
hierarchy.
This led to some double customization as the customizers registered
by the auto-configuration classes were also found and called by the
ManagementWebServerFactoryCustomizer.
Additionally, the ManagementWebServerFactoryCustomizer would find
customizers from the parent context registered by
EmbeddedWebServerFactoryCustomizerAutoConfiguration.
This commit reworks the customization of the management web server
factory to remove the double customization.
ManagementWebServerFactoryCustomizer no longer delegates to
customizers that it finds in the context hierarchy. This
prevents the customizers defined in the reactive and servlet web
server factory auto-configuration classes from being called twice.
Additionally, EmbeddedWebServerFactoryCustomizerAutoConfiguration is
now registered in the child context so that its customizers continue
to be called when preparing the management context web server
factory.
Closes gh-44151
Add new methods to `QuartzEndpoint` and `QuartzEndpointWebExtension`
to allow a Quartz job to be triggered on demand.
See gh-43086
Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
It registers a 'ssl.chains' gauge to count the number of chains with
different statuses (valid, expired, not yet valid, will expire soon).
Additionally, it registers a 'ssl.chain.expiry' gauge for every
certificate in a chain, tracking the seconds until expiry.
This binder reacts on bundle updates and new bundle registrations.
Closes gh-42030
Add `@ConditionalOnBooleanProperty` annotation to deal with
boolean properties and primarily for features that users toggle
using `.enabled` properties.
Closes gh-43704
This commit updates the assertion of a test that relies on
https://self-signed.badssl.com to only fail if a SSLException is thrown.
This is a temporary measure until we run the test against a local
instance we control.
See gh-43708
The lowercase form of the endpoint ID needs to be used so that
relaxed matching of properties, as provided by
ConfigurationPropertySources, works as intended. Without this
change the id of the endpoint in a property had to be an exact
match of the endpoint's ID.
Closes gh-43302
This property provides more fine-grained control over log export:
- management.otlp.logging.export.enabled
By default, it is set to null, but if defined,
it takes precedence over the global management.logging.export.enabled
property
See gh-42813
This commit reworks the support for enabling and disabling endpoints,
replacing the on/off support that it provided with a finer-grained
access model that supports only allowing read-only access to endpoint
operations in addition to disabling an endpoint (access of none) and
fully enabling it (access of unrestricted).
The following properties are deprecated:
- management.endpoints.enabled-by-default
- management.endpoint.<id>.enabled
Their replacements are:
- management.endpoints.access.default
- management.endpoint.<id>.access
Similarly, the enableByDefault attribute on @Endpoint has been
deprecated with a new defaultAccess attribute replacing it.
Additionally, a new property has been introduced that allows an
operator to control the level of access to Actuator endpoints
that is permitted:
- management.endpoints.access.max-permitted
This property caps any access that may has been configured for
an endpoint. For example, if
management.endpoints.access.max-permitted is set to read-only and
management.endpoint.loggers.access is set to unrestricted, only
read-only access to the loggers endpoint will be allowed.
Closes gh-39046
This is an attempt to stabilize the tests. They are currently flaky
due to a timeout that appears to occur because the mock web server isn't
responding quickly enough. A larger timeout will either confirm this if
the tests stabilize or indicate that the problem has a different cause
if they do not stabilize.
Closes gh-42375
A task's last execution is absent if it has not yet been executed.
This commit updates the documentation test to accommodate this
possibility.
See gh-42351
Add `toAdditionalPaths(...)` methods on the servlet and reactive
`EndpointRequest` classes to support matching of additional paths.
A new `AdditionalPathsMapper` interface provides the mappings between
endpoint IDs and any additional paths that they might use. The existing
`AutoConfiguredHealthEndpointGroups` class has been updated to implement
the interface.
Auto-configurations have also been updated so that additional health
endpoint paths (typically `/livez` and `/readyz`) are permitted
when using Spring Security without any custom configuration.
Fixes gh-40962
A task's next execution time is unknown if, for example, it's
currently running. When it's unknown the nextExecution.time will be
missing from the json describing the task. This commit updates the
documentation test to accommodate this possibility.
Closes gh-42351
This commit uses DataSource.isWrapperFor and DataSource.unwrap to detect
if a DataSource is an AbstractRoutingDataSource. Previously, it relied
on instanceof which does not account for cases where the datasource has
been proxied.
See gh-42313
Add `OpenTelemetryEventPublisherBeansTestExecutionListener` JUnit
class to automatically trigger early addition of the `ContextStorage`
wrapper. The listener has also been updated with a static `addWrapper()`
method that can be called directly for other test frameworks.
Closes gh-42005
Otlp Tracing's exporter is configured using Transport. Current support
for service connections read the mapped port for HTTP transport 4318.
This commits adds support to read port for GRPC transport 4317.
See gh-41333
This commit restores auto-configuration for using an Embedded broker
with ActiveMQ classic.
Contrary to its 2.7.x version, "spring-boot-starter-activemq" no longer
adds the broker for consistency with Artemis, and to keep the existing
3.x behavior. Rather than "inMemory", a "s.a.embedded.enabled"
property has been reintroduced that matches the name used by Artemis.
The documentation has been updated to mention that the broker
dependency must be added to use it.
Closes gh-38404