Skip to content
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

Health check api for agent (#3074) #3781

Merged
merged 1 commit into from Sep 27, 2017

Commits on Sep 25, 2017

  1. Health check api for agent (gocd#3074)

    This adds 2 endpoints for testing the health of the agent <-> server comm
    
    * Perform a `GET` on `/health/{v1,latest}/isConnectedToServer`, will
      return status `200` along with text `OK!` if the agent is:
      - able to establish HTTP(s) contact
      - is authorized by the server (by an admin, or by auto-registration)
      The endpoint will return status `500` in any other cases.
      Two consecutive failing pings will be treated as having failed healthcheck.
    
    These health checks will (by default) bind to port 8152 on localhost,
    but can be configured by the following system properties:
    
    * `go.agent.status.api.enabled`. Defaults to `true`. Set to false to
      disable health check api endpoint
    * `go.agent.status.api.bind.host`. Defaults to `localhost`. Set to a
      specific ip address or hostname to bind to that host. Set to `0.0.0.0`
      to bind to all network interfaces.
    * `go.agent.status.api.bind.port`. Defaults to `8152`. Set to `0` to
      use an ephemeral port, which will be displayed in a log statement.
    
    In case the http server is unable to bind (usually because of port
    conflicts, or multiple agents running on the same macchine), a warning
    will be emitted to the console log and agent startup will continue.
    ketan committed Sep 25, 2017
    Copy the full SHA
    97df2bf View commit details
    Browse the repository at this point in the history