Add auto-configuration for DataSources

This commit automatically instruments all available data sources with
a configurable metric name. The instrumentation can be disabled in case
more control is needed.

Closes gh-10295
This commit is contained in:
Stephane Nicoll
2017-10-30 12:39:42 +01:00
parent 5208bd069d
commit 9b6f0c83bf
8 changed files with 375 additions and 83 deletions

View File

@@ -1302,6 +1302,8 @@ content into your application; rather pick only the properties that you need.
spring.metrics.ganglia.enabled=true # Whether not exporting of metrics to Ganglia is enabled.
spring.metrics.graphite.enabled=true # Whether not exporting of metrics to Graphite is enabled.
spring.metrics.influx.enabled=true # Whether not exporting of metrics to InfluxDB is enabled.
spring.metrics.jdbc.datasource-metric-name=data.source # Name of the metric for data source usage.
spring.metrics.jdbc.instrument-datasource=true # Instrument all available data sources.
spring.metrics.jmx.enabled=true # Whether not exporting of metrics to JMX is enabled.
spring.metrics.prometheus.enabled=true # Whether not exporting of metrics to Prometheus is enabled.
spring.metrics.simple.enabled=true # Whether not exporting of metrics to a simple in-memory store is enabled.

View File

@@ -960,6 +960,16 @@ the following:
[[production-ready-metrics-jdbc]]
=== DataSource metrics
Auto-configuration will enable the instrumentation of all available `DataSources` with a
metric named `data.source`. The name can be customized using the
`spring.metrics.jdbc.datasource-metric-name`.
Metrics will be tagged by the name of the `DataSource` computed based on the bean name.
[[production-ready-metrics-integration]]
=== Spring Integration metrics
Auto-configuration will enable binding of a number of Spring Integration-related