-
Notifications
You must be signed in to change notification settings - Fork 40.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-configuration ignores user-provided ObservationConventions #33285
Comments
Brian's been working on a migration guide for this. Does https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-Metrics-3.0#migrating-tag-providers-and-contributors help? |
@braunsonm no worries. Does this section of the migration guide helps? Could you tell us more about your use case and how we could improve it? |
That does help, I was unaware that multiple implementations to the |
Thanks! |
We've also addressed this in the reference documentation in #33281 |
Hey @bclozel We are not seeing it behave the way you describe in the documentation. Would you like a separate issue for this? With a very simple example: public class ExtendedClientRequestObservationConvention extends DefaultClientRequestObservationConvention implements
GlobalObservationConvention<ClientRequestObservationContext> {
@Override
public KeyValues getLowCardinalityKeyValues(ClientRequestObservationContext context) {
// Note the URI has been removed
return KeyValues.of(method(context), status(context), exception(context), outcome(context));
}
} @Configuration
public class SampleConfiguration {
@Bean
ExtendedClientRequestObservationConvention sampleConvention() {
return new ExtendedClientRequestObservationConvention();
}
} I can still see that the Default implementation is called, even when the bean is wired up. |
Thanks @braunsonm - we've discussed this with @marcingrzejszczak and found that the current situation is not in line with the migration story we're expecting. |
…o v3 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [nu.ndw.nls.geometry:nls-geometry](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | compile | major | `2.2.0` -> `3.0.0` | --- ### Release Notes <details> <summary>spring-projects/spring-boot (nu.ndw.nls.geometry:nls-geometry)</summary> ### [`v3.0.0`](https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0) [Compare Source](spring-projects/spring-boot@v2.2.1.RELEASE...v3.0.0) See the [Release notes for 3.0](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes) for upgrade instructions and details of new features. #### ⭐ New Features - Provide a configuration property for the observation patterns of Spring Integration components [#​33099](spring-projects/spring-boot#33099) #### 🐞 Bug Fixes - io.micrometer.tracing.Tracer on the classpath breaks AOT processing for tests [#​33298](spring-projects/spring-boot#33298) - Tracer library HTTP instrumentation is auto-configured unnecessarily [#​33287](spring-projects/spring-boot#33287) - Auto-configuration ignores user-provided ObservationConventions [#​33285](spring-projects/spring-boot#33285) - `ScheduledBeanLazyInitializationExcludeFilter` is auto-configured even when annotation-based scheduled has not been enabled [#​33284](spring-projects/spring-boot#33284) - SpringBootContextLoader prints banner twice when using a `@ContextHierarchy` [#​33263](spring-projects/spring-boot#33263) - Properties migrator causes an application to fail to start if it tries to map a property whose metadata data entry contains an invalid configuration property name [#​33250](spring-projects/spring-boot#33250) - Wavefront MeterRegistryCustomizer is not applying application tags from application.properties [#​33244](spring-projects/spring-boot#33244) - Actuator responses no longer format timestamps as ISO-8601 [#​33236](spring-projects/spring-boot#33236) - Configuration property is not bound in a native image when property has get, set, and is methods [#​33232](spring-projects/spring-boot#33232) - Configuration property binding does not deal with bridge methods [#​33212](spring-projects/spring-boot#33212) - Contribute missing resource hints for GraphQL schema files and GraphiQL HTML page [#​33208](spring-projects/spring-boot#33208) - Hints for ClientHttpRequestFactory should only be generated for matching methods [#​33203](spring-projects/spring-boot#33203) -...
…o v3 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [nu.ndw.nls.geometry:nls-geometry](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | compile | major | `2.1.4` -> `3.0.0` | --- ### Release Notes <details> <summary>spring-projects/spring-boot (nu.ndw.nls.geometry:nls-geometry)</summary> ### [`v3.0.0`](https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0) [Compare Source](spring-projects/spring-boot@v2.2.1.RELEASE...v3.0.0) See the [Release notes for 3.0](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes) for upgrade instructions and details of new features. #### ⭐ New Features - Provide a configuration property for the observation patterns of Spring Integration components [#​33099](spring-projects/spring-boot#33099) #### 🐞 Bug Fixes - io.micrometer.tracing.Tracer on the classpath breaks AOT processing for tests [#​33298](spring-projects/spring-boot#33298) - Tracer library HTTP instrumentation is auto-configured unnecessarily [#​33287](spring-projects/spring-boot#33287) - Auto-configuration ignores user-provided ObservationConventions [#​33285](spring-projects/spring-boot#33285) - `ScheduledBeanLazyInitializationExcludeFilter` is auto-configured even when annotation-based scheduled has not been enabled [#​33284](spring-projects/spring-boot#33284) - SpringBootContextLoader prints banner twice when using a `@ContextHierarchy` [#​33263](spring-projects/spring-boot#33263) - Properties migrator causes an application to fail to start if it tries to map a property whose metadata data entry contains an invalid configuration property name [#​33250](spring-projects/spring-boot#33250) - Wavefront MeterRegistryCustomizer is not applying application tags from application.properties [#​33244](spring-projects/spring-boot#33244) - Actuator responses no longer format timestamps as ISO-8601 [#​33236](spring-projects/spring-boot#33236) - Configuration property is not bound in a native image when property has get, set, and is methods [#​33232](spring-projects/spring-boot#33232) - Configuration property binding does not deal with bridge methods [#​33212](spring-projects/spring-boot#33212) - Contribute missing resource hints for GraphQL schema files and GraphiQL HTML page [#​33208](spring-projects/spring-boot#33208) - Hints for ClientHttpRequestFactory should only be generated for matching methods [#​33203](spring-projects/spring-boot#33203) -...
With the move to micrometer observability, the
WebClientExchangeTagsProvider
andRestTemplateExchangeTagsProvicer
have both been deprecated in favour ofObservationConvention
s.The configuration (in this case the reactive but also affects the servlet) is not customizable enough to allow users to move off the deprecated classes.
The configuration should have means to accept a custom implementation of the
ObservationConvention
. Right now you would have to exclude this configuration class completely as the default convention is created in the bean method. See here:https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/WebClientObservationConfiguration.java#L53
Additional Context
I would like to migrate away from deprecated classes, but without being able to create my own
ObservationConvention
I cannot cleanly stop using the old TagsProvider's.cc @bclozel excuse the tag, but mentioned as you created these configuration classes
The text was updated successfully, but these errors were encountered: