Endpoints

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

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

    1. "cluster_id": "test-cluster",
    2. "server_id": "UaHeX4HdFN57e63ULcifHQ",
    3. "version": "0.17.0",
    4. "go": "go1.13.7",
    5. "state": "CLUSTERED",
    6. "role": "Leader",
    7. "now": "2020-02-11T16:19:30.761192-07:00",
    8. "start_time": "2020-02-11T16:19:24.777221-07:00",
    9. "uptime": "5s",
    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. }

    The possible values are: Leader, Follower or Candidate.

    The endpoint 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. }

    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.

    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: .

    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. "hb_inbox": "_INBOX.jAHSY3hcL5EGFQGYmfayQK",
    12. "subs_count": 1,
    13. "subscriptions": {
    14. "foo": [
    15. "client_id": "benchmark-sub-0",
    16. "inbox": "_INBOX.jAHSY3hcL5EGFQGYmfayvC",
    17. "ack_inbox": "_INBOX.J3Odi0wXYKWKFWz5D5uhem",
    18. "is_durable": false,
    19. "is_offline": false,
    20. "max_inflight": 1024,
    21. "ack_wait": 30,
    22. "last_sent": 505597,
    23. "pending_count": 0,
    24. "is_stalled": false
    25. }
    26. ]
    27. }
    28. }
    29. ]
    30. }

    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.

    The endpoint 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: .

    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_offline": false,
    23. "max_inflight": 1024,
    24. "ack_wait": 30,
    25. "last_sent": 0,
    26. "is_stalled": false
    27. }
    28. ]
    29. }
    30. ]
    31. }
    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.

    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. }

    The endpoint 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. Content-Length: 0

    If not: