-
Notifications
You must be signed in to change notification settings - Fork 308
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
Eventhubs health check (retargeted for main) #4139
base: main
Are you sure you want to change the base?
Conversation
- address nit
…ng to align with other components
@@ -101,4 +105,41 @@ protected static string GetNamespaceFromSettings(AzureMessagingEventHubsSettings | |||
$"the '{configurationSectionName}' configuration section."); | |||
} | |||
} | |||
|
|||
protected sealed class AzureEventHubHealthCheck : IHealthCheck, IAsyncDisposable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we aren't using https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/tree/master/src/HealthChecks.Azure.Messaging.EventHubs? Typically we try to use those because they are the "best practice", and if they aren't meeting our needs, we should update them to meet our needs.
That way any improvements can be used by anyone - not just Aspire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew about these packages but when I looked for an eventhubs one, it was not in the public feed. I am confused by this new information.
Edit: So yeah, look at the service bus component (from which I based this one) -- it's using https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus which I believed to be an official package. I searched for AspNetCore.HealthChecks.AzureEventHubs and came up empty. Tried a few variants, got nothing. So wrote my own.
Turns out other components are using third party healthchecks so you have a larger consistency problem than just EH :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each package needs to be added, I will do that for this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If MSFT have official HC packages you should be using them in all components. This doesn't seem to be the case...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If MSFT have official HC packages you should be using them in all components. This doesn't seem to be the case...
Microsoft doesn't have any "official health check" packages. .NET Aspire has been using https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks. See https://github.com/dotnet/aspire/tree/main/src/Components#health-checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should be able to switch to using the 3rd party package some time this week. (The relevant nuget package wasn't in the dotnet-public feed -- @ReubenBond added it for me)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to use the package from https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to use the package from https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks?
Doing it right at this moment.
}; | ||
|
||
// At this point, the connection string or credential should already be validated by the AddClient call | ||
_probe = !string.IsNullOrEmpty(settings.ConnectionString) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another case that I am now handling in #4209 where the EventHub is not part of the connection string but defined in the settings
Original: #4050
Closes #3980
Microsoft Reviewers: Open in CodeFlow