HTTP Health check backend

We have several backends behind microgateway & edge cloud.

Say we have service A, B, & C

Each of the service has /ping endpoint that previously we use to do health check.

So previously, our API gateway (not apigee) periodically send a request to "/ping", and after certain treshold if /ping does not give HTTP 200, it will mark the service as "unhealthy"

That particular API gateway has a health check management endpoint, where we can hit that endpoint and find out the status of A, B, & C. For "unhealthy" services, we can then send a slack message or email.

It seems apigee does not have this capability for backend health check?

It does not have to be exact same, but we need something to resemble this functionality.

Any idea? Older posts on apigee community refers to something called "probe" or "health.apigee.com", but the links are dead.

Thanks

0 4 2,624
4 REPLIES 4

Hi @Timotius Pamungkas,

Instead expecting it from APIGEE, it should be on your load balancer on target servers. APIGEE would be external for your backend and pinging the backend url in every secs just to check the health is not a good option.

Here is the the thought - We have apigee cloud version for proxying the microservices endpoints. All microservices are deployed on cloud in cluster. My cloud capability takes care of healthcheck which is much faster than apigee calls healthcheck periodically ( there is no cron possible on apigee as of now)

understand the difficulty in it kiss novel, the answer is useful

sidd-harth
Participant V

Apigee can do this, have a look at Health Monitoring options,

https://docs.apigee.com/api-platform/deploy/load-balancing-across-backend-servers#healthmonitoring

It can do both HTTP and TCP monitoring, I guess you can use HTTP,

https://docs.apigee.com/api-platform/deploy/load-balancing-across-backend-servers#healthmonitoring-h...;
<TargetEndpoint name="default">
  <HTTPTargetConnection>
      <LoadBalancer>
        <Algorithm>RoundRobin</Algorithm>
        <Server name="target1" />
        <Server name="target2" />
        <MaxFailures>5</MaxFailures>
      </LoadBalancer>
      <Path>/test</Path>
      <HealthMonitor>
  <IsEnabled>true</IsEnabled>
  <IntervalInSec>5</IntervalInSec>
  <HTTPMonitor>
    <Request>
      <ConnectTimeoutInSec>10</ConnectTimeoutInSec>
      <SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>
      <Port>80</Port>
      <Verb>GET</Verb>
      <Path>/ping</Path>
      <Header name="Authorization">Basic 12e98yfw87etf</Header>
    </Request>
    <SuccessResponse>
      <ResponseCode>200</ResponseCode>
      <Header name=”ImOK”>YourOK</Header>
    </SuccessResponse>
  </HTTPMonitor>
</HealthMonitor>

  </HTTPTargetConnection>

If the endpoint is failing then Apigee automatically remove the endpoint from loadbalancer and then add it back if the test passes after sometime.

As of now, Apigee cannot send any message to external systems if endpoint is failing.

well, I'm quite agree with @Ravindra Singh. The health check should not be done by apigee. I'm still look for a way to do this.

Our backend load balancer is nginx open source. but I'm thinking on using consul health check + notifier to achieve this.

Any experience you can share by this approach (using consul + apigee edgemicro)?