Add observation to inbound endpoints (#3930)

* Add observation to inbound endpoints

* * Improve `Observation` logic in the `MessageProducerSupport` and `MessagingGatewaySupport`
* Clean up Javadocs in observation support classes
* Add test for `MessagingGatewaySupport` instrumentation into `IntegrationObservabilityZipkinTests`
* Add docs for `@EnableIntegrationManagement.observationPatterns()`
* The generated docs for metrics and spans looks OK: have both `Gateway` and `Handler` section now

* * Fix Checkstyle violations

* * Fix `IntegrationMBeanExporter` to filter out a `MessageProducer` from sources.
Marking a `MessageProducerSupport` with an `IntegrationInboundManagement`
causes it to be considered as a source for JMX.
Technically it might have a reason since it is indeed a source, but that's fully different story

* * No observation instrumentation by default

* * Fix "no observation by default" configuration logic
This commit is contained in:
Artem Bilan
2022-11-01 15:28:54 -04:00
committed by GitHub
parent ef63d90262
commit bd207ff42a
14 changed files with 458 additions and 73 deletions

View File

@@ -150,7 +150,13 @@ registry.config().meterFilter(MeterFilter.deny(id ->
Starting with version 6.0, Spring Integration utilizes a Micrometer Observation abstraction which can handle metrics as well as https://micrometer.io/docs/tracing[tracing] via appropriate `ObservationHandler` configuration.
The observation handling is enabled on the `IntegrationManagement` components whenever an `ObservationRegistry` bean is present in the application context.
The observation handling is enabled on the `IntegrationManagement` components whenever an `ObservationRegistry` bean is present in the application context and an `@EnableIntegrationManagement` is configured.
To customize what set of components should be instrumented, an `observationPatterns()` attribute is exposed on the `@EnableIntegrationManagement` annotation.
See its javadocs for a pattern matching algorithm.
IMPORTANT: By default, none of the `IntegrationManagement` components are instrumented with an `ObservationRegistry` bean.
Can be configured as `*` to match all components.
The meters are not gathered in this case independently, but delegated to an appropriate `ObservationHandler` configured on the provided `ObservationRegistry`.
An observation production on the `IntegrationManagement` components can be customized via `ObservationConvention` configuration.