Created
May 17, 2018 17:11
-
-
Save darrylanderson/f9f36caa7a91c8b5a97d138495e7a822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package atc.example.config.monitoring; | |
import org.springframework.boot.actuate.autoconfigure.ExportMetricWriter; | |
import org.springframework.boot.actuate.metrics.jmx.JmxMetricWriter; | |
import org.springframework.boot.actuate.metrics.writer.MetricWriter; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.jmx.export.MBeanExporter; | |
@Configuration | |
public class MonitoringConfiguration | |
{ | |
/** | |
* Export spring boot metrics to JMX. | |
* | |
* @param exporter | |
* @return a MetricsWriter object | |
*/ | |
@Bean | |
@ExportMetricWriter | |
public MetricWriter metricWriter ( final MBeanExporter exporter ) | |
{ | |
return new JmxMetricWriter( exporter ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment