Export MessageChannel metric writer
Update the auto-configured MessageChannelMetricWriter with @ExportMetricWriter so that metrics are actually exported. Fixes gh-5517
This commit is contained in:
parent
02764b8ff3
commit
3ca365cff0
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2015 the original author or authors.
|
* Copyright 2012-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -41,6 +41,7 @@ import org.springframework.messaging.MessageChannel;
|
||||||
public class MetricsChannelAutoConfiguration {
|
public class MetricsChannelAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ExportMetricWriter
|
||||||
@ConditionalOnMissingBean
|
@ConditionalOnMissingBean
|
||||||
public MessageChannelMetricWriter messageChannelMetricWriter(
|
public MessageChannelMetricWriter messageChannelMetricWriter(
|
||||||
@Qualifier("metricsChannel") MessageChannel channel) {
|
@Qualifier("metricsChannel") MessageChannel channel) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2015 the original author or authors.
|
* Copyright 2012-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -45,6 +45,7 @@ import org.springframework.messaging.SubscribableChannel;
|
||||||
import static org.hamcrest.Matchers.notNullValue;
|
import static org.hamcrest.Matchers.notNullValue;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link MetricExportAutoConfiguration}.
|
* Tests for {@link MetricExportAutoConfiguration}.
|
||||||
|
|
@ -77,6 +78,7 @@ public class MetricExportAutoConfigurationTests {
|
||||||
PropertyPlaceholderAutoConfiguration.class);
|
PropertyPlaceholderAutoConfiguration.class);
|
||||||
MetricExporters exporter = this.context.getBean(MetricExporters.class);
|
MetricExporters exporter = this.context.getBean(MetricExporters.class);
|
||||||
assertNotNull(exporter);
|
assertNotNull(exporter);
|
||||||
|
assertTrue(exporter.getExporters().containsKey("messageChannelMetricWriter"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue