@Bean
    public TimerRegistry timerRegistry(
            TimerConfigurationProperties timerConfigurationProperties,
            EventConsumerRegistry<TimerEvent> timerEventConsumerRegistry,
            RegistryEventConsumer<Timer> timerRegistryEventConsumer,
            @Qualifier("compositeTimerCustomizer") CompositeCustomizer<TimerConfigCustomizer> compositeTimerCustomizer,
            @Autowired(required = false) MeterRegistry registry
    ) {
        TimerRegistry timerRegistry = createTimerRegistry(timerConfigurationProperties, timerRegistryEventConsumer, compositeTimerCustomizer, registry);
        registerEventConsumer(timerRegistry, timerEventConsumerRegistry, timerConfigurationProperties);
        initTimerRegistry(timerRegistry, timerConfigurationProperties, compositeTimerCustomizer);
        return timerRegistry;
    }
@Test
    public void shouldConfigureInstancesUsingDedicatedConfigs() {
        InstanceProperties instanceProperties1 = new InstanceProperties()
                .setMetricNames("resilience4j.timer.operations1")
                .setOnFailureTagResolver(QualifiedClassNameOnFailureTagResolver.class)
                .setEventConsumerBufferSize(1);
        InstanceProperties instanceProperties2 = new InstanceProperties()
                .setMetricNames("resilience4j.timer.operations2")
                .setOnFailureTagResolver(FixedOnFailureTagResolver.class)
                .setEventConsumerBufferSize(10);
        TimerConfigurationProperties configurationProperties = new TimerConfigurationProperties();
        configurationProperties.getInstances().put("backend1", instanceProperties1);
        configurationProperties.getInstances().put("backend2", instanceProperties2);
        configurationProperties.setTimerAspectOrder(200);
        TimerConfiguration configuration = new TimerConfiguration();
        DefaultEventConsumerRegistry<TimerEvent> eventConsumerRegistry = new DefaultEventConsumerRegistry<>();
        TimerRegistry registry = configuration.timerRegistry(
                configurationProperties, eventConsumerRegistry, new CompositeRegistryEventConsumer<>(emptyList()), new CompositeCustomizer<>(emptyList()), new SimpleMeterRegistry()
        );

        assertThat(configurationProperties.getTimerAspectOrder()).isEqualTo(200);
        assertThat(registry.getAllTimers().count()).isEqualTo(2);
        Timer timer1 = registry.timer("backend1");
        assertThat(timer1).isNotNull();
        assertThat(timer1.getTimerConfig().getMetricNames()).isEqualTo("resilience4j.timer.operations1");
        assertThat(timer1.getTimerConfig().getOnFailureTagResolver()).isInstanceOf(QualifiedClassNameOnFailureTagResolver.class);
        Timer timer2 = registry.timer("backend2");
        assertThat(timer2).isNotNull();
        assertThat(timer2.getTimerConfig().getMetricNames()).isEqualTo("resilience4j.timer.operations2");
        assertThat(timer2.getTimerConfig().getOnFailureTagResolver()).isInstanceOf(FixedOnFailureTagResolver.class);
        assertThat(eventConsumerRegistry.getAllEventConsumer()).hasSize(2);
    }