Extensible MicrometerMetricsCaptor and polishing

- change `loadCaptor` to return any existing captor
- make builders and facades protected to allow subclassing
- change `AbstractMeter.getMeter()` to use generics
- add test case demonstrating meter name changes
- docs

* Polishing - PR Comments, and rebase
This commit is contained in:
Gary Russell
2018-10-22 19:58:54 -04:00
committed by Artem Bilan
parent 1d1abf257d
commit eed5fe7a88
4 changed files with 173 additions and 24 deletions

View File

@@ -157,6 +157,9 @@ In addition, there are three `Gauge` Meters:
* `spring.integration.handlers`: The number of `MessageHandlers` in the application.
* `spring.integration.sources`: The number of `MessageSources` in the application.
It is possible to customize the names and tags of `Meters` created by integration components by providing a subclass of `MicrometerMetricsCaptor`.
The https://github.com/spring-projects/spring-integration/blob/master/spring-integration-core/src/test/java/org/springframework/integration/support/management/micrometer/MicrometerCustomMetricsTests.java[MicrometerCustomMetricsTests] test case shows a simple example of how to do that.
You can also further customize the meters by overloading the `build()` methods on builder subclasses.
[[mgmt-channel-features]]
==== `MessageChannel` Metric Features

View File

@@ -200,3 +200,9 @@ Object name key values are now quoted if they contain any characters other than
e.g. `org.springframework.integration:type=MessageChannel,` `name="input:foo.myGroup.errors"`.
This has the side effect that previously "allowed" names, with such characters, will now be quoted.
e.g. `org.springframework.integration:type=MessageChannel,` `name="input#foo.myGroup.errors"`.
[[x51.-micrometer]]
=== Micrometer Support Changes
It is now simpler to customize the standard Micrometer meters created by the framework.
See <<micrometer-integration>> for more information.