Synadia Insights

Configuration

Insights uses a layered configuration system. Every setting can be specified through CLI flags, environment variables, or a YAML config file.

Priority Order

When the same setting is defined in multiple places, the highest-priority source wins:

  1. CLI flags (e.g., --nats.server nats://host:4222)
  2. Environment variables (e.g., INSIGHTS_NATS_SERVER=nats://host:4222)
  3. YAML config file (loaded via --config config.yaml)
  4. Built-in defaults

Config File

Load a YAML config file with the --config (or -c) flag:

./insights --config /etc/insights/config.yaml

For a complete annotated example, see config.example.yaml.

Environment Variable Naming

Every flag has a corresponding environment variable. The naming convention is:

  • Start with the INSIGHTS_ prefix
  • Replace dots with underscores
  • Convert to uppercase
FlagEnvironment Variable
--log-levelINSIGHTS_LOG_LEVEL
--data-dirINSIGHTS_DATA_DIR
--nats.serverINSIGHTS_NATS_SERVER
--sys.credsINSIGHTS_SYS_CREDS
--scraper.intervalINSIGHTS_SCRAPER_INTERVAL
--web.portINSIGHTS_WEB_PORT
--db.retention.durationINSIGHTS_DB_RETENTION_DURATION
--sink.retentionINSIGHTS_SINK_RETENTION
--simulator.enabledINSIGHTS_SIMULATOR_ENABLED

Nested sections add their prefix. For example, a scraper NATS connection uses INSIGHTS_SCRAPER_NATS_SERVER.

Configuration Sections

log-level

Controls logging verbosity. Accepted values: debug, info, warn, error.

FlagEnvDefault
--log-levelINSIGHTS_LOG_LEVELinfo

license

License key for production deployments. Provide either a raw JWT string or a path to a file containing the JWT. If both are set, the file takes precedence.

A license is required for production use. It is not required when the simulator is enabled (--simulator.enabled). See Installation › Configure a License for how to obtain and configure a license, and Trial for evaluation.

FlagEnvDefault
--license.tokenINSIGHTS_LICENSE_TOKEN(empty)
--license.fileINSIGHTS_LICENSE_FILE(empty)

data-dir

Base directory for persistent storage. This directory holds the DuckDB database file (insights.db) and JetStream data (nats/).

When unset, a temporary directory is created and all data is lost on restart. Set this for any deployment where you want data to survive restarts.

FlagEnvDefault
--data-dirINSIGHTS_DATA_DIR(temp dir)

sys.*: System Account Connection

NATS connection used to scrape the target NATS system. Insights issues $SYS requests over this connection to collect server metrics. This is required when the simulator is disabled.

FlagEnvDescription
--sys.serverINSIGHTS_SYS_SERVERNATS server URL
--sys.credsINSIGHTS_SYS_CREDSPath to credentials file (.creds)
--sys.contextINSIGHTS_SYS_CONTEXTNATS context name (from nats context)
--sys.userINSIGHTS_SYS_USERUsername for basic auth
--sys.passwordINSIGHTS_SYS_PASSWORDPassword for basic auth
--sys.nkeyINSIGHTS_SYS_NKEYNKey seed for authentication
--sys.jwtINSIGHTS_SYS_JWTUser JWT for authentication
--sys.tls-certINSIGHTS_SYS_TLS_CERTTLS certificate path
--sys.tls-keyINSIGHTS_SYS_TLS_KEYTLS key path
--sys.tlscaINSIGHTS_SYS_TLS_CATLS CA certificate path
--sys.tls-firstINSIGHTS_SYS_TLS_FIRSTPerform TLS handshake before NATS protocol
--sys.socks-proxyINSIGHTS_SYS_SOCKS_PROXYSOCKS proxy URL

nats.*: Top-Level NATS Connection

NATS connection used by the API server and as the default for the indexer and scraper if they do not specify their own connections.

This connection is only needed when using an external NATS sink (--sink.embed=false). When the embedded sink is enabled (the default), Insights manages its own internal NATS server automatically.

The flags mirror sys.* above. Just swap the sys. prefix for nats. (for example, --nats.server, --nats.creds).

Connection fallback order: scraper.nats falls back to indexer.nats, which falls back to nats (top-level).

db.*: Database

DuckDB configuration options.

FlagEnvDefaultDescription
--db.memory-limitINSIGHTS_DB_MEMORY_LIMIT4GBDuckDB memory limit. Caps the buffer pool to prevent swapping
--db.threadsINSIGHTS_DB_THREADS0DuckDB worker threads (0 = auto, uses all cores)
--db.retention.durationINSIGHTS_DB_RETENTION_DURATION768hHow long to keep data in DuckDB (0 = disabled)
--db.retention.intervalINSIGHTS_DB_RETENTION_INTERVAL10mHow often the retention sweep runs

scraper.*: Scraper

Controls how Insights collects metrics from NATS servers.

FlagEnvDefaultDescription
--scraper.enabledINSIGHTS_SCRAPER_ENABLEDtrueEnable or disable the scraper
--scraper.intervalINSIGHTS_SCRAPER_INTERVAL1mTime between scrape cycles
--scraper.timeoutINSIGHTS_SCRAPER_TIMEOUT30sTimeout for individual scrape requests

The scraper optionally accepts its own NATS connection via --scraper.nats.* flags, falling back to the indexer NATS and then the top-level NATS connection.

indexer.*: Indexer

Controls how scraped data is processed and stored in DuckDB.

FlagEnvDefaultDescription
--indexer.enabledINSIGHTS_INDEXER_ENABLEDtrueEnable or disable the indexer
--indexer.stream-latestINSIGHTS_INDEXER_STREAM_LATESTfalseStart consuming from the latest message
--indexer.stream-epochINSIGHTS_INDEXER_STREAM_EPOCH0Start consuming from a specific epoch number
--indexer.stream-filtersINSIGHTS_INDEXER_STREAM_FILTERS(empty)Comma-separated list of endpoints to process (e.g., varz,jsz,connz)
--indexer.stream-intervalINSIGHTS_INDEXER_STREAM_INTERVAL0sDownsample interval. Skip epochs closer together than this

web.*: Web Server

Controls the built-in web UI and HTTP server.

FlagEnvDefaultDescription
--web.enabledINSIGHTS_WEB_ENABLEDtrueEnable or disable the web server
--web.hostnameINSIGHTS_WEB_HOSTNAME127.0.0.1Bind hostname (0.0.0.0 for all interfaces)
--web.portINSIGHTS_WEB_PORT8080Bind port
--web.session-seedINSIGHTS_WEB_SESSION_SEEDinsightsSeed for secure session cookies
--web.tlsINSIGHTS_WEB_TLSfalseEnable TLS (HTTPS). HTTP/2 is automatically available via ALPN
--web.tls-certINSIGHTS_WEB_TLS_CERT(empty)Path to TLS certificate. Empty auto-generates a self-signed cert
--web.tls-keyINSIGHTS_WEB_TLS_KEY(empty)Path to TLS private key. Empty auto-generates a self-signed key
--web.metrics-timeoutINSIGHTS_WEB_METRICS_TIMEOUT30sTimeout for collecting metrics
--web.metrics-intervalINSIGHTS_WEB_METRICS_INTERVAL1sInterval between metrics scrapes

TLS behavior: When enabled, if no certificate or key paths are provided, a self-signed certificate is automatically generated. For production, supply your own certificate and key files.

Session seed: The default value "insights" preserves sessions across restarts but should be changed to a unique secret for production deployments.

sink.*: Embedded Sink

Controls the embedded NATS server used for storing scraped data as a JetStream stream.

FlagEnvDefaultDescription
--sink.embedINSIGHTS_SINK_EMBEDtrueUse the embedded NATS server
--sink.hostINSIGHTS_SINK_HOST127.0.0.1Bind host for the embedded server
--sink.portINSIGHTS_SINK_PORT0Bind port (0 = random)
--sink.streamINSIGHTS_SINK_STREAMscrapeJetStream stream name
--sink.batch-sizeINSIGHTS_SINK_BATCH_SIZE500Batch size for sink operations
--sink.retentionINSIGHTS_SINK_RETENTION24hHow long to keep scraped data in the sink stream (0 = unlimited)

Set --sink.embed=false to use an external NATS cluster with JetStream instead of the embedded server. See the deployment guide for external sink topologies.

simulator.*: Simulator

The built-in simulator starts real in-process NATS clusters with traffic workloads, allowing you to explore Insights with zero external dependencies.

FlagEnvDefaultDescription
--simulator.enabledINSIGHTS_SIMULATOR_ENABLEDfalseEnable the embedded simulator
--simulator.profileINSIGHTS_SIMULATOR_PROFILEjs-smallSimulator profile

Available profiles control the size and topology of the simulated deployment:

Profile FamilyVariantsDescription
core-small, medium, largeCore NATS servers
js-small, medium, largeNATS with JetStream
super-small, medium, largeSuper-cluster topology
leaf-small, medium, largeLeaf node topology
super-leaf-small, medium, largeSuper-cluster with leaf nodes

backup.*: Backup

Controls database backup behavior. Backups are created via the NATS micro API and can optionally be uploaded to a NATS object store for remote access.

FlagEnvDefaultDescription
--backup.object-store-ttlINSIGHTS_BACKUP_OBJECT_STORE_TTL24hTTL for backups uploaded to the NATS object store. After this duration, uploaded backups are automatically deleted