How to Add Health Checks in ASP.NET Core

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 84

  • @MilanJovanovicTech
    @MilanJovanovicTech  9 місяців тому +3

    Want to master Clean Architecture? Go here: bit.ly/3PupkOJ
    Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt

  • @nevernerd
    @nevernerd 9 місяців тому +10

    Health Checks sorta dropped out of my top ten priority list. You are basically just spoon feeding me my task so I can do it in an hour. :) I appreciate watching videos that consolidate my research into 11 minutes 50 seconds.

  • @andersjuul8310
    @andersjuul8310 9 місяців тому +3

    As always: Great stuff. I especially appreciate 1) relevant subject 2) well explained 3) concise delivery.
    Subject suggestion: Middleware. What is done where and examples of good use. Maybe I just need to rerun an old video of yours 🤗.

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      I only talked about error handling - ua-cam.com/video/H3EbflpXVmo/v-deo.html
      However, this is because I typically implement my cross cutting concerns using MediatR:
      - Logging - ua-cam.com/video/w7yDuoCLVvQ/v-deo.html
      - Validation - ua-cam.com/video/OhQA4PDdp0Q/v-deo.html
      - Caching - ua-cam.com/video/LOEYZRE72wE/v-deo.html

  • @KingOfBlades27
    @KingOfBlades27 9 місяців тому +7

    Accidentally broke the like button for the smashing 😂 Really useful information, thanks again Milan 💪

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому +3

      Is that why I see the likes stopped coming in? 🤣

    • @nepalxplorer
      @nepalxplorer 9 місяців тому

      @@MilanJovanovicTech lol

  • @aweklin
    @aweklin 9 місяців тому +4

    Milan, thanks for sharing this useful information.
    As always, stay awesome :)

  • @dddavet9652
    @dddavet9652 9 місяців тому +1

    Great video tutorial Milan.

  • @rodrigogama4217
    @rodrigogama4217 9 місяців тому +1

    Great video! Glad you made it!

  • @kesavanvellaiyan716
    @kesavanvellaiyan716 7 місяців тому +1

    Fantastic Milan, thanks for your effort on creating this useful information. Keep going.

  • @beepst
    @beepst 9 місяців тому +1

    This is amazing. I’m gonna implement it into my project.

  • @islamelgaidi1821
    @islamelgaidi1821 9 місяців тому

    Thanks for this video . please keep posting more

  • @kristianteodosiev5500
    @kristianteodosiev5500 9 місяців тому +1

    This may be a bit off topic, but I've seen that there are now 2 options for the course - PCA and PCA + Community Access. I was wondering if in the future there will be exclusive content/lessons for the PCA + Community Access version, or if both will share the same content.

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому +1

      The Community is a completely new thing that I launched yesterday. It's a place where like-minded devs will be able to connect, and of course you'll get unlimited access to my time. Right now, the two courses share the same content. Bonus content is a great idea - but what I had in mind was probably some live sessions once a month, when the community grows a bit.

    • @kristianteodosiev5500
      @kristianteodosiev5500 9 місяців тому

      ​​@@MilanJovanovicTechI see, thank you for your reply. I imagine it will be possible to upgrade to the PCA + Community Access version in the future without paying the full price?

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому +1

      @@kristianteodosiev5500 Possibly, yeah. I haven't worked out the details on that - but it shouldn't be too difficult.

    • @kristianteodosiev5500
      @kristianteodosiev5500 9 місяців тому

      ​@@MilanJovanovicTechThank you! I'm going to buy the course and was wondering if there was a way to upgrade later. Really looking forward to it!

  • @nouchance
    @nouchance 9 місяців тому

    Milan... You are awesome! thanks a lot!

  • @acartunahan
    @acartunahan 6 місяців тому

    Great tutorial! Thanks a lot Milan.

  • @_rcs
    @_rcs 9 місяців тому

    Thanks for making it very clear how to do this.

  • @shvetsjr
    @shvetsjr 6 місяців тому

    Amazing videos dude! Been watching them all days long. Have a question about swagger. The /health endpoint doesn't appear in Swagger. Is that intentional? Should it be enabled somewhere? thanks!

  • @bartlomiejuminski
    @bartlomiejuminski 9 місяців тому

    I just needed to add health checks in my project, thanks

  • @saymehname
    @saymehname 9 місяців тому +3

    Thanks this was helpful

  • @elvargas1327
    @elvargas1327 9 місяців тому

    Question, does healthy checks towards an API or website make it rise faster? Or what is used to make a website or API wake up quickly and not fall asleep?

  • @keitarourashima3835
    @keitarourashima3835 9 місяців тому

    And how to do it for Console Application? Is Opent telementry a better option?
    Thanks for your content

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      Open Telemetry isn't a replacement for Health checks - they complement each other

  • @mayureshs80
    @mayureshs80 9 місяців тому +1

    Nice tip! Can you share name and location for VS2022 theme?

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      It's ReSharper on top of VS

    • @mayureshs80
      @mayureshs80 9 місяців тому

      @@MilanJovanovicTech is that an external theme ? I have reshaper but where do I go to enable those colors ?

  • @neerajwork4353
    @neerajwork4353 7 місяців тому

    What are packages available for health check for Datalake storage and azure app configuration services ???

  • @feinirl
    @feinirl 9 місяців тому +1

    a video about distributed tracing would be interesting in my opinion

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      Great idea! Adding that to the content list 👌

    • @feinirl
      @feinirl 9 місяців тому

      @@MilanJovanovicTech

  • @okansahan8603
    @okansahan8603 7 місяців тому

    Hi Milan, Where can I find the source codes of your RunTrackr project?

  • @lucasi-cs
    @lucasi-cs 9 місяців тому +2

    Excellent video Milan! One question, should this route be publicly exposed? Since we are not requesting any authentication?
    Regards from Brazil!

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      It can be public, or you can add some network protection so that it's only available to a specific IP address

    • @timmkrause6684
      @timmkrause6684 9 місяців тому

      We added auth. Didn‘t want to expose attack vectors.

    • @ttolst
      @ttolst 9 місяців тому +1

      ​@@MilanJovanovicTechi would really not make it public if you include exception details. It may be fine, but it is a bad practice as you suddenly have one exposing something it shouldn't.

  • @pilotboba
    @pilotboba 9 місяців тому

    Can you set it so the health check returns degraded if it's an external service that is a problem? Because there is no reason to replace the API service/container if the issue is with an external service.

    • @ttolst
      @ttolst 9 місяців тому

      My thought as well, I wouldn't want my services mass restarted because a dependency fails.

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      Yes - you can provide what's the Health option to return if there's an error

  • @omerunald7663
    @omerunald7663 5 місяців тому

    I have two healthchecks. Can I trigger each of them separately on the HealthcheckUI side? redis like once every 10 seconds, mongo like once every 15 seconds

    • @MilanJovanovicTech
      @MilanJovanovicTech  5 місяців тому

      It's usually exposed through 1 endpoint that runs all the health checks. In theory, you could expose a separate endpoint for mongo o

    • @omerunald7663
      @omerunald7663 5 місяців тому

      @@MilanJovanovicTech Can you make an educational video on this subject?

  • @shuvbhowmickbestin
    @shuvbhowmickbestin 6 місяців тому

    can someone please tell me how he defined the class at 2:49 and what is it called? He didn't create any explicit constructor here did he? I searched everywhere but didn't find what this is called.

    • @MilanJovanovicTech
      @MilanJovanovicTech  6 місяців тому

      The DbConnectionFactory?

    • @shuvbhowmickbestin
      @shuvbhowmickbestin 6 місяців тому +1

      @@MilanJovanovicTech no worries, found it out. It's primary constructors introduced in C# 12 right?

  • @PickleRiiiiick
    @PickleRiiiiick 6 місяців тому

    Anyone know if you can get queue specific details for health checking? So if i have 20 queues, i can check the health of those queues and display them in the health endpoint results

    • @MilanJovanovicTech
      @MilanJovanovicTech  6 місяців тому +1

      Hmm, I think MassTransit may do that out of the box. Need to check again.

    • @PickleRiiiiick
      @PickleRiiiiick 6 місяців тому

      @@MilanJovanovicTech no probs, i've been struggling to find something that specific but i am still a bit of a noob. If i do find the answer, i'll post here to potentially help others. Thank you, great vid!

  • @manooj8502
    @manooj8502 9 місяців тому

    please bring roadmap for c sharp developer in 2024 and tells us what to do for beginner.lot of love milan sir from nepal

  • @RMarjanovic
    @RMarjanovic 9 місяців тому

    Can you show us how to monitor health checks in kubernetes next? :D

  • @hkorasch
    @hkorasch 9 місяців тому

    Excelent!

  • @alexmadnix
    @alexmadnix 9 місяців тому

    Good Good~~

  • @shahrukhkhan3967
    @shahrukhkhan3967 9 місяців тому

    🎉

  • @aamirali8114
    @aamirali8114 9 місяців тому

    I love to learn in bit and pieces but sometimes you enhance some codes in which we dont have whole code that brings us in bit problem so its like we want to learn things but we couldnt because we dont have whole code out there to implement what you are teaching then sometimes its gets useless to see your video to be frank Hope you provides us code behind the bars

    • @MilanJovanovicTech
      @MilanJovanovicTech  9 місяців тому

      If you've been paying attention, maybe you'll figure out how to find the source code 😁

  • @extrasolar9976
    @extrasolar9976 21 день тому

    Awesome video! I seem to be running into a problem though. I've implemented the health check, but I keep getting a connection error exception when I stop my container. I would like the health check to handle this case but I can't get it to work. Any suggestions? I'm using Npgsql healthchecks.

    • @MilanJovanovicTech
      @MilanJovanovicTech  21 день тому

      What's you connection string to the container?

    • @extrasolar9976
      @extrasolar9976 21 день тому

      @MilanJovanovicTech The IP address of the docker container and the port (5432 I think)

    • @extrasolar9976
      @extrasolar9976 20 днів тому

      Okay, it seems that I've found the issue. My AuthMiddleware throws the exception because it's trying to get the API key from the database. I'm still working on a solution though.