How to access IOptions on adding HealthChecks in Startup? #24477
Unanswered
agentschmitt
asked this question in
General
Replies: 3 comments 1 reply
-
You can't access options that early. Seems like you need to delay the creation of the UrlGroup until they are ready. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I can't find the AddUrlGroup method, but most health check APIs eventually end up calling this: There are variants of this that would let you resolve services to configure your options. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Yeah thx i could use the optionspattern to add some healthchecks with usage
of ioptions.
Only downside is i cant use the healthchecksbuilder which is the target for most extension methods for registration.
And the addurlgroup is from https://github.com/xabaril/AspNetCore.Diagnostics.HealthChecks
David Fowler <notifications@github.com> schrieb am Mo., 3. Aug. 2020, 18:08:
… I think this is an old version of the healthchecks API
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24477 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADIYV2MROXYPT25RVR7M5ZDR63OHZANCNFSM4PQTAHMQ>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can i add HealthChecks with options from my IOptions that is registered in the servicecollection before?
In dotnet 2.1 it was possible to inject the options in Startup but with #9337 this was removed for dotnet 3.0
I saw many examples for HealthCheck registration using IConfiguration directly, but this is no good option for me, cause i have some placeholder replacement logic running for my IOptions. So is there any way to add healthchecks with configuration from IOptions?
Beta Was this translation helpful? Give feedback.
All reactions