GithubHelp home page GithubHelp logo

Comments (3)

mkArtakMSFT avatar mkArtakMSFT commented on August 29, 2024

Thanks for contacting us, @alecor191.
@rynowak, can you please handle this? Thanks!

from diagnostics.

rynowak avatar rynowak commented on August 29, 2024

Hi @alecor191 - this is an intentional change - we want the application developer to be able to configure the status reported by a health check. This is essential if the health check is supplied by a library that you didn't write.

For your use case, I a few options:

You can include these details in the data returns by your health check https://github.com/aspnet/Diagnostics/blob/release/2.2/samples/HealthChecksSample/GCInfoHealthCheck.cs#L60 and then configure a custom writer to include information in the response https://github.com/aspnet/Diagnostics/blob/release/2.2/samples/HealthChecksSample/CustomWriterStartup.cs

Or you could just register two health checks. Write a check that accepts 'days remaining' as a parameter, and register the same code twice, once with 30 days remaining and once with 0 days. Then, configure one of them to report degraded when it fails.

I hope this helps.

from diagnostics.

alecor191 avatar alecor191 commented on August 29, 2024

Thanks @rynowak!

Those two approaches should work fine for me. I just found the previous approach a bit more convenient/simple in my setup. However, I understand that there are other scenarios where a more generic approach is required.

from diagnostics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.