Hi,
Using v1.0.3 of the legacy 1.5 version I've trying to enable the percentiles histograms in my application.yml:
management:
context-path: /management
port: 18228 # Note this port is also specificed in the Dockerfile
security:
enabled: false
metrics:
distribution:
percentiles-histogram:
http.server.requests: true
percentiles:
http.server.requests: 0.95, 0.99
sla:
http.server.requests: 10ms, 100ms
when I start my app I get the exception
Caused by: org.springframework.beans.NullValueInNestedPathException: Invalid property 'distribution.percentilesHistogram[http]' of bean class [io.micrometer.spring.autoconfigure.MetricsProperties]: Could not instantiate property type [java.lang.Boolean] to auto-grow nested property path; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Boolean]: Is it an abstract class?; nested exception is java.lang.InstantiationException: java.lang.Boolean
at org.springframework.beans.AbstractNestablePropertyAccessor.newValue(AbstractNestablePropertyAccessor.java:931)
at org.springframework.beans.AbstractNestablePropertyAccessor.createDefaultPropertyValue(AbstractNestablePropertyAccessor.java:899)
at org.springframework.beans.AbstractNestablePropertyAccessor.setDefaultValue(AbstractNestablePropertyAccessor.java:887)
at org.springframework.beans.AbstractNestablePropertyAccessor.getNestedPropertyAccessor(AbstractNestablePropertyAccessor.java:851)
at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyAccessorForPropertyPath(AbstractNestablePropertyAccessor.java:825)
at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyAccessorForPropertyPath(AbstractNestablePropertyAccessor.java:826)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:268)
at org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanWrapper.setPropertyValue(RelaxedDataBinder.java:699)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:859)
at org.springframework.validation.DataBinder.doBind(DataBinder.java:755)
at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
at org.springframework.validation.DataBinder.bind(DataBinder.java:740)
at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:272)
at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:240)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:330)
... 70 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Boolean]: Is it an abstract class?; nested exception is java.lang.InstantiationException: java.lang.Boolean
at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:80)
at org.springframework.beans.AbstractNestablePropertyAccessor.newValue(AbstractNestablePropertyAccessor.java:926)
... 85 common frames omitted
Caused by: java.lang.InstantiationException: java.lang.Boolean
at java.lang.Class.newInstance(Class.java:427)
at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:77)
... 86 common frames omitted
Caused by: java.lang.NoSuchMethodException: java.lang.Boolean.<init>()
If I get rid of the percentiles-histogram setting it works fine.
Any ideas what's wrong?
Thanks
Nick
I think you should write it as percentiles-histogram[http.server.requests]: true (only for Spring Boot 1.5.x, for 2.x your provided props should work fine)
"[http.server.requests]": true
Thanks chaps. This works:
metrics:
distribution:
percentiles-histogram[http.server.requests]: true
percentiles:
http.server.requests: 0.95, 0.99
sla:
http.server.requests: 10ms, 100ms
Most helpful comment
Thanks chaps. This works: