-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-3376: Remove gauges on application ctx close #3377
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
Conversation
Is there an existing relationship between beans that will ensure that |
thank you for feedback! So, let's see together what we have so far! Since Micrometer is an
And already that
So, I think according your requirement there is no such a dependency injection relationship between Maybe we should think about applying Thanks again |
any further feedback, please? We probably need to see how this can make it into the upcoming release this Wednesday. Thanks |
I wonder if you could use a |
Fixes spring-projects#3376 The `MeterRegistry` may request meters on application shutdown. The gauges for channels, handlers and message sources don't make sense at the moment since all those beans are going to be destroyed. * Remove gauges for channel, handler and message source numbers from the `IntegrationManagementConfigurer.destroy()` **Cherry-pick to 5.3.x & 5.2.x**
a `MicrometerMetricsCaptorConfiguration` when `MeterRegistry` is on class path. * Make `MicrometerMetricsCaptorConfiguration.integrationMicrometerMetricsCaptor()` bean dependant on the `ObjectProvider<MeterRegistry>` * Make `IntegrationManagementConfiguration.managementConfigurer()` dependant on the `ObjectProvider<MetricsCaptor>`. This way the `IntegrationManagementConfigurer` is destroyed before `MeterRegistry` when application context is closed * Deprecate `MicrometerMetricsCaptor.loadCaptor()` in favor of `@Import(MicrometerImportSelector.class)`
…PTOR_NAME` bean when `MeterRegistry` is on class path and no `MICROMETER_CAPTOR_NAME` bean yet. * Make `IntegrationManagementConfiguration.managementConfigurer()` dependant on the `ObjectProvider<MetricsCaptor>`. This way the `IntegrationManagementConfigurer` is destroyed before `MeterRegistry` when application context is closed * Deprecate `MicrometerMetricsCaptor.loadCaptor()` in favor of `@Import(MicrometerMetricsCaptorRegistrar.class)` * Fix test to make a `MeterRegistry` bean as `static` since `@EnableIntegrationManagement` depends on this bean definition now
OK. I have added a Please, take a look how is this now, @wilkinsona . Thank you! |
With the caveat that I haven't tried to run the code, those changes look good to me now. |
* GH-3376: Remove gauges on application ctx close Fixes #3376 The `MeterRegistry` may request meters on application shutdown. The gauges for channels, handlers and message sources don't make sense at the moment since all those beans are going to be destroyed. * Remove gauges for channel, handler and message source numbers from the `IntegrationManagementConfigurer.destroy()` **Cherry-pick to 5.3.x & 5.2.x** * * Add `MicrometerImportSelector` to conditionally load a `MicrometerMetricsCaptorConfiguration` when `MeterRegistry` is on class path. * Make `MicrometerMetricsCaptorConfiguration.integrationMicrometerMetricsCaptor()` bean dependant on the `ObjectProvider<MeterRegistry>` * Make `IntegrationManagementConfiguration.managementConfigurer()` dependant on the `ObjectProvider<MetricsCaptor>`. This way the `IntegrationManagementConfigurer` is destroyed before `MeterRegistry` when application context is closed * Deprecate `MicrometerMetricsCaptor.loadCaptor()` in favor of `@Import(MicrometerImportSelector.class)` * * Add `MicrometerMetricsCaptorRegistrar` to register a `MICROMETER_CAPTOR_NAME` bean when `MeterRegistry` is on class path and no `MICROMETER_CAPTOR_NAME` bean yet. * Make `IntegrationManagementConfiguration.managementConfigurer()` dependant on the `ObjectProvider<MetricsCaptor>`. This way the `IntegrationManagementConfigurer` is destroyed before `MeterRegistry` when application context is closed * Deprecate `MicrometerMetricsCaptor.loadCaptor()` in favor of `@Import(MicrometerMetricsCaptorRegistrar.class)` * Fix test to make a `MeterRegistry` bean as `static` since `@EnableIntegrationManagement` depends on this bean definition now # Conflicts: # spring-integration-core/src/main/java/org/springframework/integration/config/EnableIntegrationManagement.java # spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfiguration.java # spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java * Fix some deprecation warnings
* GH-3376: Remove gauges on application ctx close Fixes #3376 The `MeterRegistry` may request meters on application shutdown. The gauges for channels, handlers and message sources don't make sense at the moment since all those beans are going to be destroyed. * Remove gauges for channel, handler and message source numbers from the `IntegrationManagementConfigurer.destroy()` **Cherry-pick to 5.3.x & 5.2.x** * * Add `MicrometerImportSelector` to conditionally load a `MicrometerMetricsCaptorConfiguration` when `MeterRegistry` is on class path. * Make `MicrometerMetricsCaptorConfiguration.integrationMicrometerMetricsCaptor()` bean dependant on the `ObjectProvider<MeterRegistry>` * Make `IntegrationManagementConfiguration.managementConfigurer()` dependant on the `ObjectProvider<MetricsCaptor>`. This way the `IntegrationManagementConfigurer` is destroyed before `MeterRegistry` when application context is closed * Deprecate `MicrometerMetricsCaptor.loadCaptor()` in favor of `@Import(MicrometerImportSelector.class)` * * Add `MicrometerMetricsCaptorRegistrar` to register a `MICROMETER_CAPTOR_NAME` bean when `MeterRegistry` is on class path and no `MICROMETER_CAPTOR_NAME` bean yet. * Make `IntegrationManagementConfiguration.managementConfigurer()` dependant on the `ObjectProvider<MetricsCaptor>`. This way the `IntegrationManagementConfigurer` is destroyed before `MeterRegistry` when application context is closed * Deprecate `MicrometerMetricsCaptor.loadCaptor()` in favor of `@Import(MicrometerMetricsCaptorRegistrar.class)` * Fix test to make a `MeterRegistry` bean as `static` since `@EnableIntegrationManagement` depends on this bean definition now # Conflicts: # spring-integration-core/src/main/java/org/springframework/integration/config/EnableIntegrationManagement.java # spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfiguration.java # spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java * Fix some deprecation warnings # Conflicts: # spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java
Fixes #3376
The
MeterRegistry
may request meters on application shutdown.The gauges for channels, handlers and message sources don't make sense
at the moment since all those beans are going to be destroyed.
IntegrationManagementConfigurer.destroy()
Cherry-pick to 5.3.x & 5.2.x