Skip to content

Instrument pollable consumers with Spring Integration metrics - #3330

Merged
olegz merged 1 commit into
mainfrom
gh-3328-pollable-metrics
Nov 4, 2026
Merged

olegz merged 1 commit into
mainfrom
gh-3328-pollable-metrics

Conversation

@olegz

@olegz olegz commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #3328

DefaultPollableMessageSource.poll() invoked the handler directly and was not an IntegrationManagement component, so no spring.integration.* meters/observations were recorded for pollable bindings.

  • DefaultPollableMessageSource now implements IntegrationManagement and BeanNameAware.
  • Records spring.integration.receive{type=source} per received message and spring.integration.send{type=handler,result,exception} around the handler (per retry attempt), or an IntegrationObservation.HANDLER observation when an ObservationRegistry is active.
  • BindableFunctionProxyFactory registers the pollable bean under its concrete type so IntegrationManagementConfigurer discovers it.
  • Added a unit test; core/spring-cloud-stream tests pass.

Not addressed: distinguishing the terminal outcome after retries are exhausted (open question in the issue).

@olegz
olegz force-pushed the gh-3328-pollable-metrics branch from dec4954 to 65d56bd Compare November 4, 2026 15:47
Make DefaultPollableMessageSource an IntegrationManagement component so
it receives a MetricsCaptor / ObservationRegistry. poll() now records
spring.integration.receive for received messages and
spring.integration.send (or an IntegrationObservation.HANDLER
observation) around the handler invocation.

Register the pollable bean under its concrete type so the
IntegrationManagementConfigurer can discover it.

Resolves #3328

Signed-off-by: Oleg Zhurakousky <oleg.zhurakousky@broadcom.com>
@olegz
olegz force-pushed the gh-3328-pollable-metrics branch from 65d56bd to 2918a1f Compare November 4, 2026 15:49
@olegz
olegz merged commit fb21641 into main Nov 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pollable consumers (PollableMessageSource) are not instrumented by Spring Integration metrics/observations

1 participant