Metrics - After adding axon-micrometer dependency statsdProperties are no longer resolved

Hi,

we are trying to add metrics for axon by adding following dependencies to a springboot 2 (2.1) project:

compile group: 'org.axonframework', name: 'axon-micrometer', version: '4.1.1' compile group: 'io.micrometer', name: 'micrometer-registry-statsd', version: '1.1.3'

and configuring via application.yaml:

management: endpoint: metrics: enabled: true metrics: export: statsd: host: ${DD_JMXFETCH_STATSD_HOST:localhost}

I figured, that everything works fine in a local environment if statsd is running on localhost:8125, but in our dev environment, where statsd is not running on localhost, nothing is send to statsd.

Some local tests showed, that after adding the axon-micrometer dependency the StatsdProperties are not resolved and the default values are always used.
Without the dependency the properties are resolved. It seem like axon-micrometer changes the order in which Beans and Properties are resolved.

I’ve tried copiing the StatsdProperties class and initialising the actual propertyclass myself, but my own properties are not resolved either, in fact, no property is resolved at the moment the StatsdProperties bean is created.

@Bean @Primary @ConditionalOnBean(BlaProperties.class) public StatsdProperties properties( final BlaProperties properties, @Value("${test:test123}") final String host ) { // host is "${test:test123}" and not test as expected StatsdProperties statsdProperties = new StatsdProperties(); statsdProperties.setHost("localhost2"); return statsdProperties; }

How do i configure Springboot, Axon, Micrometer so that the configuration can be externalized?

Example: https://github.com/FenrirOdinson/axon-metric

It seems like an upgrade to version 4.2 solved this issue.