Skip to content

YoussefArfaoui/metrics-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metrics-extensions project

[ ![Build Status] travis-image ] travis [ Issues issues-image ] issues [ ![Release] release-image ] releases [ ![Tags] tag-image ] tag Coverage Status [ License license-image ] license [ Forks forks-image ] forks Maven Central Issue Stats Issue Stats

Add the metrics-config.xml file in your spring context by importing it in the correct spring configuration file.

	<import resource="classpath*:*spring/metrics-config.xml" />

Add AyAdminServlet servelet configuration in the web.xml configuration file to have web metrics access.

<servlet>
		<servlet-name>metrics</servlet-name>
		<servlet-class>com.ay.web.metrics.servlets.AyAdminServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
        <servlet-name>metrics</servlet-name>
        <url-pattern>/metrics/*</url-pattern>
</servlet-mapping>

All metrics annotations can be used with this module. example :

	@RequestMapping(value = "/monitor/version")
	@ResponseBody
	@Counted(name = "monitor.version.counts", absolute = true, monotonic = true)
	@Timed(name = "monitor.version.timings", absolute = true)
	@ExceptionMetered(name = "monitor.version.exceptions", absolute = true, cause = Exception.class)
	public ResponseEntity<String> getVersion() {
	...
	}

About

metrics-extensions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages