mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Main user-facing interface is still Counter/GaugeService but the back end behind that has more options. The Default*Services write metrics to a MetricWriter and there are some variants of that, and also variants of MetricReader (basic read-only actions). MetricRepository is now a combination of MetricReader, MetricWriter and some more methods that make it a bit more repository like. There is also a MultiMetricReader and a MultiMetricRepository for the common case where metrics are stored in related (often open ended) groups. Examples would be complex metrics like histograms and "rich" metrics with averages and statistics attached (which are both closed) and "field counters" which count the occurrences of values of a particular named field or slot in an incoming message (e.g. counting Twitter hastags, open ended). In memory and redis implementations are provided for the repositories. Generally speaking the in memory repository should be used as a local buffer and then scheduled "exports" can be executed to copy metric values accross to a remote repository for aggregation. There is an Exporter interface to support this and a few implementations dealing with different strategies for storing the results (singly or grouped). Codahale metrics are also supported through the MetricWriter interface. Currently implemented through a naming convention (since Codahale has a fixed object model this makes sense): metrics beginning with "histogram" are Histograms, "timer" for Timers, "meter" for Meters etc. Support for message driven metric consumption and production are provided through a MetricWriterMessageHandler and a MessageChannelMetricWriter. No support yet for pagination in the repositories, or for HATEOAS style HTTP endpoints. |
||
---|---|---|
.. | ||
src | ||
build.gradle | ||
build.xml | ||
ivy.xml | ||
ivysettings.xml | ||
pom.xml | ||
README.md | ||
start.groovy |
Spring Boot Actuator Sample
You can build this sample using Maven (>3) or Gradle (1.6).
With Maven:
$ mvn package
$ java -jar target/*.jar
Then access the app via a browser (or curl) on http://localhost:8080 (the user name is "user" and look at the INFO log output for the password to login).
With gradle:
$ gradle build
$ java -jar build/libs/*.jar
The gradle build contains an intentionally odd configuration to exclude the security dependencies from the executable JAR. So the app run like this behaves differently than the one run from the Maven-built JAR file. See comments in the build.gradle
for details.