1897 Commits

Author SHA1 Message Date
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
2022-10-19 19:59:25 +02:00
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
2022-10-19 19:33:31 +02:00
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
2022-10-17 22:46:06 +02:00
Andy Wilkinson
4700a00d94 Auto-configure CompositeSpanHandler with Brave
Closes gh-32753
2022-10-17 13:58:48 +01:00
Andy Wilkinson
d593d194de Polish "Add auto-configuration for Exemplars"
See gh-32415
2022-10-13 13:23:48 +01:00
Jonatan Ivanov
c5b2bc3dc7 Add auto-configuration for Exemplars
See gh-32415
2022-10-13 12:54:06 +01:00
Andy Wilkinson
81ee173877 Polish
See gh-32399
2022-10-13 12:51:25 +01:00
Andy Wilkinson
1af21fe33f Polish "Use TracingAwareMeterObservationHandler if tracing is configured"
See gh-32399
2022-10-13 12:09:43 +01:00
Jonatan Ivanov
415b9025c8 Use TracingAwareMeterObservationHandler if tracing is configured
See gh-32399
2022-10-13 12:09:43 +01:00
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
2022-10-12 18:15:48 +01:00
Johnny Lim
1032f8cc94 Polish Micrometer tracing changes
See gh-32627
2022-10-12 18:05:41 +01:00
Andy Wilkinson
e4544c1785 Use new constructor to configure W3CPropagation without baggage
Closes gh-32524
2022-10-12 17:19:45 +01:00
Andy Wilkinson
180d0edbca Decouple AutoTimeProperties from Micrometer Core
Closes gh-32676
2022-10-12 14:40:42 +01:00
Andy Wilkinson
7e9e64a2ea Revert "Merge pull request #32399 from jonatan-ivanov"
This reverts commit ad40ef3398c704d8cf937c36a85bf60079f7dbae, reversing
changes made to 6eb32647f58ff58ff839f5bdaae8b998f8970233.
2022-10-12 14:36:08 +01:00
Jonatan Ivanov
a0ceb2c3ff Use TracingAwareMeterObservationHandler if tracing is configured
See gh-32399
2022-10-12 13:57:39 +01:00
Jonatan Ivanov
fff4aaaac1 Fix Observation lifecycle issues in ObservationAutoConfigurationTests
See gh-32662
2022-10-12 13:31:21 +01:00
Andy Wilkinson
403803837a Adapt to changes in REST Docs for documenting query parameters
See gh-32623
2022-10-12 11:30:57 +01:00
Andy Wilkinson
4dfd770406 Ensure that metrics and observation properties are enabled
Closes gh-32676
2022-10-11 20:30:40 +01:00
Johnny Lim
73fd760137 Polish HTTP client observability changes
See gh-32484
See gh-32518

Closes gh-32636
2022-10-07 19:05:14 +02:00
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
2022-10-07 11:14:46 +01:00
Brian Clozel
3e6ad67f16 Switch to Micrometer 1.10.0-SNAPSHOT
See gh-32598
2022-10-06 15:18:32 +02:00
Stephane Nicoll
d106fc266a Revert "Adapt to deprecations in Spring Framework snapshots"
This reverts commit ff6acbe972ca35f9c62128d46b5da3b5d31cd6df.
2022-10-06 07:09:51 +02:00
Stephane Nicoll
ff6acbe972 Adapt to deprecations in Spring Framework snapshots 2022-10-05 15:55:33 +02:00
Andy Wilkinson
7c4e46e538 Allow thread dump endpoint to call ThreadMXBean in a native image
Closes gh-31680
2022-10-04 17:09:22 +01:00
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
2022-10-04 00:29:22 -07:00
Andy Wilkinson
3ab36074dc Make management.tracing.enabled are first-class property
This will allow metadata to be generated for it automatically.

Closes gh-31656
2022-10-03 14:28:23 +01:00
Andy Wilkinson
6d4390e034 Simplify ConditionalOnEnabledTracing
Closes gh-32572
2022-10-03 14:26:41 +01:00
Andy Wilkinson
69c8959e6d Remove remnants of references to GlobalKeyValuesProviders
Closes gh-31841
2022-10-03 14:03:15 +01:00
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
2022-10-03 14:36:04 +02:00
Johnny Lim
d6cfcd0825 Fix compile errors
Closes gh-32569
2022-10-02 18:38:28 +02:00
Andy Wilkinson
522cb1c0ea Polish deprecation warnings
See gh-32541
2022-09-30 18:51:37 +01:00
Andy Wilkinson
dbcb291b7a Polish
See gh-32541
2022-09-30 18:31:01 +01:00
Andy Wilkinson
bcb5e84129 Avoid using reflection when creating composite health contributors
Closes gh-32541
2022-09-30 17:03:02 +01:00
Andy Wilkinson
51df7813a5 Remove code deprecated in 2.x and add since and forRemoval attributes
Closes gh-32548
Closes gh-32549
2022-09-30 14:39:05 +01:00
Brian Clozel
5b092f5d80 Polish
See gh-32518
2022-09-30 12:52:22 +02:00
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
2022-09-30 11:24:35 +02:00
Stephane Nicoll
3702c71fc1 Adapt to Spring AOT changes 2022-09-29 18:55:41 +02:00
Andy Wilkinson
17953eeb33 Merge branch '2.7.x'
Closes gh-32544
2022-09-29 11:41:15 +01:00
Andy Wilkinson
3ef633b096 Merge branch '2.6.x' into 2.7.x
Closes gh-32543
2022-09-29 11:39:42 +01:00
Andy Wilkinson
84a25c7dcf Configure Log4j2 classpath overrides consistently
Closes gh-32537
2022-09-29 11:25:21 +01:00
Andy Wilkinson
f10d696c46 Merge branch '2.7.x'
Closes gh-32536
2022-09-29 10:04:45 +01:00
Andy Wilkinson
9f5b7db553 Merge branch '2.6.x' into 2.7.x
Closes gh-32535
2022-09-29 10:04:19 +01:00
Andy Wilkinson
be48f37a83 Fix LogbackMetrics auto-config test with Logback and Log4j2 on cp
Closes gh-32533
2022-09-29 10:03:52 +01:00
dreis2211
388134713e Remove unused MockReactiveWebServerFactory
See gh-32526
2022-09-29 09:33:29 +02:00
Andy Wilkinson
0bfa9cd704 Upgrade to Logback 1.4 and SLF4J 2.0
Closes gh-12649
2022-09-28 21:14:08 +01:00
Andy Wilkinson
574242b44f Polish "Break cycles between Zipkin senders and HTTP client observation"
See gh-32528
2022-09-28 20:28:11 +01:00
Marcin Grzejszczak
b41ed44b60 Break cycles between Zipkin senders and HTTP client observation
Previously, RestTemplateBuilder and WebClient.Builder beans were used
to create the HTTP client for sending out spans. Those same beans are
also instrumented for observability which results in a cycle.

This commit breaks the cycle by not using the application-web
builders to create the RestTemplate and WebClient's used by the Zipkin
senders. Instead, builders are created inline, with new callbacks
being introduced to allow the user to customize these Zipkin-specific
builders.

See gh-32528
2022-09-28 20:11:44 +01:00
Andy Wilkinson
8c74b62888 Polish "Prefer WebClient to RestTemplate for Zipkin's Sender"
See gh-32529
2022-09-28 19:07:27 +01:00
Marcin Grzejszczak
cd3b3d468a Prefer WebClient to RestTemplate for Zipkin's Sender
Previously, a Webclient-based sender was only for reactive web
applications, falling back to a RestTemplate-based sender in all
other cases.

With this commit we now prefer to use WebClient if it is available,
irrespective of the web application type. The assumption is that
if the user has WebClient on the classpath, it's either a reactive
web application, or it's a servlet web application or non-web
application but WebClient is preferred.

See gh-32529
2022-09-28 19:04:30 +01:00
Brian Clozel
eac50a8f0c Auto-configure Observation support for RestTemplate
Prior to this commit, Spring Boot would auto-configure a customizer that
instruments `RestTemplate` through a `RestTemplateBuilder`. This would
install a request interceptor that instrumented client exchanges for
producing metrics.

As of spring-projects/spring-framework#28341, the instrumentation is
done at the `RestTemplate` level directly using the `Observation` API.
The `Tag` (now `KeyValue`) extraction, observation name and
instrumentation behavior now lives in the Spring Framework project.

This commit updates the auto-configuration to switch from Boot-specific
Metrics instrumentation to a generic Observation instrumentation.
As a migration path, some configuration properties are deprecated in
favor of the new `management.observations.*` namespace.

Closes gh-32484
2022-09-27 22:19:01 +02:00