Skip to content

Commit

Permalink
Add STAN metricbeat module (elastic#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
devon-kim authored and GitHub Enterprise committed Aug 14, 2019
1 parent 206d830 commit 5aaffa5
Show file tree
Hide file tree
Showing 38 changed files with 7,075 additions and 0 deletions.
256 changes: 256 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ grouped in the following categories:
* <<exported-fields-prometheus>>
* <<exported-fields-rabbitmq>>
* <<exported-fields-redis>>
* <<exported-fields-stan>>
* <<exported-fields-system>>
* <<exported-fields-traefik>>
* <<exported-fields-uwsgi>>
Expand Down Expand Up @@ -23304,6 +23305,261 @@ type: long
--
[[exported-fields-stan]]
== Stan fields
stan Module
[float]
== stan fields
`stan` contains statistics that were read from Nats Streaming server (STAN)
*`stan.server.id`*::
+
--
type: keyword
The server ID
--
*`stan.server.time`*::
+
--
type: date
Server time of metric creation
--
[float]
== channels fields
Contains stan / nats streaming/serverz endpoint metrics
*`stan.channels.name`*::
+
--
type: keyword
The name of the STAN streaming channel
--
*`stan.channels.msgs`*::
+
--
type: long
The number of STAN streaming messages
--
*`stan.channels.bytes`*::
+
--
type: long
The number of STAN bytes in the channel
--
*`stan.channels.first_seq`*::
+
--
type: long
First sequence number stored in the channel
--
*`stan.channels.last_seq`*::
+
--
type: long
Last sequence number stored in the channel
--
*`stan.channels.depth`*::
+
--
type: long
Queue depth based upon current sequence number and highest reported subscriber sequence number
--
[float]
== stats fields
Contains only high-level stan / nats streaming server related metrics
*`stan.stats.state`*::
+
--
type: keyword
The cluster / streaming configuration state (STANDALONE, CLUSTERED)
--
*`stan.stats.role`*::
+
--
type: keyword
If clustered, role of this node in the cluster (Leader, Follower, Candidate)
--
*`stan.stats.clients`*::
+
--
type: integer
The number of STAN clients
--
*`stan.stats.subscriptions`*::
+
--
type: integer
The number of STAN streaming subscriptions
--
*`stan.stats.channels`*::
+
--
type: integer
The number of STAN channels
--
*`stan.stats.messages`*::
+
--
type: long
Number of messages across all STAN queues
--
*`stan.stats.bytes`*::
+
--
type: long
Number of bytes consumed across all STAN queues
--
[float]
== subscriptions fields
Contains stan / nats streaming/serverz endpoint subscription metrics
*`stan.subscriptions.id`*::
+
--
type: keyword
The name of the STAN channel subscription (client_id)
--
*`stan.subscriptions.channel`*::
+
--
type: keyword
The name of the STAN channel the subscription is associated with
--
*`stan.subscriptions.queue`*::
+
--
type: keyword
The name of the NATS queue that the STAN channel subscription is associated with, if any
--
*`stan.subscriptions.last_sent`*::
+
--
type: long
Last known sequence number of the subscription that was acked
--
*`stan.subscriptions.pending`*::
+
--
type: long
Number of pending messages from / to the subscriber
--
*`stan.subscriptions.offline`*::
+
--
type: bool
Is the subscriber marked as offline?
--
*`stan.subscriptions.stalled`*::
+
--
type: bool
Is the subscriber known to be stalled?
--
[[exported-fields-system]]
Expand Down
62 changes: 62 additions & 0 deletions metricbeat/docs/modules/stan.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-module-stan]]
== Stan module

beta[]

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`. `streaming` was added by Endgame engineers

[float]
=== Compatibility

The Nats module is tested with Nats 1.3.0.


[float]
=== Dashboard

The Nats module comes with a predefined dashboard. For example:

image::./images/metricbeat_nats_dashboard.png[]


[float]
=== Example configuration

The Stan module supports the standard configuration options that are described
in <<configuration-metricbeat>>. Here is an example configuration:

[source,yaml]
----
metricbeat.modules:
- module: stan
metricsets: ["stats", "channels", "subscriptions"]
period: 60s
hosts: ["localhost:8222"]
#stats.metrics_path: "/streaming/serverz"
#channels.metrics_path: "/streaming/channelsz"
#subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint
----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-stan-channels,channels>>

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

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

include::stan/channels.asciidoc[]

include::stan/stats.asciidoc[]

include::stan/subscriptions.asciidoc[]

23 changes: 23 additions & 0 deletions metricbeat/docs/modules/stan/channels.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-stan-channels]]
=== Stan channels metricset

beta[]

include::../../../module/stan/channels/_meta/docs.asciidoc[]


==== Fields

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

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/stan/channels/_meta/data.json[]
----
23 changes: 23 additions & 0 deletions metricbeat/docs/modules/stan/stats.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-stan-stats]]
=== Stan stats metricset

beta[]

include::../../../module/stan/stats/_meta/docs.asciidoc[]


==== Fields

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

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/stan/stats/_meta/data.json[]
----
5 changes: 5 additions & 0 deletions metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ This file is generated! See scripts/docs_collector.py
.3+| .3+| |<<metricbeat-metricset-redis-info,info>>
|<<metricbeat-metricset-redis-key,key>>
|<<metricbeat-metricset-redis-keyspace,keyspace>>
|<<metricbeat-module-stan,Stan>> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.3+| .3+| |<<metricbeat-metricset-stan-channels,channels>> beta[]
|<<metricbeat-metricset-stan-stats,stats>> beta[]
|<<metricbeat-metricset-stan-subscriptions,subscriptions>> beta[]
|<<metricbeat-module-system,System>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.14+| .14+| |<<metricbeat-metricset-system-core,core>>
|<<metricbeat-metricset-system-cpu,cpu>>
Expand Down Expand Up @@ -212,6 +216,7 @@ include::modules/postgresql.asciidoc[]
include::modules/prometheus.asciidoc[]
include::modules/rabbitmq.asciidoc[]
include::modules/redis.asciidoc[]
include::modules/stan.asciidoc[]
include::modules/system.asciidoc[]
include::modules/traefik.asciidoc[]
include::modules/uwsgi.asciidoc[]
Expand Down
Loading

0 comments on commit 5aaffa5

Please sign in to comment.