Monitoring JMX end points of Spring boot CLI application with jolokia

5.1k views Asked by At

I have a CLI micro service which has exposed endpoints

@Configuration
@EnableAutoConfiguration
@EnableConfigurationProperties
@ComponentScan
public class TestLauncher implements CommandLineRunner {
...
}

pom

<dependencyManagement>
        <dependencies>
                <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator </artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>

<dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
            <version>1.2.2</version>
</dependency>

Logs

o.s.b.a.e.jmx.EndpointMBeanExporter Registering beans for JMX exposure on startup
2014-11-13 16:12:59,067 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
2014-11-13 16:12:59,123 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'healthEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=healthEndpoint]
2014-11-13 16:12:59,135 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'beansEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=beansEndpoint]
2014-11-13 16:12:59,153 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'infoEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=infoEndpoint]
2014-11-13 16:12:59,161 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'metricsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=metricsEndpoint]
2014-11-13 16:12:59,169 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'traceEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=traceEndpoint]
2014-11-13 16:12:59,176 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'dumpEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=dumpEndpoint]
2014-11-13 16:12:59,182 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'autoConfigurationAuditEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=autoConfigurationAuditEndpoint]
2014-11-13 16:12:59,195 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'shutdownEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=shutdownEndpoint]
2014-11-13 16:12:59,213 INFO [main] o.s.b.a.e.jmx.EndpointMBeanExporter Located managed bean 'configurationPropertiesReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
2014-11-13 16:12:59,222 INFO [main] c.t.l.TestLauncher Program Started

application.properties

jolokia.config.debug=true
endpoints.jolokia.enabled=true
endpoints.jolokia.path=jolokia
spring.jmx.enabled=true
endpoints.jmx.enabled=true
management.port=9001
management.address=127.0.0.1

My app is up and working fine but i wanted to fetch these data points over HTTP using jolokia or make these available to my operational partners without the use of jcosole or jvisual vm over a browser like we can do for web spring boot projects. Can any one guide me to any links or tutorial to achieve the same

0

There are 0 answers