////
This file is generated! See scripts/mage/docs_collector.go
////

:modulename: stan

[[metricbeat-module-stan]]
[role="xpack"]
== Stan module

include::{libbeat-dir}/shared/integration-link.asciidoc[]

:modulename!:

The STAN module uses https://github.com/nats-io/nats-streaming-server/blob/master/server/monitor.go[STAN monitoring server APIs] to collect metrics.

The default metricsets are `channels`, `stats` and `subscriptions`.

[float]
=== Compatibility

The STAN module is tested with STAN 0.15.1.

[float]
== Dashboard
Dashboards for topic message count and queue depth are included:

image::./images/metricbeat-stan-overview.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.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint
----

This module supports TLS connections when using `ssl` config field, as described in <<configuration-ssl>>.
It also supports the options described in <<module-http-config-options>>.

[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[]

