-
Notifications
You must be signed in to change notification settings - Fork 41.1k
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
Upgrade to micrometer 1.0.0-rc.5 #11071
Conversation
@@ -75,6 +78,11 @@ | |||
SimpleExportConfiguration.class, StatsdExportConfiguration.class }) | |||
@AutoConfigureAfter(DataSourceAutoConfiguration.class) | |||
public class MetricsAutoConfiguration { | |||
@Bean | |||
@Order(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanity check please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can use @Order
on @Bean
methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scrub that, yes you can.
*/ | ||
public class EnvironmentMeterFilter extends PropertyMeterFilter { | ||
private final Environment environment; | ||
private final DefaultConversionService conversionService = new DefaultConversionService(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way of accessing conversions in Boot 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a bean and you can inject one. See here and the auto-configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spencergibb In a vanilla Spring Boot 1.5.x app, it is not injectable. Must be configured somewhere. I think they've been fiddling with conversion service in 2.x though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a brittle way to support nicer Duration
parsing. I'm worried that we're going directly to the Environment
and possibly bypassing the relaxed binding rules. I'm tempted to pull that out and create a nice general way to bind Durations with a simple format.
return null; | ||
} | ||
|
||
private static Duration simpleParse(String rawTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from users indicated they wanted to be able to define props like 1s
rather than PT1S
(sometimes). Not sure if you want this to be a capability of the default Duration
conversion.
@@ -42,6 +43,8 @@ | |||
*/ | |||
private Duration step = Duration.ofSeconds(10); | |||
|
|||
private CountingMode mode = CountingMode.Cumulative; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unusual enum format. Any reason for Cumulative
, Step
and not CUMULATIVE
, STEP
? Binding should work regardless I think.
* wrapped. Timings are provided separately by wrapping the executor service with | ||
* {@link TimedThreadPoolTaskExecutor}. | ||
* | ||
* @author David Held |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the author signed the CLA? We can't accept this if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dheld-expedia are you the original author for this? Any chance you could consider submitting it as a PR for Boot so the CLA bot confirms that you've signed the CLA.
*/ | ||
public class EnvironmentMeterFilter extends PropertyMeterFilter { | ||
private final Environment environment; | ||
private final DefaultConversionService conversionService = new DefaultConversionService(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a brittle way to support nicer Duration
parsing. I'm worried that we're going directly to the Environment
and possibly bypassing the relaxed binding rules. I'm tempted to pull that out and create a nice general way to bind Durations with a simple format.
@jkschneider I've got a simplified branch ready to merge here. This drops the Unfortunately, I still can't merge this due to the following:
I'm guessing that this import is wrong. |
Guava has been removed in rc5 with micrometer-metrics/micrometer#234 |
* pr/11071: Polish micrometer rc.5 upgrade Upgrade to micrometer 1.0.0-rc.5
Intended for Boot 2 M7.
cc / @wilkinsona
cc / @philwebb