2018-01-27 09:15:02 +08:00
|
|
|
# NATS Input Plugin
|
2018-01-27 07:14:54 +08:00
|
|
|
|
2022-06-09 05:22:56 +08:00
|
|
|
The [NATS](http://www.nats.io/about/) monitoring plugin gathers metrics from the
|
|
|
|
|
NATS [monitoring http server][1].
|
|
|
|
|
|
|
|
|
|
[1]: https://www.nats.io/documentation/server/gnatsd-monitoring/
|
2018-01-27 07:14:54 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
|
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md
|
|
|
|
|
|
2021-11-25 02:50:01 +08:00
|
|
|
## Configuration
|
2018-01-27 07:14:54 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2022-04-12 05:32:25 +08:00
|
|
|
# Provides metrics about the state of a NATS server
|
2018-01-27 07:14:54 +08:00
|
|
|
[[inputs.nats]]
|
2018-01-27 09:15:02 +08:00
|
|
|
## The address of the monitoring endpoint of the NATS server
|
2018-01-27 07:14:54 +08:00
|
|
|
server = "http://localhost:8222"
|
2018-01-27 09:15:02 +08:00
|
|
|
|
|
|
|
|
## Maximum time to receive response
|
|
|
|
|
# response_timeout = "5s"
|
|
|
|
|
```
|
|
|
|
|
|
2021-11-25 02:50:01 +08:00
|
|
|
## Metrics
|
2018-01-27 09:15:02 +08:00
|
|
|
|
|
|
|
|
- nats
|
|
|
|
|
- tags
|
|
|
|
|
- server
|
|
|
|
|
- fields:
|
|
|
|
|
- uptime (integer, nanoseconds)
|
|
|
|
|
- mem (integer, bytes)
|
|
|
|
|
- subscriptions (integer, count)
|
|
|
|
|
- out_bytes (integer, bytes)
|
|
|
|
|
- connections (integer, count)
|
|
|
|
|
- in_msgs (integer, bytes)
|
|
|
|
|
- total_connections (integer, count)
|
|
|
|
|
- cores (integer, count)
|
|
|
|
|
- cpu (integer, count)
|
|
|
|
|
- slow_consumers (integer, count)
|
|
|
|
|
- routes (integer, count)
|
|
|
|
|
- remotes (integer, count)
|
|
|
|
|
- out_msgs (integer, count)
|
|
|
|
|
- in_bytes (integer, bytes)
|
|
|
|
|
|
2021-11-25 02:50:01 +08:00
|
|
|
## Example Output
|
2018-01-27 09:15:02 +08:00
|
|
|
|
2021-11-25 02:50:01 +08:00
|
|
|
```shell
|
2018-01-27 09:15:02 +08:00
|
|
|
nats,server=http://localhost:8222 uptime=117158348682i,mem=6647808i,subscriptions=0i,out_bytes=0i,connections=0i,in_msgs=0i,total_connections=0i,cores=2i,cpu=0,slow_consumers=0i,routes=0i,remotes=0i,out_msgs=0i,in_bytes=0i 1517015107000000000
|
2018-01-27 07:14:54 +08:00
|
|
|
```
|