Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQ] Spring - Add health indicator for Event Hub stream binder #19578

Closed
saragluna opened this issue Mar 3, 2021 · 7 comments · Fixed by #19810
Closed

[FEATURE REQ] Spring - Add health indicator for Event Hub stream binder #19578

saragluna opened this issue Mar 3, 2021 · 7 comments · Fixed by #19810
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-eventhubs Spring event hubs related issues. Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved.
Milestone

Comments

@saragluna
Copy link
Member

saragluna commented Mar 3, 2021

Goal

We need to add a health indicator for azure-spring-cloud-stream-binder-eventhubs, this will show the status of the EH binder in /actuator/health endpoint:
image

Counterparts

Kafka binder

The Kafka binder's health indicator creates a metadataConsumer and uses this consumer to check whether a partition is alive:

https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/blob/e2eca34e4b8f7fc0dab2f19a19094cce0dfda2e4/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderHealthIndicator.java#L115-L167

AWS Kinesis binder

Similiar to the Kafka implementation:

https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/blob/cd64d8918b073b3b3ddfbf4b8747c16fcffc231d/spring-cloud-stream-binder-kinesis/src/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisBinderHealthIndicator.java#L44-L70

Rabbit binder

https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/blob/e39487a4ce6c121d74c0e2778393d827cfc509bb/spring-cloud-stream-binder-rabbit/src/main/java/org/springframework/cloud/stream/binder/rabbit/config/RabbitServiceAutoConfiguration.java#L206-L215

Conclusion

They all use the underlying SDK to test whether the connection to the broker is alive or whether the broker is in a healthy state.

How to implement

The ideal way to implement this is to:

  1. Get the instance of the EH client used by a binder.
  2. Perform a low-cost operation on the client and try to determine the liveness of the EH client

However, our EH SDK doesn't provide such functions, take the EventProcessorClient for example, it only has an isRunning() method. We can't get the raw EH client via an EventProcessorClient object.

public synchronized boolean isRunning() {
return isRunning.get();
}

So the first step to implement the health indicator is to call the isRunning method, and for the next step, we need to work with the EH sdk to see whether we could get more info through the EventProcessorClient.

Spring Cloud Stream's default implementation

https://github.com/spring-cloud/spring-cloud-stream/blob/93acdcf85ad3d47936d71cd5bcc38eefb0d4290a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/BindersHealthIndicatorAutoConfiguration.java

@saragluna saragluna added Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved. azure-spring All azure-spring related issues azure-spring-eventhubs Spring event hubs related issues. labels Mar 3, 2021
@saragluna saragluna added this to the [2021] March milestone Mar 3, 2021
@saragluna
Copy link
Member Author

Hi @conniey, @srnagar, @YijunXieMS

As we're going to add the health indicator for our EH binder, which uses the EventProcessorClient as the consumer, but we find out that we can't get sufficient information from the EventProcessorClient, such as whether the client is alive.

Is it possible that the EventProcessorClient could expose an API to get the status of the underlying eventHubAsyncClient and perform some low-cost operations on it?

@conniey
Copy link
Member

conniey commented Mar 4, 2021

This sounds similar to #19391.

Can you give a more concrete scenario of the metrics you want? (ie. I want to know how many partitions I own")

@saragluna
Copy link
Member Author

Adding more related issues: microsoft/spring-cloud-azure#521

@saragluna saragluna self-assigned this Mar 5, 2021
@saragluna
Copy link
Member Author

It's a little different from the metrics, the health indicator is used to indicate the health condition of the application components. So for the event hubs stream binder, the health indicator should indicate these:

  • The connectivity of the event hub client
  • The health conditions of each partition

@conniey
Copy link
Member

conniey commented Mar 8, 2021

@saragluna
As far as I know, Event Hubs does not expose any "health condition" of each partition information. @JamesBirdsall may know more.

We can say if the Event Hub client is connected or not though.

Is that the information you need?

@saragluna
Copy link
Member Author

@conniey, I think for the moment to tell whether the EH client is connected is what we need.

@saragluna
Copy link
Member Author

Closing this issue now.

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this issue Aug 1, 2022
Compute update folder structure (Azure#19723)

* update folder structure

* small errors and CI check

* [Language Text] Update swagger titles (Azure#19835)

* [Language Text] Update swagger titles

* edits

* address feedback

* Review request for Microsoft.ContainerService to add version 2022-06-01 (Azure#19848)

* Adds base for updating Microsoft.ContainerService from version stable/2022-04-01 to version 2022-06-01

* Updates readme

* Updates API version in new specs and examples

* update readmes (Azure#19421)

* Add key management service profile of a managed cluster for version 2022-06-01 (Azure#19529)

* Add NetworkPlugin none option to 2022-06-01 (Azure#19510)

* Add NetworkPlugin none option to 2022-06-01

* improve description for none value

* Fix violated rule R4041 for 2022-06-01 managedCluster swagger (Azure#19581)

* remove useless directive

* fix R4041

* GA AKS support for Dedicated Host Group (Azure#19547)

* GA AKS support for Dedicated Host Group

* fit some format minor issue

* add newline in end of files

* Defender updates (Azure#19665)

* Defender updates

* sample

* remove old description

Co-authored-by: Bin Xia <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Jianping Zeng <[email protected]>
Co-authored-by: Or Parnes <[email protected]>

* Update resources.json (Azure#19861)

* Pattts/predictive autoscale 20221001 (Azure#19765)

* Rev Autoscale API from 2021-05-01-preview to 2022-10-01.

* Fix minor swagger issue. Default should be 'false'

* Fix swagger validation error

* Defining a new package 2022-10

* AutoscaleSettingResource now reference allOf 'resource' which is the actual autoscaleSetting resource definition

* Fix require property issue

* Run prettier against autoscale_API.json

* [Maps - Render & Spatial Services] add v2022-08-01 (Azure#19520)

* copy old swagger to new folders

* set api version to 2022-08-01

* apply api changes

Co-authored-by: Gigi Grajo <[email protected]>

* update appconfiguration (Azure#19330)

* update appconfiguration

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* [Hub Generated] Publish private branch 'main' (Azure#19852)

* Add StorageMover specification for PubliC Preview

* SpellCheck fix

* Update custom-words

* Update specification/storagemover/resource-manager/readme.md

Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Dapeng Zhang <[email protected]>

* Merging Dynatrace swagger in stable folder (Azure#19862)

* Committing base swagger version

* Removing preview tag from stable folder api version

* Changing version name in all the files

* Updating readme.go and readme.md files

* [CDN] Fix customDomains property type in Endpoint (Azure#19788)

* [CDN] Fix customDomains property type in Endpoint

* Fix linter error

Co-authored-by: Bo Zhang <[email protected]>

* Adding Microsoft.Sql AdvancedThreatProtectionSettings APIs for MI on v5 tag for 2022-02-01-preview (Azure#19866)

* update folders

* [Hub Generated] Review request for Microsoft.KeyVault to add version stable/7.3 (Azure#19844)

* Update description of exportable attribute and release_policy.data

* Remove submodule azure-reset-api-specs

* Fix description for exportable

Co-authored-by: Sunny Solanki <[email protected]>

* Add latest StorageMover updates (Azure#19876)

* Add StorageMover specification for PubliC Preview

* SpellCheck fix

* Update custom-words

* Update specification/storagemover/resource-manager/readme.md

* Add latest StorageMover updates

Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Dapeng Zhang <[email protected]>

* Update readme.python.md (Azure#19899)

* Update readme.python.md

* Update readme.md

* Moving files from azure-rest-spec-pr to azure-rest-spec repo after api review (Azure#19878)

* Moving files from azure-rest-spec-pr to azure-rest-spec repo after api review

* Add known words

* Removed static IP allocation only from examples (Azure#19858)

* Removed static IP allocation

* Removed static only from examples

Co-authored-by: Arpit Gagneja <[email protected]>

* Update securityinsights readme.python (Azure#19903)

* update securityinsights readme.python

* Update readme.python.md

Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* fix lint errors in Synapse trigger.json (Azure#19660)

* put json files into RP folders

* update readme

* Add CONTRIBUTING.md (Azure#19257)

* Add CONTRIBUTING.md

* Apply suggestions from PR review

Co-authored-by: Heath Stewart <[email protected]>

* Apply suggestions from PR review

Co-authored-by: Weidong Xu <[email protected]>

* Regen toc for CONTRIBUTING.md

* Address PR review comments

* Address PR review comments

Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Weidong Xu <[email protected]>

* fix devcenter readme.go.md config (Azure#19906)

* fix readme.go.md config

* rename to SkuInfo

* add annotation for labservices (Azure#19884)

* add to description of OS state (Azure#19764)

* [Hub Generated] Review request for Microsoft.KeyVault to add version preview/2021-06-01-preview (Azure#19767)

* Updated the managed hsm resource manager spec to include two additional properties for private endpoint connection item

* Update managed hsm private endpoint connection item in mhsm spec for latest api version

* Address LRO_RESPONSE_HEADER violation for managed hsm

Long running operations that are annotated with x-ms-long-running-operation:true
must return location header or azure-AsyncOperation in response.
Added the missing location header for managed hsm update command as well as to the corresponding
examples.

* [Microsoft.DeviceUpdate] Adding first stable API version (Azure#19846)

* Copied the most recent preview version into the first stable version

* Updated api version in new stable version, added the tag to readme.md

* Fixed typo

* Fixed the wrong path in readme.md

* Reverted VS Code automatic breaking change

* Fix broken link (Azure#19688)

* add aadObjectId property to kustoPool (Azure#19856)

Co-authored-by: Amit Elran <[email protected]>

* Updata securityinsights readme.python (Azure#19917)

* update securityinsights readme.python

* update readme.python

Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* modify readme.typescripy.md for compute package (Azure#19607)

Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* Dev gubalasu frontdoor microsoft.network 2021 06 01 (Azure#19578)

* Adds base for updating Microsoft.Network from version stable/2020-05-01 to version 2021-06-01

* Updates readme

* Updates API version in new specs and examples

* update waf configs and examples from 2020-11-01

* Update api version in new specs and examples

* Migration api update

* Update readme

* Fix readme

* update readme

* Fix readme again

* Fix readme

* Fix readme

* update waf policy provisioning state

* Update securityinsights readme.python (Azure#19923)

* update securityinsights readme.python

* update readme.python

* last modify

* Update readme.python.md

Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* sync with changes made to master

* update folder structure

* small errors and CI check

* update folders

* put json files into RP folders

* update readme

* resolve capitalization and number misplacement accident

Co-authored-by: Theodore Chang <[email protected]>
Co-authored-by: Deyaaeldeen Almahallawi <[email protected]>
Co-authored-by: FumingZhang <[email protected]>
Co-authored-by: Bin Xia <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Jianping Zeng <[email protected]>
Co-authored-by: Or Parnes <[email protected]>
Co-authored-by: Alexander Batishchev <[email protected]>
Co-authored-by: PatrickTseng <[email protected]>
Co-authored-by: gigi <[email protected]>
Co-authored-by: Gigi Grajo <[email protected]>
Co-authored-by: zhenbiao wei <[email protected]>
Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Dapeng Zhang <[email protected]>
Co-authored-by: Divyansh Agarwal <[email protected]>
Co-authored-by: t-bzhan <[email protected]>
Co-authored-by: Bo Zhang <[email protected]>
Co-authored-by: Uriel Cohen <[email protected]>
Co-authored-by: susolank <[email protected]>
Co-authored-by: Sunny Solanki <[email protected]>
Co-authored-by: Ralf Beckers <[email protected]>
Co-authored-by: arpit-gagneja <[email protected]>
Co-authored-by: Arpit Gagneja <[email protected]>
Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>
Co-authored-by: YanjunGao <[email protected]>
Co-authored-by: Mike Kistler <[email protected]>
Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Weidong Xu <[email protected]>
Co-authored-by: Jiahui Peng <[email protected]>
Co-authored-by: j-zhong-ms <[email protected]>
Co-authored-by: Tom FitzMacken <[email protected]>
Co-authored-by: neeerajaakula <[email protected]>
Co-authored-by: darkoa-msft <[email protected]>
Co-authored-by: Roy Wellington <[email protected]>
Co-authored-by: Amit Elran <[email protected]>
Co-authored-by: Amit Elran <[email protected]>
Co-authored-by: kazrael2119 <[email protected]>
Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <[email protected]>
Co-authored-by: gubalasu <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues azure-spring-eventhubs Spring event hubs related issues. Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants