1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

adding JetStream Docs

This commit is contained in:
ainsley
2020-11-24 15:12:44 -06:00
parent 8eb1e6a171
commit 1fd9cab1a5
19 changed files with 2109 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
## Monitoring
### Server Metrics
Typically, NATS is monitored via HTTP endpoints like `/varz`, we do not at this moment have a JetStream equivelant, but it's planned that server and account level metrics will be made available.
### Advisories
JetStream publish a number of advisories that can inform operations about health and state of the Streams. These advisories are published to normal NATS subjects below `$JS.EVENT.ADVISORY.>` and one can store these advisories in JetStream Streams if desired.
The command `nats event --js-advsiroy` can view all these events on your console. The Golang package [jsm.go](https://github.com/nats-io/jsm.go) can consume and render these events and have data types for each of these events.
All these events have JSON Schemas that describe them, schemas can be viewed on the CLI using the `nats schema show <schema kind>` command.
|Description|Subject|Kind|
|-----------|-------|----|
|API interactions|`$JS.EVENT.ADVISORY.API`|`io.nats.jetstream.advisory.v1.api_audit`|
|Stream CRUD operations|`$JS.EVENT.ADVISORY.STREAM.CREATED.<STREAM>`|`io.nats.jetstream.advisory.v1.stream_action`|
|Consumer CRUD operations|`$JS.EVENT.ADVISORY.CONSUMER.CREATED.<STREAM>.<CONSUMER>`|`io.nats.jetstream.advisory.v1.consumer_action`|
|Snapshot started using `nats stream backup`|`$JS.EVENT.ADVISORY.STREAM.SNAPSHOT_CREATE.<STREAM>`|`io.nats.jetstream.advisory.v1.snapshot_create`|
|Snapshot completed|`$JS.EVENT.ADVISORY.STREAM.SNAPSHOT_COMPLETE.<STREAM>`|`io.nats.jetstream.advisory.v1.snapshot_complete`|
|Restore started using `nats stream restore`|`$JS.EVENT.ADVISORY.STREAM.RESTORE_CREATE.<STREAM>`|`io.nats.jetstream.advisory.v1.restore_create`|
|Restore completed|`$JS.EVENT.ADVISORY.STREAM.RESTORE_COMPLETE.<STREAM>`|`io.nats.jetstream.advisory.v1.restore_complete`|
|Consumer maximum delivery reached|`$JS.EVENT.ADVISORY.CONSUMER.MAX_DELIVERIES.<STREAM>.<CONSUMER>`|`io.nats.jetstream.advisory.v1.max_deliver`|
|Message delivery terminated using AckTerm|`$JS.EVENT.ADVISORY.CONSUMER.MSG_TERMINATED.<STREAM>.<CONSUMER>`|`io.nats.jetstream.advisory.v1.terminated`|
|Message acknowledged in a sampled Consumer|`$JS.EVENT.METRIC.CONSUMER.ACK.<STREAM>.<CONSUMER>`|`io.nats.jetstream.metric.v1.consumer_ack`|
### Dashboards
The [NATS Surveyor](https://github.com/nats-io/nats-surveyor) system has initial support for passing JetStream metrics to Prometheus, dashboards and more will be added towards final release.