Add metrics exporter for initializr service

If a RedisConnectionFactory is detected the system will now export
metrics to redis every 5s (initializr.metrics.rateMillis). Metric
names are prefixed with <id>.<hex>. where <id> defaults to the
application name (initializr.metrics.id) and <hex> is unique. An
aggregator app can then pick up the values and (for instance)
continue counters across restarts.

The code is meant to be easier to upgrade Spring Boot 1.3

There are 2 beans that we can simply remove when we upgrade to 1.3.
Meanwhile, the app will run with 1.3 (or 1.2) for testing if you
uncomment the @ExportMetricWriter.
This commit is contained in:
Dave Syer
2015-03-24 11:38:00 +00:00
committed by Stephane Nicoll
parent 7fdde4b0e4
commit 6f4d3f4e03
10 changed files with 315 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package app
import io.spring.initializr.web.LegacyStsController
@Grab('io.spring.initalizr:initializr:1.0.0.BUILD-SNAPSHOT')
@Grab('spring-boot-starter-redis')
class InitializerService {
@Bean