Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nats module improvements #22445

Merged
merged 20 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- 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]

*Packetbeat*

Expand Down
232 changes: 229 additions & 3 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35464,13 +35464,124 @@ type: keyword

--

*`nats.server.time`*::
[float]
=== connection

Contains nats connection related metrics



*`nats.connection.name`*::
+
--
Server time of metric creation
The name of the connection


type: date
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

--

Expand All @@ -35491,6 +35602,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