|
|
|
@ -521,7 +521,7 @@ changes the default resource path for the MVC endpoint. Legal endpoint ids are c
|
|
|
|
|
only of alphanumeric characters (because they can be exposed in a number of places,
|
|
|
|
|
including JMX object names, where special characters are forbidden). The MVC path can be
|
|
|
|
|
changed separately by configuring `endpoints.{name}.path`, and there is no validation on
|
|
|
|
|
those values (so you can use anything that is legel in a URL path). For example, to change
|
|
|
|
|
those values (so you can use anything that is legal in a URL path). For example, to change
|
|
|
|
|
the location of the `/health` endpoint to `/ping/me` you can set
|
|
|
|
|
`endpoints.health.path=/ping/me`.
|
|
|
|
|
|
|
|
|
@ -905,7 +905,7 @@ endpoint you should see a response similar to this:
|
|
|
|
|
Here we can see basic `memory`, `heap`, `class loading`, `processor` and `thread pool`
|
|
|
|
|
information along with some HTTP metrics. In this instance the `root` ('`/`') and `/metrics`
|
|
|
|
|
URLs have returned `HTTP 200` responses `20` and `3` times respectively. It also appears
|
|
|
|
|
that the `root` URL returned `HTTP 401` (unauthorized) `4` times. The double asterix (`star-star`)
|
|
|
|
|
that the `root` URL returned `HTTP 401` (unauthorized) `4` times. The double asterisks (`star-star`)
|
|
|
|
|
comes from a request matched by Spring MVC as `+/**+` (normally a static resource).
|
|
|
|
|
|
|
|
|
|
The `gauge` shows the last response time for a request. So the last request to `root` took
|
|
|
|
@ -1136,11 +1136,11 @@ recommendations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[production-ready-metric-writers-export-to-open-tdsb]]
|
|
|
|
|
[[production-ready-metric-writers-export-to-open-tsdb]]
|
|
|
|
|
==== Example: Export to Open TSDB
|
|
|
|
|
If you provide a `@Bean` of type `OpenTsdbHttpMetricWriter` and mark it
|
|
|
|
|
If you provide a `@Bean` of type `OpenTsdbMetricWriter` and mark it
|
|
|
|
|
`@ExportMetricWriter` metrics are exported to http://opentsdb.net/[Open TSDB] for
|
|
|
|
|
aggregation. The `OpenTsdbHttpMetricWriter` has a `url` property that you need to set
|
|
|
|
|
aggregation. The `OpenTsdbMetricWriter` has a `url` property that you need to set
|
|
|
|
|
to the Open TSDB "`/put`" endpoint, e.g. `http://localhost:4242/api/put`). It also has a
|
|
|
|
|
`namingStrategy` that you can customize or configure to make the metrics match the data
|
|
|
|
|
structure you need on the server. By default it just passes through the metric name as an
|
|
|
|
@ -1201,7 +1201,7 @@ MetricWriter metricWriter() {
|
|
|
|
|
[[production-ready-metric-writers-export-to-jmx]]
|
|
|
|
|
==== Example: Export to JMX
|
|
|
|
|
If you provide a `@Bean` of type `JmxMetricWriter` marked `@ExportMetricWriter` the metrics are exported as MBeans to
|
|
|
|
|
the local server (the `MBeanExporter` is provided by Spring Boot JMX autoconfiguration as
|
|
|
|
|
the local server (the `MBeanExporter` is provided by Spring Boot JMX auto-configuration as
|
|
|
|
|
long as it is switched on). Metrics can then be inspected, graphed, alerted etc. using any
|
|
|
|
|
tool that understands JMX (e.g. JConsole or JVisualVM).
|
|
|
|
|
|
|
|
|
@ -1270,7 +1270,6 @@ repositories, and don't want to export their values.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[production-ready-code-hale-metrics]]
|
|
|
|
|
[[production-ready-dropwizard-metrics]]
|
|
|
|
|
=== Dropwizard Metrics
|
|
|
|
|
A default `MetricRegistry` Spring bean will be created when you declare a dependency to
|
|
|
|
|