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.

{
  "cluster_id": "test-cluster",
  "server_id": "h5MPY4SfSbqRnyk7Omgr35",
  "version": "0.17.0",
  "go": "go1.13.7",
  "state": "STANDALONE",
  "now": "2020-02-11T16:17:33.101243-07:00",
  "start_time": "2020-02-11T16:17:15.323466-07:00",
  "uptime": "17s",
  "clients": 0,
  "subscriptions": 0,
  "channels": 0,
  "total_msgs": 0,
  "total_bytes": 0,
  "in_msgs": 0,
  "in_bytes": 0,
  "out_msgs": 0,
  "out_bytes": 0
}

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

The possible values are: Leader, Follower or Candidate.

/storez

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

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

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.

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.

/channelsz

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

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.

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

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

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:

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.

/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).

If the server is FT active:

If not:

最后更新于