Node Resource

GET /v1/node

Returns a list of nodes known to a Presto Server. This call doesn’t require a query parameter of headers, it simply returns an array with each known node in a Presto installation.

In the response, the values recentRequests, recentFailures, and recentSuccesses are decaying counters set to decay exponentially over time with a decay parameter of one minute. This decay rate means that if a Presto node has 1000 successes in a few seconds, this statistic value will drop to 367 in one minute.

age shows you how long a particular node has been running, and uri points you to the HTTP server for a particular node. The last request and last response times show you how recently a node has been used.

The following example response displays a single node which has not experienced any failure conditions. Each node also reports statistics about traffic uptime, and failures.

Example response:

  1. HTTP/1.1 200 OK
  2. Vary: Accept
  3. Content-Type: text/javascript
  4. [
  5. {
  6. "uri":"http://10.209.57.156:8080",
  7. "recentRequests":25.181940555111073,
  8. "recentFailures":0.0,
  9. "recentSuccesses":25.195472984170983,
  10. "lastRequestTime":"2013-12-22T13:32:44.673-05:00",
  11. "lastResponseTime":"2013-12-22T13:32:44.677-05:00",
  12. "age":"14155.28ms",
  13. "recentFailureRatio":0.0,
  14. "recentFailuresByType":{}
  15. }
  16. ]

If a node is experiencing errors, you’ll see a response that looks like the following. Here we have a node which has experienced a spate of errors. The recentFailuresByType field lists the Java exception which have occurred recently on a particular node.

Example response with Errors:

  1. HTTP/1.1 200 OK
  2. Vary: Accept
  3. Content-Type: text/javascript
  4. [
  5. {
  6. "age": "4.45m",
  7. "lastFailureInfo": {
  8. "message": "Connect Timeout",
  9. "stack": [
  10. "org.eclipse.jetty.io.ManagedSelector$ConnectTimeout.run(ManagedSelector.java:683)",
  11. ....
  12. "java.lang.Thread.run(Thread.java:745)"
  13. ],
  14. "suppressed": [],
  15. "type": "java.net.SocketTimeoutException"
  16. },
  17. "lastRequestTime": "2017-08-05T11:53:00.647Z",
  18. "lastResponseTime": "2017-08-05T11:53:00.647Z",
  19. "recentFailureRatio": 0.47263053472046446,
  20. "recentFailures": 2.8445543205610617,
  21. "recentFailuresByType": {
  22. "java.net.SocketTimeoutException": 2.8445543205610617
  23. },
  24. "recentRequests": 6.018558073577414,
  25. "recentSuccesses": 3.1746446343010297,
  26. "uri": "http://172.19.0.3:8080"
  27. }
  28. ]

GET /v1/node/failed

Calling this service returns a JSON document listing all the nodes that have failed the last heartbeat check. The information returned by this call is the same as the information returned by the previous service.

Example response:

  • [

    • {

      “age”: “1.37m”, “lastFailureInfo”: {

      “message”: “Connect Timeout”, “stack”: [

      “java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)”, “java.lang.Thread.run(Thread.java:745)”

      ], “suppressed”: [], “type”: “java.net.SocketTimeoutException”

      }, “lastRequestTime”: “2017-08-05T11:52:42.647Z”, “lastResponseTime”: “2017-08-05T11:52:42.647Z”, “recentFailureRatio”: 0.22498784153043677, “recentFailures”: 20.11558290058638, “recentFailuresByType”: {

      “java.net.SocketTimeoutException”: 20.11558290058638

      }, “recentRequests”: 89.40742203558189, “recentSuccesses”: 69.30583024727453, “uri”: “http://172.19.0.3:8080

  1. }

]