Skip to main content
Version: v0.5.0

Platform configuration

This section details the configuration files used by the fluxrig platform.

Configuration precedence & environment variables

To support modern containerized deployments (Docker/Kubernetes), fluxrig merges configuration from multiple sources, evaluated in the following order of precedence (highest to lowest):

  1. CLI Flags (--level debug)
  2. Environment Variables (FLUXRIG_LEVEL=debug)
  3. Config File (fluxrig.toml)
  4. Static Defaults

The environment variable mapping replaces dots (.) with underscores (_) and uppercases the key. For example, base.name becomes FLUXRIG_BASE_NAME.

Top-level overrides for troubleshooting:

  • FLUXRIG_TRACE=true: Forces all logging to TRACE level (high volume).
  • FLUXRIG_DEBUG=true: Forces all logging to DEBUG level.
  • FLUXRIG_DISABLE_TELEMETRY=true: Master switch to stop all self-monitoring reporting.

Secret management

fluxrig does not store secrets in plaintext TOML. For sensitive values (e.g., database passwords, API keys):

  1. Use Environment Variables at runtime (FLUXRIG_STORE_DATABASE_PASSWORD).
  2. Use the State Envelope (Passport), which encrypts secrets at rest once injected.

Rack configuration (fluxrig)

The static binary fluxrig loads its configuration from fluxrig.toml by default.

File: fluxrig.toml

Configuration is namespaced to separate global/shared settings from component-specific ones.

[Logging] (Rack)

Shared logging content.

FieldTypeDefaultDescription
levelstring"info"Verbosity: debug, info, warn, error.
filenamestring"logs/fluxrig.log"Path to log file.
max_size_mbint100Max size in MB before rotation.
max_backupsint7Max number of old log files to keep.
compressbooltrueCompress rotated log files (gzip).
traceboolfalseHard-override to enable trace level.
debugboolfalseHard-override to enable debug level.

Throttling settings

FieldTypeDefaultDescription
throttling.enabledbooltrueToggle log throttling protection.
throttling.ratefloat500.0Max lines per second per gear.
throttling.burstint50Temporary log burst capacity.

[Base] (Common)

Foundational identity and path settings.

FieldTypeDefaultDescription
namestring"node-01"Unique Name. Claims this specific identity.
state_dirstring"./data"Root directory for state and WAL.
state_filestring"rack.flux"Signed State Bundle (CBOR). Persists Identity, Config, and Secrets.

[Rack]

Rack-specific agent settings.

FieldTypeDefaultDescription
name_prefixstring"node-"Ephemeral Prefix. Used if base.name is empty.
ipstring""Manual IP Override. If empty, the Rack autodetects its local primary IP via netutil.
max_hopsint64Max Routing Hops. Prevents infinite loops.
max_payload_sizeint2097152Max Payload Size (Bytes). Default: 2MB.
enrollment_timeoutstring"15s"Timeout for enrollment handshake.
heartbeat_intervalstring"30s"Frequency of Registry heartbeats.

[Store]

Data storage settings.

FieldTypeDefaultDescription
dirstring"./data"Root directory for data storage.

[Snake] (NATS/JetStream)

Configuration for the underlying transport bus.

FieldTypeDefaultDescription
urlstring"nats://localhost:4222"NATS Server URL.
domainstring"flux"JetStream Domain. Must match Mixer cluster name.
stream_namestring"flux-msg"Primary JetStream stream name.
connect_timeoutstring"10s"Initial connection timeout.
reconnect_waitstring"1s"Wait time between reconnect attempts.
convergence_delaystring"100ms"Safety delay for consumer convergence.

Example

[base]
name = "rack-nyc-01"
state_dir = "/var/lib/fluxrig/data"

[logging]
level = "debug"

[snake]
url = "nats://nats.fluxrig.internal:4222"

Note on Log Files:

  • Rack writes to <log_dir>/fluxrig-rack.log.
  • CLI writes to <log_dir>/fluxrig-cli.log (if enabled).

Mixer configuration (fluxrig-mixer)

The dynamic binary fluxrig-mixer loads its configuration from fluxrig-mixer.toml.

File: fluxrig-mixer.toml

Configuration is namespaced into granular sections.

[Logging] (Mixer)

Shared logging content.

FieldTypeDefaultDescription
levelstring"info"Verbosity: debug, info, warn, error.
filenamestring"logs/mixer.log"Path to log file.
max_backupsint7Max number of old log files to keep.

[Mixer]

General Mixer settings.

FieldTypeDefaultDescription
max_hopsint64Global Max Hops.
max_payload_sizeint2097152Global Max Payload (Bytes).
startup_scenariostring""Scenario reference to load on startup.
scenario_wait_timeoutstring"15s"Time to wait for Racks to converge when activating a scenario.

Registry-First Identity Model

NOTE

Important Change (future releases): The static machine_id configuration field has been completely removed from both Rack and Mixer configurations. fluxrig now enforces a Registry-First Enrollment Model.

  • Racks: Dynamically receive a 128-bit uuid.UUID Identity during the Enrollment Handshake, which is cryptographically signed and stored in the local state.flux passport.
  • Mixers: Automatically generate a persistent cluster identity (UUID v7) on their first boot, which is maintained in the internal Unified Registry (registry).

[Enrollment] (Mixer)

Control how new Racks are admitted to the rig.

FieldTypeDefaultDescription
auto_adoptboolfalseIf true, any new Rack connecting will be immediately set to active. Use cautiously in production.
push_delaystring"1s"Delay before pushing the initial scenario to a newly adopted Rack.

[Ingest] (Mixer)

Control telemetry ingestion buffering and flushing.

FieldTypeDefaultDescription
flush_intervalstring"5s"Interval for flushing telemetry to persistent storage.
buffer_sizeint1024Internal channel buffer size for telemetry ingestion.

[API]

Mixer REST API settings.

FieldTypeDefaultDescription
portint8090Server Port for the HTTP/gRPC API listener.

[Store] (Mixer)

Data storage settings (Analytics/Registry).

FieldTypeDefaultDescription
database_filestring"fluxrig.duckdb"DB filename (relative to store dir).
cluster_key_filestring"cluster.key"Key filename (relative to store dir).

[Snake]

Embedded NATS Server (JetStream) settings.

FieldTypeDefaultDescription
portint4222Server Port to listen on for NATS connections.
urlstring"nats://localhost:4222"URL to advertise to Racks.
domainstring"flux"JetStream Domain Name.
stream_namestring"flux-msg"Name of the primary JetStream stream.
stream_subjects[]string["flux.msg.>", "flux.gear.>", "fluxrig.>"]Wildcard subjects to capture.
business_stream_max_agestring"720h"Data retention time for business logic streams.
telemetry_stream_max_agestring"24h"Data retention time for telemetry streams.
durableboolfalseEnable disk-durable JetStream persistence.

Example (Mixer)

[base]
name = "mixer-prod-01"

[logging]
level = "info"

[mixer]
startup_scenario = "scenario_prod.yaml"

[api]
port = 8090

[store]
dir = "./data"

[snake]
port = 4222
url = "nats://localhost:4222"
domain = "flux"

[Roadmap] Observability tiers

The platform is designed to support multiple observability tiers for various scales. In the current release, only the Embedded Tier is fully implemented.

TierBackend(s)Use CaseStatus
embeddedDuckDB + ParquetZero deps, development, edgeStable
standardArc + OpenSearchTeam deployments[Roadmap]
enterpriseClickHouse + SigNozPetabyte scale[Roadmap]

[Observability]

Global observability settings.

FieldTypeDefaultDescription
enabledbooltrueEnable/disable observability collection.
tierstring"embedded"Backend tier: embedded (standard), otlp (collector).
sampling_ratefloat1.0Trace sampling rate (0.0 - 1.0).

Embedded tier configuration

[Observability.embedded]

Settings for the Embedded tier (DuckDB + Parquet).

FieldTypeDefaultDescription
data_dirstring"./data/telemetry"Directory for telemetry storage.
flush_intervalstring"5s"Interval to flush data to disk.

[Observability.embedded.storage]

Storage format and organization.

FieldTypeDefaultDescription
formatstring"parquet"Storage format: parquet, json.
partition_bystring"hour"Time partitioning: hour, day.
compressionstring"zstd"Compression: zstd, snappy, none.

[Observability.embedded.rotation]

Rotation and retention policies.

FieldTypeDefaultDescription
policystring"time"Rotation policy: time, size, both.
max_age_daysint30Delete data older than N days.
max_size_gbint10Max total storage size in GB.
check_intervalstring"1h"How often to check rotation rules.

[Store] (embedded)

  • dir: Root directory for data storage (e.g., ./data).
  • wal_max_size_mb: Max size for Write-Ahead Log.
  • database_file: Filename for DuckDB file.

The flux_id (serialized as flux_id in JSON and database schemas) is the unique 128-bit identifier used to trace a specific business signal across its entire lifecycle, from edge ingestion to cloud archival.

Embedded storage schema

Data is organized into telemetry (system signals) and messages (business data):

./data/
├── telemetry/ # OTel signals (system observability)
│ ├── traces/
│ │ └── 2025/12/21/14/traces_001.parquet
│ ├── logs/
│ │ └── 2025/12/21/14/logs_001.parquet
│ └── metrics/
│ └── 2025/12/21/14/metrics_001.parquet
└── messages/ # Business data (fluxMsg)
├── generic/ # Default schema (raw_msg only)
│ └── 2025/12/21/14/fluxmsg_001.parquet
└── fluxSpec/ # Spec-driven schemas
└── visa-v1/ # Spec-specific subfolder
└── 2025/12/21/14/visa_001.parquet

Parquet Schema (Traces):

ColumnTypeDescription
tsTIMESTAMPEvent timestamp
trace_idVARCHARW3C TraceContext ID
span_idVARCHARSpan ID
parent_span_idVARCHARParent Span ID
flux_idUUIDUUID v7 business ID
entity_idUUIDUnified EntityID (128-bit UUID v7)
entity_nameTEXTHuman-readable Hostname (e.g., rack-sfo-01)
span_nameVARCHAROperation name
duration_msFLOATDuration in milliseconds
statusENUMok, error
attributesJSONAdditional attributes

Parquet Schema (Logs):

ColumnTypeDescription
tsTIMESTAMPLog timestamp
entity_idUUIDUnified EntityID
entity_nameTEXTHuman-readable Hostname
flux_idUUIDBusiness flow ID
levelENUMdebug, info, warn, error
messageVARCHARLog message
attributesJSONStructured fields

Parquet Schema (Metrics):

ColumnTypeDescription
tsTIMESTAMPMetric timestamp
nameVARCHARMetric name (e.g., gear_latency_ms)
entity_idUUIDUnified EntityID
entity_nameTEXTHuman-readable Hostname
typeENUMcounter, gauge, histogram
valueDOUBLEMetric value
labelsJSONDimension labels

Parquet Schema (fluxMsg / Data):

ColumnTypeDescription
tsTIMESTAMPMessage timestamp
trace_idVARCHARAssociated trace
flux_idUUIDPrimary business ID
entity_idUUIDNode EntityID
entity_nameTEXTHostname
src_gear_idVARCHARSource Gear
dst_gear_idVARCHARDestination Gear
msg_typeVARCHARMessage type identifier
directionENUMinbound, outbound, internal
statusENUMok, error
raw_msgBLOBFull CBOR payload
promotedJSONPromoted fields (spec-driven)

Embedded example

[observability]
enabled = true
tier = "embedded"
sampling_rate = 1.0

[observability.embedded]
# Data_dir is managed by [store] config
flush_interval = "5s"

[observability.embedded.storage]
format = "parquet"
partition_by = "hour"
compression = "zstd"

[observability.embedded.rotation]
policy = "both"
max_age_days = 30
max_size_gb = 10
check_interval = "1h"

OTLP tier configuration (vendor-neutral)

For integration with any OpenTelemetry-compatible backend (Datadog, Jaeger, Grafana Tempo, etc.).

[Observability.otlp]

OpenTelemetry Protocol exporter settings.

FieldTypeDefaultDescription
endpointstring""OTLP gRPC endpoint (e.g., 127.0.0.1:4317).
endpoint_httpstring""OTLP HTTP endpoint (alternative to gRPC).
headersmap{}Custom headers (e.g., API keys).
insecureboolfalseSkip TLS verification.
timeoutstring"30s"Request timeout.

OTLP example

[observability]
enabled = true
tier = "otlp"

[observability.otlp]
endpoint = "otel-collector:4317"
insecure = false
headers = { "api-key" = "${OTEL_API_KEY}" }

# Optional: also store raw fluxMsg locally
[observability.otlp.messages]
enabled = true
data_dir = "./data/messages"

CLI query commands

The fluxrig CLI provides commands for querying telemetry data.

fluxrig logs

Query log entries.

# Filter by severity
fluxrig logs --min-level error --since 1h

# Filter by entity
fluxrig logs --entity rack-nyc-01 --limit 100
FlagTypeDescription
--min-levelstringMinimum log level: debug, info, warn, error.
--sincedurationTime window (e.g., 1h, 24h) or ISO timestamp.
--untilstringEnd time (ISO timestamp).
--entitystringFilter by Entity Name.
--limitintMax results (default: 50).
--api-urlstringMixer API URL (default: http://localhost:8090).

fluxrig metrics

Query metrics data.

# Filter by metric name
fluxrig metrics --name fluxrig.rack.heartbeats_sent

# Filter by entity
fluxrig metrics --entity mixer-01
FlagTypeDescription
--namestringFilter by metric name.
--entitystringFilter by Entity Name.
--sincedurationStart time.
--untilstringEnd time.
--limitintMax results (default: 50).
--api-urlstringMixer API URL (default: http://localhost:8090).

REST API endpoints

The Mixer exposes telemetry query endpoints via a REST API.

WARNING

API Security Limitation (Current Release): The current release of the Control Plane API does NOT implement authentication or authorization. It is strictly intended for use within trusted, isolated management networks. Exposing this port to the public internet will allow unauthorized scenario activation and data exfiltration.

Logs API

GET /api/v1/telemetry/logs

Query Parameters:

ParameterTypeDescription
levelstringFilter by level.
sinceRFC3339Start time.
untilRFC3339End time.
rack_idstringFilter by Rack.
gear_idstringFilter by Gear.
qstringText search.
limitintMax results.
offsetintPagination offset.

Example:

curl "http://mixer:8090/api/v1/telemetry/logs?level=error&since=2025-12-21T00:00:00Z&limit=50"

Traces API

GET /api/v1/telemetry/traces
GET /api/v1/telemetry/traces/{trace_id}

Query Parameters:

ParameterTypeDescription
flux_idUUIDFilter by flux_id.
sinceRFC3339Start time.
min_duration_msintMinimum duration filter.
statusstringok or error.

Metrics API

GET /api/v1/telemetry/metrics
GET /api/v1/telemetry/metrics/{metric_name}

Query Parameters:

ParameterTypeDescription
sinceRFC3339Start time.
untilRFC3339End time.
group_bystringAggregation key.
intervalstringTime bucket: 1m, 5m, 1h.