Commit Graph

301 Commits

Author SHA1 Message Date
Yulin Qin eee2694648 Add health indicator for reactive MongoDB
See gh-11997
2018-02-13 11:22:04 +01:00
Andy Wilkinson a02fdc755e Stop MeterRegistries when context is closed
Closes gh-12006
2018-02-13 09:34:11 +00:00
Johnny Lim 87bf0b26df Polish modifier order
See gh-12019
2018-02-13 09:49:59 +01:00
Phillip Webb 3bec55e16c Formatting 2018-02-12 17:49:53 -08:00
Madhura Bhave 16a499b2fa Cloud Foundry health should always show details
Fixes gh-12014
2018-02-12 15:28:06 -08:00
Phillip Webb f34aa6f4d8 Migrate to Spring Integration Micrometer support
Remove custom `SpringIntegrationMetrics` and instead provide
auto-configuration to the direct Micrometer support added in Spring
Integration 5.0.2.

Closes gh-11985
2018-02-12 13:24:29 -08:00
Andy Wilkinson b0e86bd7ac Align New Relic and Signal FX tests with those for other exporters
Closes gh-11970
2018-02-12 20:43:56 +00:00
Andy Wilkinson 384a4ed6a9 Use metrics export.*.enabled properties to control auto-configuration
Closes gh-11978
2018-02-12 20:18:11 +00:00
Phillip Webb 0348889fd7 Polish 2018-02-12 10:03:06 -08:00
Andy Wilkinson e49d50fe9d Improve testing of metrics auto-configuration
Closes gh-11970
2018-02-12 17:05:05 +00:00
Johnny Lim 5a9865dabb Polish
Closes gh-12004
2018-02-12 17:10:43 +01:00
Stephane Nicoll 7473642f58 Harmonize endpoints exclude property
Closes gh-11914
2018-02-12 14:00:40 +01:00
Andy Wilkinson 037b6d8ba2 Auto-configure Micrometer's New Relic and SignalFX support
Closes gh-11803
2018-02-12 12:00:38 +00:00
Andy Wilkinson bc814d2039 Prevent authenticated principal from clashing with argument of same name
Closes gh-11988
2018-02-12 10:46:19 +00:00
Phillip Webb 63c827b14d Ensure exports are configured before endpoint
Update `SimpleMetricsExportAutoConfiguration` to ensure that it runs
before `SimpleMetricsExportAutoConfiguration`.

See gh-11977
2018-02-09 14:44:07 -08:00
Phillip Webb d259f68fbf Drop recordRequestPercentiles property
Drop the `recordRequestPercentiles` property as it overlaps with the
property based `MeterFilter` support.

Fixes gh-11982
2018-02-09 13:59:46 -08:00
Phillip Webb 601157f552 Polish "Add publishUnchangedMeters StatsD support"
Closes gh-11967
2018-02-09 12:09:45 -08:00
Jon Schneider e02eba2a33 Add publishUnchangedMeters StatsD support
Add configuration property to support publishing unchanged pollable
meters.

See gh-11967
2018-02-09 12:09:41 -08:00
Phillip Webb 3ec778fb64 Polish 2018-02-09 11:31:53 -08:00
Andy Wilkinson 351e1ec4de Ensure that metrics export backs off when there's no Clock
Closes gh-11977
2018-02-09 17:14:06 +00:00
Madhura Bhave e9fe918d25 Add option to skip ssl for reactive CF actuators
Fixes gh-10898
2018-02-09 08:46:29 -08:00
Andy Wilkinson fee9dacab1 Allow use of custom DatadogConfig without requiring api-key property
Closes gh-11979
2018-02-09 16:04:16 +00:00
Andy Wilkinson cc3d7648c1 Auto-configure Micrometer's Clock in a single place
Closes gh-11977
2018-02-09 15:26:10 +00:00
Stephane Nicoll 077d00fcb3 Polish 2018-02-09 16:07:58 +01:00
Andy Wilkinson 03d7c3a7af Repackage HTTP tracing auto-configuration classes
Closes gh-11934
2018-02-09 12:03:48 +00:00
Andy Wilkinson a6ecd55f1f Make expose and exclude properties affect servlet endpoints
Closes gh-11968
2018-02-09 11:24:18 +00:00
Andy Wilkinson 2993dccd1e Provide links to all types of endpoints
Previously, links were only provide to web endpoints. This commit
expands link resolution to also provide links for servlet endpoints,
controller endpoints, and rest controller endpoints.

Closes gh-11902
2018-02-09 10:56:15 +00:00
Phillip Webb 204f6f67fd Migrate all of metrics to auto-configuration
Migrate remaining metrics `@Configuration` classes to individual
auto-configurations.

Fixes gh-11935
2018-02-08 22:39:47 -08:00
Phillip Webb 6f7f11fd96 Refine metrics export auto-configure ordering
The `SimpleMetricsExportAutoConfiguration` should be last and it should
check for a `MeterRegistry` bean.

See gh-11838
2018-02-08 19:22:37 -08:00
Phillip Webb 5de46c3186 Polish 2018-02-08 16:35:10 -08:00
Phillip Webb 387804e600 Format with Eclipse Oxygen SR2 2018-02-08 15:44:32 -08:00
Andy Wilkinson 5522174e96 Provide package info for all packages included in javadoc 2018-02-08 16:50:37 +00:00
Andy Wilkinson dec37ec5e2 Move EndpointMapping into spring-boot-actuator 2018-02-08 15:13:27 +00:00
Andy Wilkinson 4beb6be179 Rename HTTP trace properties and packages
Closes gh-11934
2018-02-08 13:08:27 +00:00
Andy Wilkinson a09c64e18c Polish 2018-02-08 11:15:36 +00:00
Stephane Nicoll 7cd19822c6 Polish "Add Kafka health indicator"
Closes gh-11515
2018-02-08 11:58:42 +01:00
Juan Camilo Rada 0dbd9429cc Add Kafka health indicator
See gh-11515
2018-02-08 11:55:37 +01:00
Andy Wilkinson 76a450dfba Format with Eclipse Oxygen SR2 2018-02-08 10:53:53 +00:00
Madhura Bhave 7136bed126 Fix tests 2018-02-07 17:36:44 -08:00
Michael J. Simons 97a97f3784 Polish 2018-02-07 13:37:10 +00:00
Stephane Nicoll 63d2e944ba Polish "Add influx property to govern whether db is auto-created or not"
Closes gh-11922
2018-02-07 12:55:20 +01:00
Jon Schneider 9b215df4e9 Add influx property to govern whether db is auto-created or not 2018-02-07 12:55:20 +01:00
Andy Wilkinson 8229733f0d Avoid triggering early init when creating MeterRegistryPostProceesor
Closes gh-11890
2018-02-07 11:13:11 +00:00
Andy Wilkinson 8605499a64 Provide more control over when the health endpoint shows details
Closes gh-11869
2018-02-07 09:51:19 +00:00
Phillip Webb d8de8752ea Change metrics exporters to auto-configurations
Refactor `*ExportConfiguration` classes to be regular auto-configuration
classes.

Also removed the `@ConditionalOnProperty` guards for `.enabled` properties
since auto-configuration can now be excluded in the usual way. Enabled
properties remain where applicable and are adapted for Micrometer to use
as it sees fit.

Fixes gh-11838
2018-02-06 17:42:14 -08:00
Phillip Webb 6889ad59b8 Support property based MeterFilters
Add per-meter property support for `enabled`, `percentiles-histogram`,
`percentiles` and `sla`.

Fixes gh-11800
2018-02-06 13:21:27 -08:00
Andy Wilkinson 7d561f5ed0 Polish "Align with Micrometer's standardized cache metrics"
Closes gh-11918
2018-02-06 11:13:37 +00:00
Andy Wilkinson 2cc7325017 Polish 2018-02-02 20:51:14 +00:00
Andy Wilkinson 875091ed85 Polish “Remove or use unused method parameters”
Closes gh-11812
2018-02-02 09:34:19 +00:00
igor-suhorukov 717bd2c580 Remove or use unused method parameters 2018-02-02 09:34:19 +00:00
Phillip Webb 3ff772957b Add WebServerApplicationContext abstraction
Add a new `WebServerApplicationContext` interface that provides a common
abstraction for all application contexts that create and manage the
lifecycle of an embedded `WebServer`.

Allows server namespaces to become a first-class concept (rather
subverting `ConfigurableWebApplicationContext.getNamespace()`) and
allow us to drop `getServerId()` from `WebServerInitializedEvent`.

Also helps to improve `ManagementContextAutoConfiguration` and
`ManagementContextFactory`.

Fixes gh-11881
2018-02-01 16:38:15 -08:00
Jon Schneider 09181d6b16 Fix CompositeMeterRegistryPostProcessor autowire
Update `CompositeMeterRegistryPostProcessor` to use constructor
autowiring for `Clock` detection.

Fixes gh-11856
2018-01-30 20:27:22 -08:00
Stephane Nicoll f7bf79c9b3 Polish deprecated metadata 2018-01-30 17:45:01 +01:00
Stephane Nicoll 8b3c2b01e3 Fix broken replacement ids 2018-01-30 15:23:21 +01:00
Andy Wilkinson 356efaa7c8 Rename trace to httptrace
Closes gh-11806
2018-01-30 12:55:27 +00:00
Jon Schneider 2612b43179 Restrict maximum URI tags to prevent memory issues
Add MeterFilter to restrict the maximum number of web client URI tags
created. Prior to this commit, if a user was manually building URIs for
use with a RestTemplate (rather than using uriVariables) the JVM could
run out of memory.

Fixes gh-11338

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2018-01-30 00:32:09 -08:00
Phillip Webb 8f23ee4e58 Apply micrometer MeterFilter beans automatically
Update `MeterRegistryPostProcessor` and `MetricsAutoConfiguration` so
that micrometer `MeterFilter` beans are automatically applied.

Fixes gh-11843
2018-01-30 00:15:33 -08:00
Phillip Webb c90a5a9e9e Polish 2018-01-29 21:35:56 -08:00
Phillip Webb 5632d043ff Fix enums following upstream micrometer change
See gh-11575
2018-01-29 19:51:51 -08:00
Phillip Webb 9a8c182d19 Only use micrometer composites when necessary
Update micrometer auto-configuration so that a `CompositeMeterRegistry`
is only created when more than one `MeterRegistry` bean is declared.
When a composite is crated, it is marked as `@Primary` so that it
can be directly injected. Meter registries can now be defined directly
as beans, and auto-configuration can back off in the usual way.

The `MeterRegistryConfigurer` is now called `MeterRegistryCustomizer`
and is generically types so it's easy to apply customizations to a
particular `MeterRegistry` implementation.

Fixes gh-11799

Co-authored-by: Jon Schneider <jschneider@pivotal.io>
2018-01-29 16:52:01 -08:00
Andy Wilkinson e834b25ef1 Polish 2018-01-29 20:20:58 +00:00
Phillip Webb af50a18da9 Polish 2018-01-29 09:47:03 -08:00
Stephane Nicoll eba476ba6e Disable LoggersEndpoint if the logging system is disabled
Closes gh-11793
2018-01-29 16:37:28 +01:00
Andy Wilkinson 9edcd25c25 Simply test for async dispatch metrics filter registration
Previously, the test in MetricsAutoConfigurationIntegrationTests was
testing the functionality of WebMvcMetricsFilter to verify that the
auto-configuration had registered the filter for async dispatches.
This test was complex and covered the same code as a test in
WebMvcMetricsFilterTests.

This commit reworks the test to examine the dispatcher types on the
filter registration directly instead.

Closes gh-11826
2018-01-29 11:23:58 +00:00
Stephane Nicoll a515c5b7d1 Polish contribution
Closes gh-11811
2018-01-29 08:12:35 +01:00
Johnny Lim 914bdb393f Polish
See gh-11811
2018-01-29 08:11:09 +01:00
Phillip Webb 5767350380 Polish 2018-01-26 22:12:07 -08:00
Johnny Lim 6d68806275 Polish
Closes gh-11805
2018-01-27 05:22:04 +01:00
Jon Schneider b254761c5e Support micrometer Graphite tagsAsPrefix property
Fixes gh-11797
2018-01-26 19:57:48 -08:00
Phillip Webb 0b689a5b10 Polish MetricsFilter registration async support
Closes gh-11348
2018-01-26 19:51:03 -08:00
Nikolay Rybak b6af06a55f Fix MetricsFilter registration to support async
Update `WebMvcMetricsConfiguration` so that the filter is registered
with the correct settings to support async requests.

See gh-11348
2018-01-26 19:51:03 -08:00
Phillip Webb 25815ca7e1 Refine WebMvcMetricsFilter for async support
Rework `WebMvcMetricsFilter` so that async requests can be handled
correctly.

See gh-11348
2018-01-26 19:51:02 -08:00
Phillip Webb 643cda480f Migrate to updated micrometer Tags class
See gh-11575
2018-01-26 14:42:38 -08:00
Jon Schneider fd237f85cc Extract common micrometer test setup
Create `MetricsRun` that can be used to apply common micrometer test
configuration to a `ApplicationContextRunner`.

Closes gh-11804
2018-01-26 14:42:22 -08:00
Jon Schneider d1de1cd053 Upgrade to micrometer 1.0.0-SNAPSHOT
Move to the snapshots and rework changed APIs in preparation for
the upcoming rc8 release.

See gh-11575
2018-01-26 11:40:37 -08:00
Phillip Webb b234501af3 Polish 2018-01-26 11:39:41 -08:00
Andy Wilkinson 988fc18f8c Simplify endpoint enablement and update reference documentation
Closes gh-11755
2018-01-26 12:12:11 +00:00
Stephane Nicoll fe7d7e2fc9 Polish 2018-01-26 09:51:54 +01:00
Johnny Lim 15fb62718d Remove unused parameters
Closes gh-11785
2018-01-26 09:30:02 +01:00
Andy Wilkinson 3565961d68 Rework HTTP exchange tracing and add support for WebFlux
Closes gh-9980
2018-01-25 13:27:07 +00:00
Andy Wilkinson 4c23afdcd8 Polish 2018-01-25 11:04:16 +00:00
Phillip Webb 017efda6ec Add @EndpointServlet and migrate Jolokia
Add first class support for Servlet based endpoints and rework the
Jolokia endpoint to use it.

Fixes gh-10264
2018-01-24 17:06:13 -08:00
Phillip Webb 3bd940baaa Polish "Add more WebEndpointAutoConfiguration tests"
Closes gh-11754
2018-01-24 16:24:50 -08:00
Yunkun Huang d8527a9708 Add tests for WebEndpointAutoConfiguration
Closes gh-11754
See gh-11684
2018-01-24 16:24:50 -08:00
Phillip Webb ab6ad6aa4b Polish 2018-01-24 16:09:14 -08:00
Andy Wilkinson 292025936e Omit null properties from actuator endpoint API response examples
Closes gh-11757
2018-01-24 16:40:10 +00:00
Madhura Bhave 55c8ceb440 Polish 2018-01-23 17:01:46 +05:30
andrey.onufreyko b19dcb13e2 Replace string arguments with char
Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
2018-01-22 16:35:06 -08:00
Johnny Lim 768e7c07e6 Polish
Closes gh-11720
2018-01-22 16:06:45 -08:00
Andy Wilkinson fbb1ba1bb3 Move actuator mappings introspection classes into dedicated packages
Closes gh-9979
2018-01-22 11:25:40 +00:00
Phillip Webb bda9b892b3 Add direct WebFlux and WebMvc endpoint support
Add `@ControllerEndpoint` and `@RestControllerEndpoint` annotations that
can be used to develop a Spring-only request mapped endpoint. Both
Spring MVC and Spring WebFlux are supported.

This feature is primarily for use when deeper Spring integration is
required or when existing Spring Boot 1.5 projects want to migrate to
Spring Boot 2.0 without re-writing existing endpoints. It comes at the
expense of portability, since such endpoints will be missing from
Jersey.

Fixes gh-10257
2018-01-19 21:06:32 -08:00
Phillip Webb 340ef52f78 Refactor endpoint path concerns
Create a `PathMappedEndpoint` interface that allows any `ExposedEndpoint`
to provide root path details. The `EndpointPathResolver` interface has
been renamed to `PathMapper` and is now only used during endpoint
discovery.

`EndpointPathProvider` has been replaced with `PathMappedEndpoints`
which simply finds relevant path mapped endpoints.

Fixes gh-10985
2018-01-19 20:44:24 -08:00
Phillip Webb 1d39feffea Overhaul actuator endpoint code
Refactor several areas of the actuator endpoint code in order to make
future extensions easier. The primary goal is to introduce the concept
of an `ExposableEndpoint` that has technology specific subclasses and
can carry additional data for filters to use. Many other changes have
been made along the way including:

* A new EndpointSupplier interface that allows cleaner separation of
  supplying vs discovering endpoints. This allows cleaner class names
  and allows for better auto-configuration since a user can choose to
  provide their own supplier entirely.

* A `DiscoveredEndpoint` interface that allows the `EndpointFilter`
  to be greatly simplified. A filter now doesn't need to know about
  discovery concerns unless absolutely necessary.

* Improved naming and package structure. Many technology specific
  concerns are now grouped in a better way. Related concerns are
  co-located and concepts from one area no longer leakage into another.

* Simplified `HandlerMapping` implementations. Many common concerns have
  been pulled up helping to create simpler subclasses.

* Simplified JMX adapters. Many of the intermediary `Info` classes have
  been removed. The `DiscoveredJmxOperation` is now responsible for
  mapping methods to operations.

* A specific @`HealthEndpointCloudFoundryExtension` for Cloud Foundry.
  The extension logic used to create a "full" health endpoint extension
  has been made explicit.

Fixes gh-11428
Fixes gh-11581
2018-01-19 20:44:24 -08:00
Phillip Webb dc935fba48 Polish 2018-01-19 20:44:18 -08:00
Madhura Bhave 5e2cc02499 Move servlet specific security auto-config 2018-01-20 09:41:50 +05:30
Stephane Nicoll c926bed6f5 Polish "Fix modifiers order"
Closes gh-11681
2018-01-19 11:30:30 +01:00
igor-suhorukov e2d05607f2 Fix modifiers order
See gh-11681
2018-01-19 11:30:06 +01:00
Johnny Lim 9d24186942 Use this() in EndpointRequests
Closes gh-11690
2018-01-19 11:15:42 +01:00
Phillip Webb 0b81f78a2a Revert "Create CloudFoundry-specific EndpointWebExtension"
This reverts commit 7189f426ed.
2018-01-18 23:21:51 -08:00
Phillip Webb f3379668ac Polish 2018-01-18 23:21:51 -08:00