Skip to main content

NATS

Experimental
Creates:
Assets

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

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 -js flag or configure in nats-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 token field for token-based auth.
  • Username/Password: Set username and password fields.
  • Credentials file: Set credentials_file to the path of a .creds file (NKey-based auth).
  • TLS: Enable tls for encrypted connections. Use tls_insecure to skip certificate verification in development.

Example Configuration


host: "localhost"
port: 4222
token: "s3cr3t"
filter:
include:
- "^ORDERS"
tags:
- "nats"
- "messaging"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
credentials_filestringfalsePath to NATS credentials file (.creds)
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
hoststringfalseNATS server hostname or IP address
passwordstringfalsePassword for authentication
portintfalseNATS server port
tagsTagsConfigfalseTags to apply to discovered assets
tlsboolfalseEnable TLS connection
tls_insecureboolfalseSkip TLS certificate verification
tokenstringfalseAuthentication token
usernamestringfalseUsername for authentication

Available Metadata

The following metadata fields are available:

FieldTypeDescription
bytesuint64Total bytes stored in the stream
consumer_countintNumber of consumers attached to the stream
discard_policystringPolicy when limits are reached (Old or New)
duplicate_windowstringDuplicate message tracking window
first_sequint64Sequence number of the first message
hoststringNATS server hostname
last_sequint64Sequence number of the last message
max_agestringMaximum age of messages
max_bytesint64Maximum total bytes for the stream (-1 = unlimited)
max_msg_sizeint64Maximum size of a single message
max_msgsint64Maximum number of messages (-1 = unlimited)
messagesuint64Total number of messages in the stream
num_replicasintNumber of stream replicas
portintNATS server port
retention_policystringMessage retention policy (Limits, Interest, WorkQueue)
storage_typestringStorage backend (File or Memory)
stream_namestringName of the JetStream stream
subjectsstringComma-separated list of subjects the stream listens on