Endpoints

The following sections describe each supported monitoring endpoint: serverz, storez, clientsz, and channelsz.

/serverz

The endpoint http://localhost:8222/streaming/serverz reports various general statistics.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "h5MPY4SfSbqRnyk7Omgr35",
  4. "version": "0.17.0",
  5. "go": "go1.13.7",
  6. "state": "STANDALONE",
  7. "now": "2020-02-11T16:17:33.101243-07:00",
  8. "start_time": "2020-02-11T16:17:15.323466-07:00",
  9. "uptime": "17s",
  10. "clients": 0,
  11. "subscriptions": 0,
  12. "channels": 0,
  13. "total_msgs": 0,
  14. "total_bytes": 0,
  15. "in_msgs": 0,
  16. "in_bytes": 0,
  17. "out_msgs": 0,
  18. "out_bytes": 0
  19. }

In clustering mode, there is an additional field that indicates the RAFT role of the given node. Here is an example:

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "UaHeX4HdFN57e63ULcifHQ",
  4. "version": "0.17.0",
  5. "go": "go1.13.7",
  6. "state": "CLUSTERED",
  7. "role": "Leader",
  8. "now": "2020-02-11T16:19:30.761192-07:00",
  9. "start_time": "2020-02-11T16:19:24.777221-07:00",
  10. "uptime": "5s",
  11. "clients": 0,
  12. "subscriptions": 0,
  13. "channels": 0,
  14. "total_msgs": 0,
  15. "total_bytes": 0,
  16. "in_msgs": 0,
  17. "in_bytes": 0,
  18. "out_msgs": 0,
  19. "out_bytes": 0
  20. }

The possible values are: Leader, Follower or Candidate.

/storez

The endpoint http://localhost:8222/streaming/storez reports information about the store.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "8AjZq57k4JY7cfKEvuZ8iF",
  4. "now": "2019-04-16T09:57:32.857406-06:00",
  5. "type": "MEMORY",
  6. "limits": {
  7. "max_channels": 100,
  8. "max_msgs": 1000000,
  9. "max_bytes": 1024000000,
  10. "max_age": 0,
  11. "max_subscriptions": 1000,
  12. "max_inactivity": 0
  13. },
  14. "total_msgs": 130691,
  15. "total_bytes": 19587140
  16. }

/clientsz

The endpoint http://localhost:8222/streaming/clientsz reports more detailed information about the connected clients.

It uses a paging mechanism which defaults to 1024 clients.

You can control these via URL arguments (limit and offset). For example: http://localhost:8222/streaming/clientsz?limit=1&offset=1.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "J3Odi0wXYKWKFWz5D5uhH9",
  4. "now": "2017-06-07T14:47:44.495254605+02:00",
  5. "offset": 1,
  6. "limit": 1,
  7. "count": 1,
  8. "total": 11,
  9. "clients": [
  10. {
  11. "id": "benchmark-sub-0",
  12. "hb_inbox": "_INBOX.jAHSY3hcL5EGFQGYmfayQK",
  13. "subs_count": 1
  14. }
  15. ]
  16. }

You can also report detailed subscription information on a per client basis using subs=1. For example: http://localhost:8222/streaming/clientsz?limit=1&offset=1&subs=1.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "J3Odi0wXYKWKFWz5D5uhH9",
  4. "now": "2017-06-07T14:48:06.157468748+02:00",
  5. "offset": 1,
  6. "limit": 1,
  7. "count": 1,
  8. "total": 11,
  9. "clients": [
  10. {
  11. "id": "benchmark-sub-0",
  12. "hb_inbox": "_INBOX.jAHSY3hcL5EGFQGYmfayQK",
  13. "subs_count": 1,
  14. "subscriptions": {
  15. "foo": [
  16. {
  17. "client_id": "benchmark-sub-0",
  18. "inbox": "_INBOX.jAHSY3hcL5EGFQGYmfayvC",
  19. "ack_inbox": "_INBOX.J3Odi0wXYKWKFWz5D5uhem",
  20. "is_durable": false,
  21. "is_offline": false,
  22. "max_inflight": 1024,
  23. "ack_wait": 30,
  24. "last_sent": 505597,
  25. "pending_count": 0,
  26. "is_stalled": false
  27. }
  28. ]
  29. }
  30. }
  31. ]
  32. }

You can select a specific client based on its client ID with client=<id>, and get also get detailed statistics with subs=1. For example: http://localhost:8222/streaming/clientsz?client=me&subs=1.

  1. {
  2. "id": "me",
  3. "hb_inbox": "_INBOX.HG0uDuNtAPxJQ1lVjIC2sr",
  4. "subs_count": 1,
  5. "subscriptions": {
  6. "foo": [
  7. {
  8. "client_id": "me",
  9. "inbox": "_INBOX.HG0uDuNtAPxJQ1lVjIC389",
  10. "ack_inbox": "_INBOX.Q9iH2gsDPN57ZEvqswiYSL",
  11. "is_durable": false,
  12. "is_offline": false,
  13. "max_inflight": 1024,
  14. "ack_wait": 30,
  15. "last_sent": 0,
  16. "pending_count": 0,
  17. "is_stalled": false
  18. }
  19. ]
  20. }
  21. }

/channelsz

The endpoint http://localhost:8222/streaming/channelsz reports the list of channels.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "J3Odi0wXYKWKFWz5D5uhH9",
  4. "now": "2017-06-07T14:48:41.680592041+02:00",
  5. "offset": 0,
  6. "limit": 1024,
  7. "count": 2,
  8. "total": 2,
  9. "names": [
  10. "bar"
  11. "foo"
  12. ]
  13. }

It uses a paging mechanism which defaults to 1024 channels.

You can control these via URL arguments (limit and offset). For example: http://localhost:8222/streaming/channelsz?limit=1&offset=1.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "J3Odi0wXYKWKFWz5D5uhH9",
  4. "now": "2017-06-07T14:48:41.680592041+02:00",
  5. "offset": 1,
  6. "limit": 1,
  7. "count": 1,
  8. "total": 2,
  9. "names": [
  10. "foo"
  11. ]
  12. }

You can also get the list of subscriptions with subs=1. For example: http://localhost:8222/streaming/channelsz?limit=1&offset=0&subs=1.

  1. {
  2. "cluster_id": "test-cluster",
  3. "server_id": "J3Odi0wXYKWKFWz5D5uhH9",
  4. "now": "2017-06-07T15:01:02.166116959+02:00",
  5. "offset": 0,
  6. "limit": 1,
  7. "count": 1,
  8. "total": 2,
  9. "channels": [
  10. {
  11. "name": "bar",
  12. "msgs": 0,
  13. "bytes": 0,
  14. "first_seq": 0,
  15. "last_seq": 0,
  16. "subs_count": 1,
  17. "subscriptions": [
  18. {
  19. "client_id": "me",
  20. "inbox": "_INBOX.S7kTJjOcToXiJAzGWgINit",
  21. "ack_inbox": "_INBOX.Y04G5pZxlint3yPXrSTjTV",
  22. "is_durable": false,
  23. "is_offline": false,
  24. "max_inflight": 1024,
  25. "ack_wait": 30,
  26. "last_sent": 0,
  27. "pending_count": 0,
  28. "is_stalled": false
  29. }
  30. ]
  31. }
  32. ]
  33. }

You can select a specific channel based on its name with channel=name. For example: http://localhost:8222/streaming/channelsz?channel=foo.

  1. {
  2. "name": "foo",
  3. "msgs": 649234,
  4. "bytes": 97368590,
  5. "first_seq": 1,
  6. "last_seq": 649234,
  7. "subs_count": 1
  8. }

And again, you can get detailed subscriptions with subs=1. For example: http://localhost:8222/streaming/channelsz?channel=foo&subs=1.

  1. {
  2. "name": "foo",
  3. "msgs": 704770,
  4. "bytes": 105698990,
  5. "first_seq": 1,
  6. "last_seq": 704770,
  7. "subs_count": 10,
  8. "subscriptions": [
  9. {
  10. "client_id": "me",
  11. "inbox": "_INBOX.jAHSY3hcL5EGFQGYmfayvC",
  12. "ack_inbox": "_INBOX.J3Odi0wXYKWKFWz5D5uhem",
  13. "is_durable": false,
  14. "is_offline": false,
  15. "max_inflight": 1024,
  16. "ack_wait": 30,
  17. "last_sent": 704770,
  18. "pending_count": 0,
  19. "is_stalled": false
  20. },
  21. {
  22. "client_id": "me2",
  23. "inbox": "_INBOX.jAHSY3hcL5EGFQGYmfaywG",
  24. "ack_inbox": "_INBOX.J3Odi0wXYKWKFWz5D5uhjV",
  25. "is_durable": false,
  26. "is_offline": false,
  27. "max_inflight": 1024,
  28. "ack_wait": 30,
  29. "last_sent": 704770,
  30. "pending_count": 0,
  31. "is_stalled": false
  32. },
  33. (...)
  34. ]
  35. }

For durables that are currently running, the is_offline field is set to false. Here is an example:

  1. {
  2. "name": "foo",
  3. "msgs": 0,
  4. "bytes": 0,
  5. "first_seq": 0,
  6. "last_seq": 0,
  7. "subs_count": 1,
  8. "subscriptions": [
  9. {
  10. "client_id": "me",
  11. "inbox": "_INBOX.P23kNGFnwC7KRg3jIMB3IL",
  12. "ack_inbox": "_STAN.ack.pLyMpEyg7dgGZBS7jGXC02.foo.pLyMpEyg7dgGZBS7jGXCaw",
  13. "durable_name": "dur",
  14. "is_durable": true,
  15. "is_offline": false,
  16. "max_inflight": 1024,
  17. "ack_wait": 30,
  18. "last_sent": 0,
  19. "pending_count": 0,
  20. "is_stalled": false
  21. }
  22. ]
  23. }

When that same durable goes offline, is_offline is be set to true. Although the client is possibly no longer connected (and would not appear in the clientsz endpoint), the client_id field is still displayed here.

  1. {
  2. "name": "foo",
  3. "msgs": 0,
  4. "bytes": 0,
  5. "first_seq": 0,
  6. "last_seq": 0,
  7. "subs_count": 1,
  8. "subscriptions": [
  9. {
  10. "client_id": "me",
  11. "inbox": "_INBOX.P23kNGFnwC7KRg3jIMB3IL",
  12. "ack_inbox": "_STAN.ack.pLyMpEyg7dgGZBS7jGXC02.foo.pLyMpEyg7dgGZBS7jGXCaw",
  13. "durable_name": "dur",
  14. "is_durable": true,
  15. "is_offline": true,
  16. "max_inflight": 1024,
  17. "ack_wait": 30,
  18. "last_sent": 0,
  19. "pending_count": 0,
  20. "is_stalled": false
  21. }
  22. ]
  23. }

/isFTActive

The endpoint http://localhost:8222/streaming/isFTActive indicates, through the HTTP response code, if this server is running as the active server of a fault tolerant (FT) group. If the server is the active server, the HTTP response code returned is 200, otherwise 204 (which indicates either that the server is running as a FT standby server, or simply not running in FT mode).

  1. curl -i http://localhost:8222/streaming/isFTActive

If the server is FT active:

  1. HTTP/1.1 200 OK
  2. Date: Wed, 24 Jun 2020 14:44:24 GMT
  3. Content-Length: 0

If not:

  1. HTTP/1.1 204 No Content
  2. Date: Wed, 24 Jun 2020 14:44:37 GMT