Skip to content

Commit

Permalink
Nats module improvements (elastic#22445)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrsMark authored Nov 17, 2020
1 parent af4007e commit 70ff0a7
Show file tree
Hide file tree
Showing 55 changed files with 1,581 additions and 148 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ same journal. {pull}18467[18467]
- Map cloud data filed `cloud.account.id` to azure subscription. {pull}21483[21483] {issue}21381[21381]
- Move s3_daily_storage and s3_request metricsets to use cloudwatch input. {pull}21703[21703]
- Duplicate system.process.cmdline field with process.command_line ECS field name. {pull}22325[22325]
- Add connection and route metricsets for nats metricbeat module to collect metrics per connection/route. {pull}22445[22445]
- Add unit file states to system/service {pull}22557[22557]

*Packetbeat*
Expand Down
239 changes: 239 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35477,13 +35477,137 @@ type: keyword
*`nats.server.time`*::
+
--

deprecated:[8.0.0]

Server time of metric creation


type: date

--

[float]
=== connection

Contains nats connection related metrics



*`nats.connection.name`*::
+
--
The name of the connection


type: keyword

--

*`nats.connection.subscriptions`*::
+
--
The number of subscriptions in this connection


type: integer

--

*`nats.connection.pending_bytes`*::
+
--
The number of pending bytes of this connection


type: long

format: bytes

--

*`nats.connection.uptime`*::
+
--
The period the connection is up (sec)


type: long

format: duration

--

*`nats.connection.idle_time`*::
+
--
The period the connection is idle (sec)


type: long

format: duration

--

[float]
=== in

The amount of incoming data



*`nats.connection.in.messages`*::
+
--
The amount of incoming messages


type: long

--

*`nats.connection.in.bytes`*::
+
--
The amount of incoming bytes


type: long

format: bytes

--

[float]
=== out

The amount of outgoing data



*`nats.connection.out.messages`*::
+
--
The amount of outgoing messages


type: long

--

*`nats.connection.out.bytes`*::
+
--
The amount of outgoing bytes


type: long

format: bytes

--

[float]
=== connections

Expand All @@ -35501,6 +35625,121 @@ type: integer

--

[float]
=== route

Contains nats route related metrics



*`nats.route.subscriptions`*::
+
--
The number of subscriptions in this connection


type: integer

--

*`nats.route.remote_id`*::
+
--
The remote id on which the route is connected to


type: keyword

--

*`nats.route.pending_size`*::
+
--
The number of pending routes


type: long

--

*`nats.route.port`*::
+
--
The port of the route


type: integer

--

*`nats.route.ip`*::
+
--
The ip of the route


type: ip

--

[float]
=== in

The amount of incoming data



*`nats.route.in.messages`*::
+
--
The amount of incoming messages


type: long

--

*`nats.route.in.bytes`*::
+
--
The amount of incoming bytes


type: long

format: bytes

--

[float]
=== out

The amount of outgoing data



*`nats.route.out.messages`*::
+
--
The amount of outgoing messages


type: long

--

*`nats.route.out.bytes`*::
+
--
The amount of outgoing bytes


type: long

format: bytes

--

[float]
=== routes

Expand Down
21 changes: 19 additions & 2 deletions metricbeat/docs/modules/nats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This file is generated! See scripts/mage/docs_collector.go

This is the Nats module. The Nats module uses https://nats.io/documentation/managing_the_server/monitoring/[Nats monitoring server APIs] to collect metrics.

The default metricsets are `stats`, `connections`, `routes` and `subscriptions`.
The default metricsets are `stats`, `connections`, `routes` and `subscriptions` while `connection` and `route`
metricsets can be enabled to collect detailed metrics per connection/route.

[float]
=== Compatibility
Expand All @@ -33,30 +34,46 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: nats
metricsets: ["connections", "routes", "stats", "subscriptions"]
metricsets:
- "connections"
- "routes"
- "stats"
- "subscriptions"
#- "connection"
#- "route"
period: 10s
hosts: ["localhost:8222"]
#stats.metrics_path: "/varz"
#connections.metrics_path: "/connz"
#routes.metrics_path: "/routez"
#subscriptions.metrics_path: "/subsz"
#connection.metrics_path: "/connz"
#route.metrics_path: "/routez"
----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-nats-connection,connection>>

* <<metricbeat-metricset-nats-connections,connections>>

* <<metricbeat-metricset-nats-route,route>>

* <<metricbeat-metricset-nats-routes,routes>>

* <<metricbeat-metricset-nats-stats,stats>>

* <<metricbeat-metricset-nats-subscriptions,subscriptions>>

include::nats/connection.asciidoc[]

include::nats/connections.asciidoc[]

include::nats/route.asciidoc[]

include::nats/routes.asciidoc[]

include::nats/stats.asciidoc[]
Expand Down
21 changes: 21 additions & 0 deletions metricbeat/docs/modules/nats/connection.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
////
This file is generated! See scripts/mage/docs_collector.go
////

[[metricbeat-metricset-nats-connection]]
=== NATS connection metricset

include::../../../module/nats/connection/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-nats,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/nats/connection/_meta/data.json[]
----
21 changes: 21 additions & 0 deletions metricbeat/docs/modules/nats/route.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
////
This file is generated! See scripts/mage/docs_collector.go
////

[[metricbeat-metricset-nats-route]]
=== NATS route metricset

include::../../../module/nats/route/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-nats,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/nats/route/_meta/data.json[]
----
4 changes: 3 additions & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ This file is generated! See scripts/mage/docs_collector.go
|<<metricbeat-metricset-mysql-query,query>> beta[]
|<<metricbeat-metricset-mysql-status,status>>
|<<metricbeat-module-nats,NATS>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.4+| .4+| |<<metricbeat-metricset-nats-connections,connections>>
.6+| .6+| |<<metricbeat-metricset-nats-connection,connection>>
|<<metricbeat-metricset-nats-connections,connections>>
|<<metricbeat-metricset-nats-route,route>>
|<<metricbeat-metricset-nats-routes,routes>>
|<<metricbeat-metricset-nats-stats,stats>>
|<<metricbeat-metricset-nats-subscriptions,subscriptions>>
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/include/list_common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 70ff0a7

Please sign in to comment.