Commit Graph

434 Commits

Author SHA1 Message Date
Dave Syer d63bbdfe44 Change constructor signature for RedisMetricRepository
Otherwise we had to rely on afterPropertiesSet() being called to
validate and compute the prefix and key (which depend on each
other).
2014-10-02 17:05:50 +01:00
Dave Syer c18b4248e5 Merge 1.1.x with minor conflict 2014-10-02 16:44:16 +01:00
Dave Syer e913b35227 Merge 1.1.x with minor conflict 2014-10-02 16:43:56 +01:00
Dave Syer d724c9062b Change key value if prefix changes
Some weird looking test failures led me to track this down.
If the user changes the prefix for metric names, he probably wanted
to change the keys as welll (otherwise 2 repositories can use the
same key, which is why the test was failing for me). We can do that
in an afterPropertiesSet().
2014-10-02 16:36:07 +01:00
Dave Syer a702ff5c36 Make ServerProperties bean conditional on being a webapp 2014-10-02 15:43:47 +01:00
joshiste 9af8fdb8a1 Expose RichGauges in MetricsEndpoint via PublicMetrics
Fixes gh-1635
2014-10-02 09:27:16 +01:00
Andy Wilkinson c601c09ecc Upgrade to Hibernate Validator 5.1.2.Final
Closes gh-1595
2014-10-01 17:28:29 +01:00
Dave Syer 2f4b89d19b Merge branch '1.1.x' 2014-10-01 16:12:28 +01:00
Dave Syer c3d1241e71 Allow override of pidfile location
The file name can now be overridden at runtime with a System property or
environment variable named "PIDFILE" (or "pidfile").

Fixes gh-1579
2014-10-01 16:11:11 +01:00
Dave Syer dd8db93781 Merge branch '1.1.x' 2014-10-01 08:26:58 +01:00
Dave Syer 79deed7ec5 Remove extra trailing '-' in metric name 2014-10-01 08:26:51 +01:00
Dave Syer bfb387bc02 Default prefix for redis keys doesn't need period 2014-09-30 15:09:22 +01:00
Spring Buildmaster edb4b7ed7d Next development version 2014-09-25 21:02:37 -07:00
Phillip Webb b9edf3c500 Merge branch '1.1.x' 2014-09-25 20:16:04 -07:00
Phillip Webb fa02c01727 Polish 2014-09-25 20:15:49 -07:00
Dave Syer 9d9819c338 Merge branch '1.1.x' 2014-09-25 18:15:33 +01:00
Dave Syer c1404b1e41 Tidy some Javadocs 2014-09-25 18:15:15 +01:00
Phillip Webb 0d0e5eb590 Merge branch '1.1.x' 2014-09-25 10:05:35 -07:00
Dave Syer 336b96b81c Copy server customization to management context
If the actuator endpoints are configured on a different port then there
are some settings in the main ServerProperties that we would like to
re-use (e.g. the access log). The easiest way to do that is to just
configure the management server using the same ServerProperties instance
and then overwrite the things that are different (and stored in
ManagementServerProperties).

Fixes gh-1581
2014-09-25 09:57:24 -07:00
Andy Wilkinson 944045cd34 Merge branch '1.1.x' 2014-09-22 09:27:13 +01:00
Marius Bogoevici 5c84e17d10 Activate WebSecurityEnabler only for web applications
Done in order to align with the rest of the configuration. Absent this
check, the bean will be installed in non-web applications without the
corresponding dependencies, causing the bootstrap to fail.

Closes gh-1588
2014-09-22 09:26:41 +01:00
Andy Wilkinson 3c93d9a803 Merge branch '1.1.x' 2014-09-17 19:41:14 +01:00
Andy Wilkinson 6dcaec2fef Make all @Bean methods public
This is a continuation of the changes made in 611f978. It makes some
more @Bean methods public and adds tests to spring-boot-actuator and
spring-boot-autoconfigure to prevent against non-public methods being
introduced in the future

Closes gh-1571
2014-09-17 19:39:39 +01:00
Phillip Webb 88f8eb7fa4 Merge branch '1.1.x' 2014-09-17 10:46:30 -07:00
Phillip Webb 611f978181 Make all @Bean methods public
Fixes gh-1571
2014-09-17 10:45:23 -07:00
Phillip Webb 4f610fa5a1 Merge branch '1.1.x'
Conflicts:
	spring-boot-samples/spring-boot-sample-tomcat-ssl/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/SampleTomcatSslApplicationTests.java
	spring-boot/src/main/java/org/springframework/boot/context/embedded/ConfigurableEmbeddedServletContainer.java
	spring-boot/src/main/java/org/springframework/boot/context/embedded/Ssl.java
2014-09-17 10:11:30 -07:00
Phillip Webb fae9ab4140 Fix failing tests 2014-09-17 10:08:05 -07:00
Dave Syer 049cd4b85b Merge branch '1.1.x' 2014-09-13 10:59:32 -05:00
Dave Syer deef784403 Blitz some more special characters from the metric names
When MVC path matchers are used as metric keys, they can still contain
invalid characters and patterns (like asterisks). This change removes
some more special characters and also tidies up the names a bit so
no key part starts or ends with "-" (which is ugly).

Fixes gh-1528
2014-09-13 10:59:20 -05:00
Dave Syer 437fb75424 Add /error to ignored paths for security autoconfig
Protecting /error doesn't make a great deal of sense and if it is
protected you don't get the ErrorPageFilter for the attempt at loading
it, so Tomcat renders its own HTML error page (when deployed as WAR).

Fixes gh-1548
2014-09-13 10:55:39 -05:00
Dave Syer f26209f248 Blitz some more special characters from the metric names
When MVC path matchers are used as metric keys, they can still contain
invalid characters and patterns (like asterisks). This change removes
some more special characters and also tidies up the names a bit so
no key part starts or ends with "-" (which is ugly).

Fixes gh-1528
2014-09-13 07:08:06 -05:00
Spring Buildmaster d63e4b4329 Next development version 2014-09-04 12:15:18 -07:00
Phillip Webb 8bf1f9567a Apply eclipse formatting and cleanup rules 2014-09-04 09:49:13 -07:00
Phillip Webb eaa3bd040d Apply eclipse formatting rules 2014-09-04 09:39:58 -07:00
Phillip Webb 57a154520e Drop min/max DataSourcePool metrics 2014-09-02 09:54:16 -07:00
Phillip Webb c8809afe1b Polish 2014-09-01 13:11:37 -07:00
Phillip Webb 5001b038cb Expose additional pool metrics
Expose `max` and `min`, alongside the existing `active` and `usage`
metrics.
2014-09-01 12:38:31 -07:00
Phillip Webb 4c8d35db43 Rename CompositeDataSourcePoolMetadataProvider
Rename CompositeDataSourcePoolMetadataProvider to
DataSourcePoolMetadataProviders.
2014-09-01 12:38:30 -07:00
Phillip Webb a512bcf766 Always auto-configure pool metadata providers
Import DataSourcePoolMetadataProvidersConfiguration from
DataSourceAutoConfiguration so that PoolMetadataProviders are configured
even if actuator is not used.
2014-09-01 12:38:26 -07:00
Phillip Webb 69107cb1df Create metadata sub-package
Create `org.springframework.boot.autoconfigure.jdbc.metadata` package
and move DataSourcePoolMetadata classes.
2014-09-01 12:29:04 -07:00
Phillip Webb e56be6cf3d DataSourceMetadata -> DataSourcePoolMetadata
Rename DataSourceMetadata to DataSourcePoolMetadata
2014-09-01 12:29:01 -07:00
Phillip Webb e17769fc2f Polish DataSourceMetrics code 2014-09-01 12:27:03 -07:00
Phillip Webb 169a46b1aa Rename MetricDataSourceAutoConfiguration
Rename MetricDataSourceAutoConfiguration to
DataSourceMetricsAutoConfiguration
2014-09-01 11:43:02 -07:00
Phillip Webb adbded33ff Apply eclipse formatting rules to 3dc932db 2014-09-01 11:42:53 -07:00
Stephane Nicoll 53c4859a6a Reuse data source validation query in health endpoint
This commit improves DataSourceMetadata to expose the validation
query. This can be used by DataSourceHealthIndicator as the query
to use instead of "guessing" which query could be applied according
to the database type.

Fixes gh-1282
2014-08-29 14:58:01 +02:00
Stephane Nicoll 2694941b93 Fix DataSourceMetadata location
This commit complements 3dc932db8 and fix the package location of
DataSourceMetadata.

Fixes gh-1013
2014-08-29 14:35:20 +02:00
Stephane Nicoll 3dc932db88 DataSource metrics
This commit adds an abstraction that provides a standard manner to
retrieve various metadata that are shared by most data sources.

DataSourceMetadata is implemented by the three data source
implementations that boot supports out-of-the-box: Tomcat, Hikari and
Commons dbcp.

This abstraction is used to provide two additional metrics per data
source defined in the application: the number of allocated
connection(s) (.active) and the current usage of the connection pool
(.usage).

All such metrics share the 'datasource.' prefix. The prefix is further
qualified for each data source:

* If the data source is the primary data source (that is either the
  only available data source or the one flagged @Primary amongst the
  existing ones), the prefix is "datasource.primary"
* If the data source bean name ends with "dataSource", the prefix is
  the name of the bean without it (i.e. batchDataSource becomes batch)
* In all other cases, the name of the bean is used

It is possible to override part or all of those defaults by
registering a bean with a customized version of
DataSourcePublicMetrics.

Additional DataSourceMetadata implementations for other data source
types can be added very easily, check
DataourceMetadataProvidersConfiguration for more details.

Fixes gh-1013
2014-08-29 11:22:11 +02:00
Mattias Severson 04c3e9979f Fix typo
Fixes gh-1463
2014-08-28 11:13:33 -07:00
Mattias Severson 5dcc4c3829 Fix typo
Fixes gh-1463
2014-08-28 14:30:13 +02:00
Dave Syer 171b2e452b Make ServerProperties bean conditional on being a webapp 2014-08-20 09:09:19 +01:00