NATS
Core pluginmarmotdata/nats
Discover JetStream streams from NATS servers
The NATS plugin discovers JetStream streams from NATS servers. It connects using the NATS client protocol and enumerates streams via the JetStream API, collecting configuration and runtime state for each stream.
Requirements
- JetStream must be enabled on the NATS server (start with
-jsflag or configure innats-server.conf). Core NATS subjects are ephemeral and not discoverable as persistent assets. - The connecting user needs permission to access the JetStream API (
$JS.API.>).
Authentication
The plugin supports several authentication methods:
- Token: Set the
tokenfield for token-based auth. - Username/Password: Set
usernameandpasswordfields. - Credentials file: Set
credentials_fileto the path of a.credsfile (NKey-based auth). - TLS: Enable
tlsfor encrypted connections. Usetls_insecureto skip certificate verification in development.
In the UI
Point-and-click, no config file needed.
- 1 Open
Runs→Create Pipeline - 2 Pick NATS from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-nats-pipeline
runs:
- nats:
host: "<host>"marmot ingest -c ingest.yaml Not using plugins? Other ways to populate Marmot
Configuration
11 top-level fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
host string NATS server hostname or IP address
port int NATS server port
4222 token password Authentication token
username string Username for authentication
password password Password for authentication
credentials_file string Path to NATS credentials file (.creds)
tls bool Enable TLS connection
tls_insecure bool Skip TLS certificate verification
Assets Emitted
Metadata fields this plugin attaches to each discovered asset.
NATS Stream
NATSStreamFieldsNATSStreamFields defines metadata fields for NATS JetStream streams
stream_name stringName of the JetStream stream
subjects stringComma-separated list of subjects the stream listens on
retention_policy stringMessage retention policy (Limits, Interest, WorkQueue)
max_bytes intMaximum total bytes for the stream (-1 = unlimited)
max_msgs intMaximum number of messages (-1 = unlimited)
max_age stringMaximum age of messages
max_msg_size intMaximum size of a single message
storage_type stringStorage backend (File or Memory)
num_replicas intNumber of stream replicas
duplicate_window stringDuplicate message tracking window
discard_policy stringPolicy when limits are reached (Old or New)
messages intTotal number of messages in the stream
bytes intTotal bytes stored in the stream
consumer_count intNumber of consumers attached to the stream
first_seq intSequence number of the first message
last_seq intSequence number of the last message
host stringNATS server hostname
port intNATS server port