Regenerate integrations docs (#19254)
Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>
Netdata bot committed
Dec 19, 2024 at 15:39 UTC
230f0a82559f74a43bb52c6ba97d2eddbe061321
3 files changed
+286
src/collectors/COLLECTORS.md
+2
@@ -785,6 +785,8 @@ If you don't see the app/service you'd like to monitor in this list:
785
786
- [MQTT Blackbox](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/collector/prometheus/integrations/mqtt_blackbox.md)
787
788
+- [NATS](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/collector/nats/integrations/nats.md)
789
+
790
- [RabbitMQ](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/collector/rabbitmq/integrations/rabbitmq.md)
791
792
- [Redis Queue](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/collector/prometheus/integrations/redis_queue.md)
src/go/plugin/go.d/collector/nats/README.md
new
+1
@@ -0,0 +1 @@
1
+integrations/nats.md
\ No newline at end of file
src/go/plugin/go.d/collector/nats/integrations/nats.md
new
+283
@@ -0,0 +1,283 @@
1
+<!--startmeta
2
+custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/collector/nats/README.md"
3
+meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/collector/nats/metadata.yaml"
4
+sidebar_label: "NATS"
5
+learn_status: "Published"
6
+learn_rel_path: "Collecting Metrics/Message Brokers"
7
+most_popular: False
8
+message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
9
+endmeta-->
10
+
11
+# NATS
12
+
13
+
14
+<img src="https://netdata.cloud/img/nats.svg" width="150"/>
15
+
16
+
17
+Plugin: go.d.plugin
18
+Module: nats
19
+
20
+<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21
+
22
+## Overview
23
+
24
+This collector monitors the activity and performance of NATS servers.
25
+
26
+
27
+It sends HTTP requests to the NATS HTTP server's dedicated [monitoring port](https://docs.nats.io/running-a-nats-service/nats_admin/monitoring#monitoring-nats).
28
+
29
+
30
+This collector is supported on all platforms.
31
+
32
+This collector supports collecting metrics from multiple instances of this integration, including remote instances.
33
+
34
+
35
+### Default Behavior
36
+
37
+#### Auto-Detection
38
+
39
+The collector can automatically detect NATS instances running on:
40
+
41
+- localhost that are listening on port 8222
42
+- within Docker containers
43
+
44
+
45
+#### Limits
46
+
47
+The default configuration for this integration does not impose any limits on data collection.
48
+
49
+#### Performance Impact
50
+
51
+The default configuration for this integration is not expected to impose a significant performance impact on the system.
52
+
53
+
54
+## Metrics
55
+
56
+Metrics grouped by *scope*.
57
+
58
+The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
59
+
60
+
61
+
62
+### Per server
63
+
64
+These metrics refer to NATS servers.
65
+
66
+This scope has no labels.
67
+
68
+Metrics:
69
+
70
+| Metric | Dimensions | Unit |
71
+|:------|:----------|:----|
72
+| nats.server_traffic | in, out | bytes/s |
73
+| nats.server_messages | in, out | messages/s |
74
+| nats.server_connections_current | active | connections |
75
+| nats.server_connections_rate | connections | connections/s |
76
+| nats.server_health_probe_status | ok, error | status |
77
+| nats.server_cpu_usage | used | percent |
78
+| nats.server_mem_usage | used | bytes |
79
+| nats.server_uptime | uptime | seconds |
80
+
81
+### Per http endpoint
82
+
83
+These metrics refer to HTTP endpoints.
84
+
85
+Labels:
86
+
87
+| Label | Description |
88
+|:-----------|:----------------|
89
+| http_endpoint | HTTP endpoint path. |
90
+
91
+Metrics:
92
+
93
+| Metric | Dimensions | Unit |
94
+|:------|:----------|:----|
95
+| nats.http_endpoint_requests | requests | requests/s |
96
+
97
+
98
+
99
+## Alerts
100
+
101
+There are no alerts configured by default for this integration.
102
+
103
+
104
+## Setup
105
+
106
+### Prerequisites
107
+
108
+#### Enable NATS monitoring
109
+
110
+See [Enable monitoring](https://docs.nats.io/running-a-nats-service/nats_admin/monitoring#enabling-monitoring).
111
+
112
+
113
+
114
+### Configuration
115
+
116
+#### File
117
+
118
+The configuration file name for this integration is `go.d/nats.conf`.
119
+
120
+
121
+You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the
122
+Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
123
+
124
+```bash
125
+cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
126
+sudo ./edit-config go.d/nats.conf
127
+```
128
+#### Options
129
+
130
+The following options can be defined globally: update_every, autodetection_retry.
131
+
132
+
133
+<details open><summary>Config options</summary>
134
+
135
+| Name | Description | Default | Required |
136
+|:----|:-----------|:-------|:--------:|
137
+| update_every | Data collection frequency. | 1 | no |
138
+| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
139
+| url | Server URL. | http://127.0.0.1:8222 | yes |
140
+| timeout | HTTP request timeout. | 1 | no |
141
+| username | Username for basic HTTP authentication. | | no |
142
+| password | Password for basic HTTP authentication. | | no |
143
+| proxy_url | Proxy URL. | | no |
144
+| proxy_username | Username for proxy basic HTTP authentication. | | no |
145
+| proxy_password | Password for proxy basic HTTP authentication. | | no |
146
+| method | HTTP request method. | GET | no |
147
+| body | HTTP request body. | | no |
148
+| headers | HTTP request headers. | | no |
149
+| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no |
150
+| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no |
151
+| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no |
152
+| tls_cert | Client TLS certificate. | | no |
153
+| tls_key | Client TLS key. | | no |
154
+
155
+</details>
156
+
157
+#### Examples
158
+
159
+##### Basic
160
+
161
+A basic example configuration.
162
+
163
+```yaml
164
+jobs:
165
+ - name: local
166
+ url: http://127.0.0.1:8222
167
+
168
+```
169
+##### HTTP authentication
170
+
171
+Basic HTTP authentication.
172
+
173
+<details open><summary>Config</summary>
174
+
175
+```yaml
176
+jobs:
177
+ - name: local
178
+ url: http://127.0.0.1:8222
179
+ username: username
180
+ password: password
181
+
182
+```
183
+</details>
184
+
185
+##### HTTPS with self-signed certificate
186
+
187
+NATS with enabled HTTPS and self-signed certificate.
188
+
189
+<details open><summary>Config</summary>
190
+
191
+```yaml
192
+jobs:
193
+ - name: local
194
+ url: http://127.0.0.1:8222
195
+ tls_skip_verify: yes
196
+
197
+```
198
+</details>
199
+
200
+##### Multi-instance
201
+
202
+> **Note**: When you define multiple jobs, their names must be unique.
203
+
204
+Collecting metrics from local and remote instances.
205
+
206
+
207
+<details open><summary>Config</summary>
208
+
209
+```yaml
210
+jobs:
211
+ - name: local
212
+ url: http://127.0.0.1:8222
213
+
214
+ - name: remote
215
+ url: http://192.0.2.1:8222
216
+
217
+```
218
+</details>
219
+
220
+
221
+
222
+## Troubleshooting
223
+
224
+### Debug Mode
225
+
226
+**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.
227
+
228
+To troubleshoot issues with the `nats` collector, run the `go.d.plugin` with the debug option enabled. The output
229
+should give you clues as to why the collector isn't working.
230
+
231
+- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
232
+ your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
233
+
234
+ ```bash
235
+ cd /usr/libexec/netdata/plugins.d/
236
+ ```
237
+
238
+- Switch to the `netdata` user.
239
+
240
+ ```bash
241
+ sudo -u netdata -s
242
+ ```
243
+
244
+- Run the `go.d.plugin` to debug the collector:
245
+
246
+ ```bash
247
+ ./go.d.plugin -d -m nats
248
+ ```
249
+
250
+### Getting Logs
251
+
252
+If you're encountering problems with the `nats` collector, follow these steps to retrieve logs and identify potential issues:
253
+
254
+- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
255
+- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.
256
+
257
+#### System with systemd
258
+
259
+Use the following command to view logs generated since the last Netdata service restart:
260
+
261
+```bash
262
+journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nats
263
+```
264
+
265
+#### System without systemd
266
+
267
+Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
268
+
269
+```bash
270
+grep nats /var/log/netdata/collector.log
271
+```
272
+
273
+**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
274
+
275
+#### Docker Container
276
+
277
+If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
278
+
279
+```bash
280
+docker logs netdata 2>&1 | grep nats
281
+```
282
+
283
+