PingAM

Monitor AM instances

AM provides a number of interfaces for you to check the status of AM instances and to gather monitoring data. This page describes common monitoring scenarios, the endpoints for checking instance status, and the steps to enable monitoring.

Common use cases

Use the following scenarios to match your requirements to the monitoring approach:

  • Load balancer or Kubernetes health checks: Your load balancer or container platform needs to know when to route traffic to an instance. Poll the /json/health/live endpoint to check that the instance is running, and /json/health/ready to check that it can process requests. Learn more in Check the status of an AM instance.

  • Collecting metrics for capacity planning or alerting: You need request rates, response times, or session counts in an external monitoring system. Enable the Monitoring service, then collect metrics with Prometheus, Graphite, or common REST monitoring. Learn more in Monitor with Prometheus, Graphite monitoring, and Common REST monitoring.

  • Investigating a failing instance: Users report failed sign-ons or slow responses, and you need to find the cause. Check the health endpoints first to determine whether the instance is up and ready, then use debug logging to trace the failing requests. Learn more in Debug logging.

  • Auditing access and configuration changes: You need a record of relevant events for investigations or compliance. Configure audit logging to capture the events you need. Learn more in Implement audit logging.

Check the status of an AM instance

In certain deployments, such as Kubernetes, it can be useful to poll endpoints to check if an instance is running, and ready to handle requests. You can determine the status of an AM instance by using the following endpoints:

/json/health/live

Use the live endpoint to determine if AM instances are up and running.

If the instance is running the endpoint returns an HTTP status code of 200. If not, it returns a 503 response.

For example, use the following curl command to determine when an AM instance is alive:

$ curl --include --retry 10 --retry-connrefused 'https://am.example.com:8443/am/json/health/live'
Warning: Transient problem: connection refused Will retry in 1 seconds. 10
Warning: retries left.
Warning: Transient problem: connection refused Will retry in 2 seconds. 9
Warning: retries left.
Warning: Transient problem: connection refused Will retry in 4 seconds. 8
Warning: retries left.
HTTP/1.1 200
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Cache-Control: private
Content-API-Version: resource=1.0
Content-Length: 0
Date: Mon, 09 Nov 2020 12:22:38 GMT
/json/health/ready

Use the ready endpoint to determine if AM instances are ready to process requests.

If the instance is ready to process requests, the endpoint returns an HTTP status code of 200. If not, it returns a 503 response.

For example, use the following curl command to determine when an AM instance is ready to process requests:

$ curl --include --retry 10 --retry-connrefused 'https://am.example.com:8443/am/json/health/ready'
Warning: Transient problem: connection refused Will retry in 1 seconds. 10
Warning: retries left.
Warning: Transient problem: connection refused Will retry in 2 seconds. 9
Warning: retries left.
Warning: Transient problem: connection refused Will retry in 4 seconds. 8
Warning: retries left.
Warning: Transient problem: connection refused Will retry in 8 seconds. 7
Warning: retries left.
HTTP/1.1 200
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Cache-Control: private
Content-API-Version: resource=1.0
Content-Length: 0
Date: Mon, 09 Nov 2020 12:45:03 GMT
Deprecated isAlive.jsp page

AM provides a deprecated isAlive.jsp page, to check whether AM is up. Point your application to the file under the deployment URL, such as https://am.example.com:8443/am/isAlive.jsp.

If you get a success code (with Server is ALIVE: in the body of the page returned), then the instance is in operation.

The isAlive.jsp page is deprecated and will be removed in a future release. Update your environment to use the live and ready endpoints instead.

The endpoints and isAlive.jsp page do not require authentication. You might want to restrict public access, and only allow access from internal infrastructure.

Enable monitoring in the console

To query some of the monitoring endpoints, such as Prometheus or CREST, you must enable the Monitoring service:

  1. In the AM admin UI, go to Configure > Global Services > Monitoring.

  2. Set Monitoring Status to enabled.

  3. Click Save Changes.

Learn about configuring the service in Monitoring service.