Skip to content

Add healthcheck endpoint #216

Description

@eheydrick

It would be nice if there was an endpoint that could provide basic health status. This would be used for monitoring that simplesamlphp is running properly.

Activity

  1. jaimeperez commented on Jun 4, 2015

    @jaimeperez
    Member

    Hi @eheydrick!

    What kind of checks are you thinking about? We already have some checks in the web interface, though of course that's not intended for automated monitoring...

  2. eheydrick commented on Jun 4, 2015

    @eheydrick
    ContributorAuthor

    One use case is a load balancer health check. Another is a check from a monitoring system. The check would return OK when the IdP is up and able to accept requests.

  3. jaimeperez commented on Jun 4, 2015

    @jaimeperez
    Member

    A load balancer could be checked from the monitoring system itself. Actually, that's the proper way, as if you do it through SimpleSAMLphp then any problem there might tell you there's a problem with your load balancers, while there isn't.

    Regarding a check for a monitoring system to discern whether an IdP is up and accepting requests... What does that mean exactly? That the web server is up? That PHP scripts are interpreted? That it is possible to fetch metadata from the IdP? That the endpoints are in place where they are expected? Or that they reply correctly upon a SAML request?

    As you see, there's many things involved in an IdP being "up and running", so it is not that easy to tell.

    In any case, did you have a look at the sanitycheck module?

  4. ottenhoff commented on Jun 4, 2015

    @ottenhoff

    A load balancer could be checked from the monitoring system itself.

    The use case is AWS Elastic Load Balancing (ELB). ELB will check your individual nodes every 10 seconds to see what nodes are healthy and should receive requests. ELB will send SimpleSAMLphp a simple HTTP request and will expect a 200 http status code. Ideally, the application implements a semi-robust health check that confirms that the database is alive and the application is ready to receive and serve requests.

  5. jaimeperez commented on Jun 4, 2015

    @jaimeperez
    Member

    Oh, I see! So you are thinking about status monitoring from the load balancers themselves...

    That's quite specific, anyway. I would say the best way to achieve that is to enable the sanitycheck module, then add your own module hooking into sanitycheck to add all the checks you need.

  6. eheydrick commented on Jun 4, 2015

    @eheydrick
    ContributorAuthor

    @ottenhoff, that's exactly what I want. Looks like the sanitycheck page will suffice as a basic health check.

  7. jaimeperez commented on Jun 5, 2015

    @jaimeperez
    Member

    Oh, by the way, I forgot yesterday to give you an example on how to add hooks into sanitycheck to add your own tests. Take a look at this.

    Hope that helps!

  8. locked as resolved and limited conversation to collaborators on Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions