Commit Graph

2109 Commits (f6b96040add4cd0326f8343555deac3ae596ac99)

Author SHA1 Message Date
Mirko Sobeck ff04f009c0 Add missing Micrometer PropertiesConfigAdapterTests
Closes gh-33743
2 years ago
Andy Wilkinson 5cef7632ee Start building against Spring Framework 6.0.5 snapshots
This commit adapts to the changes made for
spring-projects/spring-framework#29885.

Closes gh-34152
2 years ago
Andy Wilkinson 1c9e22c845 Merge branch '3.0.x'
Closes gh-34121
2 years ago
Andy Wilkinson 3551030e3f Add ObservationFilter beans to auto-configured ObservationRegistry
Fixes gh-33968
2 years ago
Moritz Halbritter 23f1c896c9 Merge branch '3.0.x'
Closes gh-34015
2 years ago
Johnny Lim bc7fc90550 Replace Base64Utils with JDK's Base64
See gh-33967
2 years ago
Marcin Grzejszczak 06aec1a9bf Adds CompositeSpanExporter
Micrometer Tracing comes with 3 generic interfaces, SpanExportingPredicate,
SpanReporter and SpanFilter, thanks to which you can decide whether you
want to export a span, how you want to report it and how to mutate it
regardless of which tracer library you are using.

Without this change usage of these 3 interfaces is not possible
for OpenTelemetry.

With this change we're putting all SpanExporters to the
CompositeSpanExporter and apply the exporters only after predicates,
filtering and reporting took place.

See gh-34002
2 years ago
Eddú Meléndez 92dd004375 Add property `headers` in `OtlpProperties`
In Micrometer 1.11, headers property has been introduced.

See gh-34004
2 years ago
Krzysztof Krason 0e68cae57f Use instanceof patterns
See gh-33987
2 years ago
Krzysztof Krason a9c547e767 Use text blocks
See gh-33987
2 years ago
Krzysztof Krason 6e46423983 Use diamond operators
See gh-33987
2 years ago
Phillip Webb 5120242996 Merge branch '2.7.x' into 3.0.x 2 years ago
Krzysztof Krason 888d4ac392 Use '==' rather than '.equals' with enum value
See gh-33987
2 years ago
Moritz Halbritter 31ca94833a Use parent-based sampler by default
Closes gh-33821
2 years ago
Phillip Webb 71efc55bf9 Merge branch '2.7.x' 2 years ago
Phillip Webb 7c508fa324 Update copyright year of changed files 2 years ago
Moritz Halbritter 94f4a4396c Merge branch '2.7.x'
Closes gh-33880
2 years ago
Moritz Halbritter e8d809fe65 Replace 'via' with 'over' or 'through' in the documentation
Closes gh-33878
2 years ago
Phillip Webb fad88232b9 Update copyright year of changed files 2 years ago
Phillip Webb a889c539ab Merge branch '2.7.x' 2 years ago
Phillip Webb a0fe8241a7 Update copyright year of changed files 2 years ago
Moritz Halbritter f08842019e Merge branch '2.7.x'
Closes gh-33841
2 years ago
Moritz Halbritter 96175a8e50 Use OperationParameter consistently
Closes gh-31240
2 years ago
Andy Wilkinson 433364601d Merge branch '2.7.x' 2 years ago
Andy Wilkinson 3b2e5e5292 Remove references to https://repo.spring.io/release 2 years ago
Moritz Halbritter 52760f6b78 Merge branch '2.7.x'
Closes gh-33756
2 years ago
Yongjo Lee 0440e5d1ac Fix duplicate 'the' typo
See gh-33736
2 years ago
Moritz Halbritter fe1c1edcd4 Change transient to volatile in CompositeHandlerExceptionResolver 2 years ago
Phillip Webb a2ac38e203 Update copyright year of changed files 2 years ago
Phillip Webb 1621cfd578 Merge branch '2.7.x' 2 years ago
Phillip Webb 6a0a61f1ce Refine EndpointRequest matcher `toString` and apply to reactive variant
Refine the recently introduced `EndpointRequest` matcher `toString()`
to use lower-case item names. Also applied the same logic to the
reactive variant.

See gh-33690
2 years ago
Moritz Halbritter 3b6b795c9f Merge branch '2.7.x'
Closes gh-33729
2 years ago
rishal c84399e705 Add toString method for EndpointRequestMatcher
See gh-33690
2 years ago
Krzysztof Krason cf6493f65c Simplify AssertJ assertions and also make them more readable
See gh-33653
2 years ago
Phillip Webb f588793445 Update copyright year of changed files 2 years ago
Phillip Webb 0254619782 Merge branch '2.7.x' 2 years ago
Phillip Webb e4772cf3b7 Update copyright year of changed files 2 years ago
Brian Clozel 28f9f20d39 Declare order for ServerHttpObservationFilter WebFilter
This commit declares an `@Order` for the `ServerHttpObservationFilter`
bean declaration in the Observation WebFlux auto-configuration.

This allows developers to consistently order other `WebFilter` instances
relatively to this one. Here, `@Order(Ordered.HIGHEST_PRECEDENCE + 1)`
has been chosen to align with the order of its MVC counterpart.

Fixes gh-33444
2 years ago
Brian Clozel 3310b59520 Polish 2 years ago
Brian Clozel 593b5311e9 Configure GraphQL web propagation for tracing
As of spring-projects/spring-graphql#547, Spring GraphQL introduced a
`PropagationWebGraphQlInterceptor` that propagates the incoming tracing
information in HTTP request headers into the GraphQL context.

This commit auto-configures the propagation interceptor if the
application exposes a GraphQL HTTP endpoint and if it is configured for
Tracing support.

Fixes gh-33542
2 years ago
Moritz Halbritter 725337f976 Make fields final
Closes gh-33537
2 years ago
Johnny Lim d21572a189 Resolve TODOs for observability tests
See gh-33481
2 years ago
Brian Clozel 50be8cbf91 Fix IllegalArgumentException in WebClient convention adapter
Prior to this commit, the `ClientObservationConventionAdapter` would
fail with an `IllegalArgumentException` when the observation is first
started: at this point, the carrier (the request builder here) is
present, but the full request not yet fully built.

This commit ensures that the convention adapter uses the request and, if
not available, the request builder to adapt to the
`WebClientExchangeTagsProvider`.

Fixes gh-33483
2 years ago
Johnny Lim 90589fd6d4 Polish
See gh-33384
2 years ago
Moritz Halbritter cfaade95df Add test to verify ZipkinRestTemplateBuilderCustomizer
See gh-33399
2 years ago
Moritz Halbritter 2ceee789ce Fix bug where ZipkinRestTemplateBuilderCustomizer had no effect
Closes gh-33399
2 years ago
Brian Clozel 07766c436c Apply user-provided ObservationConventions in auto-configurations
Prior to this commit, we would advise developers, as migration path from
Spring Boot 2.0-x metrics, to create `GlobalObservationConvention` beans
for the observations they want to customize (observation name or key
values).

`GlobalObservationConvention` are currently applied **in addition** to
the chosen convention in some cases, so this does not work well with
this migration path.

Instead, instrumentations always provide a default convention but also a
way to configure a custom convention for their observations. Spring Boot
should inject custom convention beans in the relevant
auto-configurations.

Fixes gh-33285
2 years ago
Jonatan Ivanov 2d40d07773 Remove Brave and OTel HTTP support in favor of instrumentation
See gh-33287
2 years ago
Stephane Nicoll 29ee5d2d9a Polish 2 years ago
Phillip Webb 12b4578e98 Further refine WavefrontProperties
See gh-33244
2 years ago
Phillip Webb c93e248c46 Refine WavefrontProperties
Remove naming properties under `management.wavefront.application`.

Closes gh-33244
2 years ago
Andy Wilkinson e63fcebcf4 Merge branch '2.7.x'
Closes gh-33256
2 years ago
Andy Wilkinson c483e662a9 Merge branch '2.6.x' into 2.7.x
Closes gh-33255
2 years ago
Andy Wilkinson fc9c036c88 Create git commit time with epoch seconds rather than milliseconds
Closes gh-33237
2 years ago
Phillip Webb fb5cdbd11c Create ApplicationTags in common WavefrontAutoConfiguration
Relocate `ApplicationTags` `@Bean` method from
`WavefrontTracingAutoConfiguration` to `WavefrontAutoConfiguration`
since it is now shared between tracing and metrics.

The `application-name`, `service-name`, `cluster-name` and `shard-name`
have also been relocated from `management.wavefront.tracing` to
`management.wavefront`.

Fixes gh-33244
2 years ago
Andy Wilkinson cd455a9f6f Restore previous serialization formatting in Actuator responses
Fixes gh-33236
2 years ago
Phillip Webb a0f39d66fe Polish 'Align Wavefront application tags support with Spring Boot 2.x'
See gh-32844
2 years ago
Glenn Oppegard 42bb4c0615 Align Wavefront application tags support with Spring Boot 2.x
Update `application-name` and `service-name` `management.wavefront`
properties to align with Spring Boot 2.x support. The properties now
use the wavefront terminology where `application` refers to an a
collection of (micro)`services`.

This commit also adds `cluster-name` and `shard-name` properties that
can be used to add additional items to the `ApplicationTags`.

See gh-32844
2 years ago
Johnny Lim 6027508cf7 Polish
See gh-33108
2 years ago
Phillip Webb 0754665973 Merge branch '2.7.x'
Closes gh-33169
2 years ago
Phillip Webb 733638cf89 Merge branch '2.6.x' into 2.7.x
Closes gh-33168
2 years ago
Phillip Webb 2a989b31aa Create Environment and apply ConversionService to management contexts
Update `ManagementContextFactory` implementations to create an
appropriate `Environment` type and to apply the `ConversionService`
from the parent context.

Prior to this commit, the management context `Environment` would not
be able to convert values from a `configtree:` source due to a missing
converter.

Fixes gh-32941
2 years ago
Brian Clozel 932f7d705f Start building against Spring Framework 6.0.0 SNAPSHOTs
See gh-33136
2 years ago
Andy Wilkinson fe72f307f4 Avoid actuator beans being ineligible for post-processing
Closes gh-33110
2 years ago
Andy Wilkinson b5e502d03b Make class package-private as it's returned from package-private method
Returning a private class from a package-private method causes the
AOT-generated source files to fail to compile as the private class is
not visible.

Closes gh-33106
2 years ago
Madhura Bhave 8cb615e9b6 Remove workarounds for SecurityContextRepository 2 years ago
Andy Wilkinson 5f6b63e277 Auto-configure span customizer beans
Closes gh-33087
2 years ago
Phillip Webb e5a0b164ac Configure MeterBinders after beans have been created
Update `MeterRegistryPostProcessor` to configure `MeterRegistry` beans
in two distinct sweeps. The first sweep applies customizers and filters
as the `MeterRegistry` bean is initialized, the second sweep applies
`MeterBinder` beans once all singletons have been instantiated.

Prior to this commit, it was not possible for a `MeterBinder` bean to
directly or indirectly use a `MeterRegistry`. It was also possible for
bound meters to cause a deadlock during refresh processing if those
meters could be updated on a thread other than main, such as GC
notifications.

Fixes gh-30636
Fixes gh-33070
2 years ago
Andy Wilkinson e60084112e Avoid NPE when TraceContext has deferred sampling
Closes gh-33093
2 years ago
Andy Wilkinson 6e4bece912 Make auto-configured OtelTracer back off when user defines a Tracer
Closes gh-33097
2 years ago
Andy Wilkinson d91e16a6c5 Make auto-configured BraveTracer back off when user defines a Tracer
Closes gh-33095
2 years ago
Phillip Webb 3d2071d044 Migrate endpoints to return OperationResponseBody types
Update types returned from endpoints to implement the
`OperationResponseBody` interface. This ensures that they will be
serialized using the isolated actuator `ObjectMapper`.

See gh-20291
2 years ago
Phillip Webb 1f8493fb29 Support isolated actuator ObjectMapper
Add `OperationResponseBody` tagging interface that can be used
to trigger the use of an isolated ObjectMapper specifically for
actuator responses.

The isolated mapper is provided by an `EndpointObjectMapper`
bean which is auto-configured unless specifically disabled
by the user.

WebMVC, WebFlux and Jersey integrations have been updated
to provide a link between the `OperationResponseBody` type
and the endpoint `ObjectMapper`.

See gh-20291
2 years ago
Phillip Webb 72cbb8a5d8 Polish 2 years ago
Phillip Webb 79ff11cb2b Rename and relocate ExemplarsAutoConfiguration
Rename `ExemplarsAutoConfiguration` and relocate it to a diffent
package to make it clear that it is for Prometheus.
2 years ago
Scott Frederick a53141f8a4 Fix JMX exposure default in config metadata and docs
Fixes gh-33072
2 years ago
Phillip Webb 883e97b166 Merge branch '2.7.x' 2 years ago
Phillip Webb ea10a64a0c Merge branch '2.6.x' into 2.7.x 2 years ago
Phillip Webb f423a26dd5 Polish 2 years ago
Phillip Webb 1adc7c7dd4 Merge branch '2.7.x' 2 years ago
Phillip Webb 0ef03d725f Merge branch '2.6.x' into 2.7.x 2 years ago
Phillip Webb a431ae04e6 Polish 2 years ago
Phillip Webb 32b9945632 Polish 2 years ago
Andy Wilkinson 3a2703e8f6 Upgrade to Jakarta Mail 2.1 and switch to Eclipse Angus RI
Closes gh-33059
Closes gh-33050
2 years ago
Andy Wilkinson b67c427259 Upgrade to Servlet 6.0 and related EE 10 specs
Co-authored-by: Phillip Webb <pwebb@vmware.com>

Closes gh-33036
Closes gh-33037
Closes gh-33038
Closes gh-33039
Closes gh-33040
Closes gh-33041
Closes gh-33042
Closes gh-33043
2 years ago
Phillip Webb 179aa987ee Unify actuator descriptor class names
Update actuator endpoints to consistently use `...Descriptor` for
JSON support classes.

Closes gh-33022
2 years ago
Phillip Webb 34b4ae8e05 Merge branch '2.7.x'
Closes gh-33019
2 years ago
Andy Wilkinson 604aa4d512 Align auto-configured Lettuce metrics with Lettuce's defaults
Closes gh-32986
2 years ago
Andy Wilkinson 8e08931411 Merge branch '2.7.x'
Closes gh-32990
2 years ago
Andy Wilkinson 394ae76b04 Merge branch '2.6.x' into 2.7.x
Closes gh-32989
2 years ago
Andy Wilkinson fcd3413ba0 Allow histograms to be disabled for Lettuce metrics
Closes gh-32985
2 years ago
Andy Wilkinson beea06f515 Polish "Handle custom observation name for HTTP reqs in max URI tag filters"
See gh-32973
2 years ago
Johnny Lim 89fe895cd6 Handle custom observation name for HTTP reqs in max URI tag filters
See gh-32973
2 years ago
Brian Clozel 0acaa0e460 Adapt to observation changes in Framework
See spring-projects/spring-framework#29388
2 years ago
Moritz Halbritter 05c5b1225c Replace Tag to KeyValues adapter code
Closes gh-32876
2 years ago
Moritz Halbritter 7aff82009f Revert "Register no-op tracer bean if tracing is disabled"
This reverts commit 2d75a8a9eb.
2 years ago
Moritz Halbritter 2d75a8a9eb Register no-op tracer bean if tracing is disabled
Closes gh-32907
2 years ago
Andy Wilkinson 11cff48271 Start building against Micrometer Tracing 1.0.0 snapshots
See gh-32937
2 years ago
Phillip Webb 2b5a29d514 No longer log hostname during application start
Remove hostname logging since `InetAddress.getLocalHost().getHostName()`
causes a network lookup and can take a long time.

Closes gh-32908
2 years ago
Phillip Webb 9856286a2d Refine actuator httpexhanges naming
See gh-32885
2 years ago
Andy Wilkinson 29f7a596fe Polish 2 years ago
Phillip Webb 3e50836b1a Rename httptrace endpoint and related classes to httpexchanges
Rename `/actuator/httptrace` to `/actuator/httpexchanges` to better
describe its purpose and to remove confusion with distribute tracing.

This change also takes the opportunity to improve the code by making
the `HttpExchange` class (previously `HttpTrace`) fully immutable.

Closes gh-32885

Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>
2 years ago
Johnny Lim 8d17d2d443 Handle null span in LazyTracingSpanContextSupplier consistently
See gh-32817
2 years ago
Johnny Lim 5067aab552 Polish
See gh-32840
2 years ago
Marcin Grzejszczak b753170807 Add missing BaggageTextMapPropagator for OTel W3C
Without this change we're missing the BaggageTextMapPropagator for
OTel. This means that we're not propagating remote-fields
(only baggage via the 'baggage' field).

With this change we're adding the missing propagator as
THE LAST entry in the composite TextMapPropagator. It has to be
last cause with the latest Snapshots of Micrometer Tracing it
will append the remote field baggage to existing baggage in the
context extracted via the W3CBaggagePropagator.

See gh-32898
2 years ago
Phillip Webb a59b6cb1f3 Polish 2 years ago
Phillip Webb 4be3218cb6 Merge branch '2.7.x' 2 years ago
Andy Wilkinson 99edda735e Polish 2 years ago
Brian Clozel 685fa900f8 Auto-configure Observation instrumentation for WebFlux
Prior to this commit, Spring Boot would offer a specific Metrics
instrumentation for WebFlux applications through a `WebFilter` and
custom Tag providers.

As of Spring Framework 6.0, the Observation instrumentation is done
directly in WebFlux, also with a `WebFilter`. While this allows both
metrics and traces, some features cannot be supported in the same way
with this new infrastructure.
The former `WebFilter` has been removed and the Tagging infrastructure
deprecated in favor of custom Observation conventions. This commit
provides an adapter layer so that developers can refactor their custom
tagging solution to the convention way, during the deprecation phase,
without losing any feature.

Closes gh-32539
2 years ago
Brian Clozel 9948fc3e39 Use GraphQL Observation instrumentation
This commit migrates the existing metrics support (added in #29140) to
the new `Observation` instrumentation contributed in
spring-projects/spring-graphql#501.

We cannot have a smoother migration path here as the instrumentation
does not use the same context information for metadata extraction.

Closes gh-32794
2 years ago
Madhura Bhave ce3c933f77 Adapt to Spring Security changes
Closes gh-32604
2 years ago
Phillip Webb 2e74878ba4 Downgrade to OpenSAML 4.0.1
See gh-32604
2 years ago
Brian Clozel e5c12c2b56 Move HTTP client observation auto-configuration
This commit moves the observation auto-configuration from the metrics
package to the observation package for consistency.

See gh-32484
See gh-32518
2 years ago
Brian Clozel b2fe807d47 Move MVC metrics to Observation auto-configuration
This commit moves the entire Metrics auto-configuration for Spring MVC
to the new `Observation` API and the instrumentation contributed in
Spring Framework.

Closes gh-32538
2 years ago
Brian Clozel cbca457eff Adapt to HTTP Observation changes in Framework
This commit adapts to the renames/package changes in the HTTP
Observation support in Spring Framework.

See spring-projects/spring-framework#29334
2 years ago
Andy Wilkinson 4700a00d94 Auto-configure CompositeSpanHandler with Brave
Closes gh-32753
2 years ago
Andy Wilkinson d593d194de Polish "Add auto-configuration for Exemplars"
See gh-32415
2 years ago
Jonatan Ivanov c5b2bc3dc7 Add auto-configuration for Exemplars
See gh-32415
2 years ago
Andy Wilkinson 81ee173877 Polish
See gh-32399
2 years ago
Andy Wilkinson 1af21fe33f Polish "Use TracingAwareMeterObservationHandler if tracing is configured"
See gh-32399
2 years ago
Jonatan Ivanov 415b9025c8 Use TracingAwareMeterObservationHandler if tracing is configured
See gh-32399
2 years ago
Bertolt Meier 647a2905c8 Add checkstyle rule for List.of() / Set.of() / Map.of()
This commits adds a checkstyle rule to not use List.of(), Set.of()
and Map.of(), preferring Collections.emptyList(), emptySet(), and
emptyMap() respectively.

It replaces usages of these methods across the codebase.

See gh-32655
2 years ago
Johnny Lim 1032f8cc94 Polish Micrometer tracing changes
See gh-32627
2 years ago
Andy Wilkinson e4544c1785 Use new constructor to configure W3CPropagation without baggage
Closes gh-32524
2 years ago
Andy Wilkinson 180d0edbca Decouple AutoTimeProperties from Micrometer Core
Closes gh-32676
2 years ago
Andy Wilkinson 7e9e64a2ea Revert "Merge pull request #32399 from jonatan-ivanov"
This reverts commit ad40ef3398, reversing
changes made to 6eb32647f5.
2 years ago
Jonatan Ivanov a0ceb2c3ff Use TracingAwareMeterObservationHandler if tracing is configured
See gh-32399
2 years ago
Jonatan Ivanov fff4aaaac1 Fix Observation lifecycle issues in ObservationAutoConfigurationTests
See gh-32662
2 years ago
Andy Wilkinson 403803837a Adapt to changes in REST Docs for documenting query parameters
See gh-32623
2 years ago
Andy Wilkinson 4dfd770406 Ensure that metrics and observation properties are enabled
Closes gh-32676
2 years ago
Johnny Lim 73fd760137 Polish HTTP client observability changes
See gh-32484
See gh-32518

Closes gh-32636
2 years ago
Marcin Grzejszczak dfd148fb76 Make auto-configured Brave Tracer more compliant with OTel tracer
By default we will not support joined spans and the trace ID will
be 128-bit.

See gh-32615
2 years ago
Brian Clozel 3e6ad67f16 Switch to Micrometer 1.10.0-SNAPSHOT
See gh-32598
2 years ago
Stephane Nicoll d106fc266a Revert "Adapt to deprecations in Spring Framework snapshots"
This reverts commit ff6acbe972.
2 years ago
Stephane Nicoll ff6acbe972 Adapt to deprecations in Spring Framework snapshots 2 years ago
Andy Wilkinson 7c4e46e538 Allow thread dump endpoint to call ThreadMXBean in a native image
Closes gh-31680
2 years ago
Phillip Webb e0b67889a8 Use Stream.toList instead of Stream.collect when possible
Update code to make use of `Stream.toList()` whenever possible.

Closes gh-28177
2 years ago
Andy Wilkinson 3ab36074dc Make management.tracing.enabled are first-class property
This will allow metadata to be generated for it automatically.

Closes gh-31656
2 years ago
Andy Wilkinson 6d4390e034 Simplify ConditionalOnEnabledTracing
Closes gh-32572
2 years ago
Andy Wilkinson 69c8959e6d Remove remnants of references to GlobalKeyValuesProviders
Closes gh-31841
2 years ago
Stephane Nicoll c2b8d3de21 Declare beans that can be instantiated at build-time static
This commit updates the bean factory methods for beans that can be
instantiated at build-time to be static. Doing so makes sure that
the enclosing configuration class does not have to be resolved in
order to create the instance.

Closes gh-32570
2 years ago
Johnny Lim d6cfcd0825 Fix compile errors
Closes gh-32569
2 years ago
Andy Wilkinson 522cb1c0ea Polish deprecation warnings
See gh-32541
2 years ago
Andy Wilkinson dbcb291b7a Polish
See gh-32541
2 years ago
Andy Wilkinson bcb5e84129 Avoid using reflection when creating composite health contributors
Closes gh-32541
2 years ago
Andy Wilkinson 51df7813a5 Remove code deprecated in 2.x and add since and forRemoval attributes
Closes gh-32548
Closes gh-32549
2 years ago
Brian Clozel 5b092f5d80 Polish
See gh-32518
2 years ago
Brian Clozel 8b4a20d6cd Use Observation infrastructure for instrumenting WebClient
As of spring-projects/spring-framework#28341, `WebClient` is
instrumented directly for `Observation`.
This commit removes the custom `ExchangeFilterFunction` that previously
instrumented the client for metrics.

As a result, the relevant tag providers are now deprecated and adapted
as `ObservationConvention` for the time being.

Closes gh-32518
2 years ago
Stephane Nicoll 3702c71fc1 Adapt to Spring AOT changes 2 years ago
Andy Wilkinson 17953eeb33 Merge branch '2.7.x'
Closes gh-32544
2 years ago