Skip to main content

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, rack.bus.url becomes FLUXRIG_RACK_BUS_URL.

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_backupsint3Max number of old log files to keep.
max_ageint28Max number of days to keep old log files.
compressbooltrueCompress rotated log files (gzip).

Throttling settings

FieldTypeDefaultDescription
throttling.enabledbooltrueToggle log throttling protection.
throttling.ratefloat100.0Max lines per second per gear.
throttling.burstint10Temporary log burst capacity.

[Rack]

Rack-specific runtime settings.

FieldTypeDefaultDescription
namestring"rack-default"Unique Name (Static Mode). If set, this Rack claims this specific identity.
name_prefixstring"node-"Ephemeral Prefix (Zero Config). Used if name is empty.
state_filestring"state.flux"Signed State Bundle (CBOR). Persists Identity, Config, and Secrets.
machine_iduint160Manual MachineID Override. (Advanced) Forces a specific ID, bypassing Registry assignment.
enrollment_timeoutstring"2s"Timeout for enrollment handshake.

[Store]

Data storage settings.

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

[Rack.bus]

NATS Bus settings.

FieldTypeDefaultDescription
urlstring"nats://localhost:4222"NATS Server URL.
domainstring"flux"JetStream Domain (Sovereignty). Must match Mixer cluster name for stream visibility.
stream_namestring"flux"NATS Stream (JetStream) name to publish to.
connect_timeoutstring"10s"Initial connection timeout for both Data and Telemetry buses.
reconnect_waitstring"1s"Wait time between reconnect attempts for all isolated bus connections.
convergence_delaystring"100ms"Safety delay to allow ephemeral NATS consumers to converge before starting gears.

Example

[logging]
level = "debug"
dir = "./logs"

[rack]
name = "rack-nyc-01"

[store]
dir = "/var/lib/fluxrig/data"

[rack.bus]
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.

[Mixer]

General Mixer identity and bootstrapping settings.

FieldTypeDefaultDescription
machine_iduint161Unique MachineID for this independent Control Plane node.
mixer_namestring"mixer-01"Human-readable identifier.
startup_scenariostring""Scenario reference to load on startup. Accepts a file path (./scenario.yaml), a stored URN (payment-flow:v1.0.0), or empty to resume the last active scenario.

[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.
cluster_namestring"flux"JetStream Domain Name (for Leaf Nodes).
store_dirstring"data/js"Path for NATS JetStream persistence.
stream_namestring"flux"Name of the primary JetStream stream.
stream_subjects[]string["flux.msg.>", "flux.gear.>", "flux.telemetry.>"]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)

[logging]
level = "debug"

[mixer]
mixer_name = "mixer-prod-01"
startup_scenario = "scenario_prod.yaml"

[api]
port = 8090

[store]
dir = "./data"
database_file = "fluxrig.duckdb"
cluster_key_file = "cluster.key"

[snake]
port = 4222
url = "nats://localhost:4222"
cluster_name = "flux"
store_dir = "data/js"

[Roadmap] Observability tiers

The platform is designed to support multiple observability tiers for various scales. In v0.4.5-dev+e5eff62, 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 fluxID (or fluxID in JSON) is the unique identifier...

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_idUINT64Sonyflake business ID
entity_idUINT64Unified EntityID ([Type:8][MachineID:16][Seq:40])
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_idUINT64Unified EntityID
entity_nameTEXTHuman-readable Hostname
flux_idUINT64Business flow ID
levelENUMdebug, info, warn, error
messageVARCHARLog message
attributesJSONStructured fields

Parquet Schema (Metrics):

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

Parquet Schema (fluxMsg / Data):

ColumnTypeDescription
tsTIMESTAMPMessage timestamp
trace_idVARCHARAssociated trace
flux_idUINT64Primary business ID
machine_idINTEGERNode ID
machine_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)


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 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 REST API.

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/logs?level=error&since=2025-12-21T00:00:00Z&limit=50"

Traces API

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

Query Parameters:

ParameterTypeDescription
flux_iduint64Filter by fluxID.
sinceRFC3339Start time.
min_duration_msintMinimum duration filter.
statusstringok or error.

Metrics API

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

Query Parameters:

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