Configure featuremeshd
This page lists every setting featuremeshd reads, and how hooks and views run under them. It covers loading definitions, consumer groups, replicas, leases and shutdown.
featuremeshd reads its registry connection from flags or environment variables, and everything else from one YAML file.
featuremeshd --registry-url https://api.featuremesh.com \
--registry-token "$FEATUREMESHD_REGISTRY_TOKEN" \
--config-path config.yaml Which sections apply
The Helm chart installs one service per release ( Choose what you run ). Each service reads the sections below.
| Section | serving | hooks |
|---|---|---|
| Flags and environment variables , The file , health , telemetry , Ports , Limits | yes | yes |
| serving : sources, HTTP | yes | yes |
| serving : gRPC and Arrow Flight | yes | off in the chart's example |
| serving.logging | yes, with loggers | yes, with loggers |
| serving.hooks , Loading definitions , Consumer groups , Consumer settings , Replicas and resources , Leases | no: keep serving.hooks.enabled off | yes |
| Shutdown | shutdown_grace, and the loggers' last rows | every step |
| proxy | no | no |
The HTTP proxy reads the flags and environment variables, health and proxy, and nothing of serving ( Deploy the HTTP proxy ).
Flags and environment variables
| Flag | Environment variable | Default | |
|---|---|---|---|
--registry-url | FEATUREMESHD_REGISTRY_URL | required | the registry featuremeshd syncs from |
--registry-token | FEATUREMESHD_REGISTRY_TOKEN | required | a project service-account token |
--config-path | FEATUREMESHD_CONFIG_PATH | none | the YAML file below. Without it, every service is disabled and featuremeshd serves nothing, with a WARN at start. The Helm chart mounts it at /etc/featuremeshd/config.yaml |
--log-level | FEATUREMESHD_LOG_LEVEL | info | |
FEATUREMESHD_LOG_FORMAT | the log format | ||
--data-dir | FEATUREMESHD_DATA_DIR | /tmp/featuremeshd | local working files |
FEATUREMESHD_MEMORY_LIMIT_MB | 1024 | the engine's memory pool, shared by serving calls, hook batches and view runs. The chart sets it from memoryLimitMb. Keep it under the container's memory limit. How to size it is in Size featuremeshd's memory | |
FEATUREMESHD_INSTANCE_ID | the host name | the instance's service.instance.id in telemetry | |
FEATUREMESHD_PROXY_ENVOY_LOG_LEVEL, FEATUREMESHD_PROXY_ENVOY_LOG_FORMAT | the HTTP proxy's logs ( Deploy the HTTP proxy ) |
At info, the start log lists the configuration file, each listener, and the first registry sync (registry sync OK). A failing sync logs a WARN once, then registry sync recovered.
The file
- Every section is disabled unless it says
enabled: true. ${VAR}and${VAR:-default}are expanded from the environment.- A file featuremeshd refuses stops it at start, with the error in its log.
- Durations are strings:
"60s","50ms","2m".
| Key | Default | |
|---|---|---|
shutdown_grace | "20s" | how long a stop on SIGTERM may take ( Shutdown ). Keep it under the pod's terminationGracePeriodSeconds, 30 in the chart |
serving | prepared statements, sources, loggers, hooks and views | |
health | the health endpoint | |
telemetry | traces, metrics and logs | |
proxy | the HTTP proxy |
serving
| Key | Default | |
|---|---|---|
serving.enabled | false | |
serving.sources.poll_interval | "60s" | the registry sync: definitions and usage. RECOMPILE SERVING runs one at once ( How a change loads ) |
serving.sources.reconcile_interval | "30s" | how often source connections are checked again |
serving.sources.reconcile_initial_delay | "10s" | the first check after start |
serving.sources.duckdb.path | none | an optional DuckDB file for local sources |
serving.http.enabled | true | POST /v1/featureql, POST /v1/query, GET /v1/health |
serving.http.address | 0.0.0.0:10090 in the examples | |
serving.http.path | /v1/featureql | |
serving.http.debug_endpoints | false | |
serving.grpc.enabled | true | featuremesh.serving.v1.QueryService ( Over gRPC ) |
serving.grpc.address | 0.0.0.0:10091 in the examples | |
serving.flight.enabled | the Arrow Flight server | |
serving.flight.address | 0.0.0.0:10093 in the examples | |
serving.flight.catalog.poll_interval | "60s" | how often the Flight catalog is read from the registry |
serving.test_controls | false | for test servers only. It allows statement.request_time on prepared calls and the TEST SERVING commands ( Test commands ). Keep it off in production ( Protect the port ) |
serving.logging
Limits shared by every logger . A sink's ROLL_SECONDS and ROLL_MB override roll_interval and roll_size_mb for its own files.
| Key | Default | |
|---|---|---|
queue_capacity | 10000 | calls waiting per logger. Beyond it, a call's rows are dropped and counted |
chunk_calls | 1024 | a chunk is written at this many calls… |
chunk_interval | "100ms" | …or this long after the last write |
roll_size_mb | 64 | a file is closed and uploaded at this size… |
roll_interval | "60s" | …or this age. file:// JSON lines roll hourly |
upload_attempts | 4 | per file, with backoff. Then its rows are dropped and counted |
serving.hooks
Hooks and materialized views. How they run under these keys is in the sections that follow the table.
serving:
hooks:
enabled: true # hooks and views; listed STOPPED otherwise
drain_every: 5s # a scheduled hook's drain period, unless it says EVERY
kafka: # librdkafka properties added to every consumer
max.poll.interval.ms: "600000" | Key | Default | |
|---|---|---|
enabled | false | hooks and views run. Off, they are listed STOPPED |
batch_max_records | 500 | a batch holds this many records at most… |
batch_max_wait | "50ms" | …or what arrived this long after its first record |
poison_after | "2m" | from a batch's or drain's first failed attempt: calls still failing on a source, while others succeed, become data errors ( Failures in a batch ). Raising it costs time, since one bad key then holds the others longer ( A store answers for some keys only ) |
retry_backoff | "200ms" | between attempts of a failing batch or drain, doubled… |
retry_max_backoff | "30s" | …up to this |
retention_sweep_every | "60s" | how often table-sink rows older than their RETENTION are deleted |
recent_writes | 1000 | the writes, deletions and errors SHOW SERVING WRITES keeps, values included. 0 keeps none, so no value stays in memory |
kafka | {} | librdkafka properties added to every consumer, values as strings. Reserved keys are refused ( Consumer settings ) |
kafka_group_prefix | "" | prepended to every hook's consumer group ( Consumer groups ) |
drain_every | "5s" | a scheduled hook's drain period, unless it declares EVERY. The first drain runs one period after start |
drain_batch_max | 1000 | the due entries one drain batch runs at most. A backlog is drained in successive batches ( Size drain batches ) |
drain_lease | "30s" | a drainer's lease on its queue. A hook whose EVERY is longer than half of it holds its lease for twice its EVERY. Renewed a third of the way to expiry while a drain runs ( Leases ) |
Loading definitions
- At recompile or sync. featuremeshd loads the streams, sinks, hooks and views at
RECOMPILE SERVING, or at its next registry sync. How a change reaches each replica is in How a change loads . - A failed sync keeps what runs. A sync that fails, or a registry that does not answer, keeps every hook and view running as loaded.
- A refused configuration stops featuremeshd. A configuration it refuses, a reserved
kafkakey for instance, stops it at start, with the error in its log. There is no status row for it. - Off by default. With
serving.hooks.enabledoff, hooks and views are listedSTOPPED. That is right on a serving pod.
Consumer groups
- The group is the hook's name,
FM.SHOP.ON_PAYMENT, behindkafka_group_prefixwhen it is set. Grant it in your broker's ACLs, and read its lag with your usual tools. - One prefix per environment. Two registries or environments whose hooks share a name and a broker share a group. Each then takes part of the other's partitions.
kafka_group_prefix: "staging."makes the groupstaging.FM.SHOP.ON_PAYMENT, so one definition is promoted unchanged. Changing the prefix starts a new group, fromSTART. - Offsets are committed per batch, after the batch is written ( At least once ).
- A recompile keeps the group. When
RECOMPILE SERVINGchanges a hook, its consumer restarts and resumes from the group's committed offsets.STARTapplies only to partitions the group never committed. - Replicas switch one by one. Each replica loads a changed hook at its own sync. Until all have, the old and new definitions run side by side, each on the partitions it holds.
- A stalled hook keeps the group. While a batch waits on a sink or a queue, the consumer pauses its partitions and keeps polling, so it stays in its consumer group. Once the batch is written, it resumes from the records it set aside. What to do about a stalled hook is in Monitor and recover .
- A long step loses the partitions. A poll does not interrupt one step of a batch, computing or writing it. A step longer than the consumer's
max.poll.interval.ms(librdkafka's default, 5 minutes) makes Kafka give its partitions to another member, and they are read again. - A dropped hook's offsets last as long as the broker keeps them. To stop a hook, drop it, and create it again later. An empty group's offsets are deleted after the broker's
offsets.retention.minutes(7 days by default). A hook created again after that appliesSTARTagain, and'latest'skips what was produced in between. - One runner per hook. Do not run a featuremeshd and a Python process on the same hook. Both would write the same keys, each with its own offsets.
Consumer settings
A consumer's settings, in the order applied:
| From | Sets |
|---|---|
| FeatureMesh | bootstrap.servers (the hosts of the stream's kafka:// URL), group.id (kafka_group_prefix then the hook's name), client.id (featuremeshd-<hook>), enable.auto.commit=false, enable.auto.offset.store=false, auto.offset.reset=earliest (START decides for a new partition), enable.partition.eof=false |
the kafka map | any other librdkafka property, the same for every consumer, values as strings |
the stream's WITH | its security properties (SECURITY_PROTOCOL, SASL_MECHANISM, USERNAME, PASSWORD, SSL_*), per stream, over the map's |
- Reserved keys. Delivery rests on
group.id,enable.auto.commit,enable.auto.offset.store,auto.offset.resetandenable.partition.eof. Akafkamap that sets one is refused when featuremeshd loads its configuration, with the key named. - Other keys win over FeatureMesh's. A
bootstrap.serversorclient.idin the map applies to every hook's consumer, whatever its stream's URL says, so leave them out.
Replicas and resources
- Replicas share the work. Several featuremeshd with hooks enabled share each hook's consumer group, and Kafka spreads the partitions between them. A topic's partition count caps the replicas reading it. Past it, a replica holds no partition of that hook, though it can still drain queues and run views. A queue is drained by one of them at a time, under a lease ( Leases ).
- Hooks share the process they run in. They run on its runtime and read sources through its connections. Hot sinks have their own connections. On a featuremeshd that also serves, a backlog competes with serving calls, so deploy hooks on their own pods ( Deploy the hooks pods ).
- Memory is shared by serving calls, hook batches and view runs. How to size it is in Size featuremeshd's memory .
- Every hook runs everywhere. Every featuremeshd with hooks enabled runs every hook and view of its registry. There is no subset per deployment, and no pause for one hook ( Limits ).
- Rolling upgrades are in Upgrade featuremeshd .
Leases
Queues
- A queue has one drainer. A queue is drained by one replica at a time, under a lease in the queue's store. A drainer that dies leaves its entries queued, and the next holder runs them once the lease expires.
- Length. A drainer takes or renews its queue's lease at the start of each drain batch, for
drain_leaseor twice the hook'sEVERY, whichever is longer. It renews it every third of that while the batch runs, so a batch longer than the lease keeps it. - A lost lease writes nothing to the queue. When another replica took the lease, the old drainer's fenced writes are refused, counted by
featuremeshd.hooks.queue.lease_lost. Sinks outside the queue's database may have been written, and the fence keeps the newer value when the next holder runs the entry again. - In
SHOW SERVING STATUS. A queue'slease_holdernames the featuremeshd holding the lease, andlease_numberthe lease's number.last_checkis this featuremeshd's last look at the queue. It holds the drains it ran,busy(truewhen another one held the lease) and how long it took.lease_lostcounts this one's drains another took over ( A hook's details ). - Fences check the holder, not the clock. They compare the holder and the lease's number, not its expiry. A lone drainer whose lease expired, with no other replica to take it, still deletes its entries.
Views
A view's lease lives in the registry. It lasts 60 seconds, renewed every 20 while the run goes on. A run's number, its slot and its attempts are in Materialized views .
- A held lease. A featuremeshd that finds the lease held looks again 60 seconds later, while that slot is still the latest due. When the holder has landed it, the slot is done. When the holder died, its lease has expired and this one runs it. Once a newer slot is due, the older one is skipped.
- A start. A featuremeshd that starts runs the latest due slot the lease does not record as landed.
- A registry that does not answer. The lease request is retried with the same backoff until it gets an answer or the next slot is due, and the view is
STALLEDmeanwhile. A slot is lost only when the registry is down for the whole period. Another replica holding the lease is not retried this way, since that replica runs the slot. - Any replica can win it. Any featuremeshd with hooks enabled can win any view's lease, and a larger pod does not pin a view. Each one needs the memory of the largest view run ( View memory ).
Shutdown
On SIGTERM, featuremeshd stops within shutdown_grace (20 seconds by default, a top-level key of the file ), in this order:
- Consumers stop polling. Each finishes the stream batch it runs, chained hooks included, and commits its offsets.
- Each drainer finishes the drain batch it runs, and stops before the next one.
- A view run in progress is abandoned. It runs again at its next slot, at a
RECOMPUTE, or on the replica that takes its lease. - The queue and view leases this featuremeshd holds are released, so another replica drains and runs at once.
- The loggers write the rows they hold, the hooks' last calls included.
What still runs when shutdown_grace ends is abandoned as in a crash. A batch not committed is read again by the replica that takes its partitions. A drain's entries stay queued. A lease not released expires.
Keep shutdown_grace under the pod's terminationGracePeriodSeconds, which the chart sets to 30. A batch or drain that can take longer needs both raised.
health
| Key | Default | |
|---|---|---|
health.enabled | false | GET <path> answers {"status":"healthy"} on its own port while the process runs. What it checks is in Health is liveness only |
health.address | 0.0.0.0:10094 in the examples | |
health.path | /health |
telemetry
| Key | Default | |
|---|---|---|
telemetry.service_name | featuremeshd | |
telemetry.resource_attributes | none | added to every signal |
telemetry.exporters.otlp.enabled | false | the shared exporter, for traces, metrics and logs that set none of their own |
telemetry.exporters.otlp.endpoint | http://localhost:4317 | |
telemetry.exporters.otlp.protocol | grpc | or http |
telemetry.exporters.otlp.timeout | 60s | |
telemetry.exporters.otlp.batch_export | scheduled_delay 5 s, max_queue_size 2048, max_export_batch_size 512, max_concurrent_exports 1 | |
telemetry.tracing.enabled | true | |
telemetry.tracing.sampling | 0.15 | the share of traces kept |
telemetry.tracing.parent_based_sampler | follows the caller's sampling decision | |
telemetry.tracing.collect.* | 128 | limits on attributes, events and links per span |
telemetry.tracing.propagation | trace_context, aws_xray | |
telemetry.tracing.exporters | the shared exporters | |
telemetry.metrics.exporters, telemetry.logs.exporters | the shared exporters | the metrics are in featuremeshd metrics |
proxy
The proxy section, its keys and its log variables are in Deploy the HTTP proxy .
Ports
| Port | Serves |
|---|---|
| 10080, 10443 | the HTTP proxy, HTTP and HTTPS listeners |
| 10090 | serving over HTTP, control commands included |
| 10091 | serving over gRPC |
| 10093 | Arrow Flight |
| 10094 | health |
Example
A serving deployment's file is in Deploy the serving pods , and a hooks deployment's in Deploy the hooks pods . Each is the config block of the chart's values file. Outside Kubernetes, give the same block to featuremeshd as its file.
Limits
What a featuremeshd deployment does not do in this version, each with its workaround. The limits of hooks and views themselves are in Precomputing features and Materialized views .
| Limit | Workaround |
|---|---|
featuremeshd's HTTP port checks no token. Anyone who reaches port 10090 can call any statement, read the keys and values SHOW SERVING WRITES keeps, recompile, and recompute a view, which rewrites its sinks. A serving pod answers the same SHOW and RECOMPILE commands as a hooks pod | Keep the port inside your network, behind a policy that admits only the clients that need it. With personal data in values, set recent_writes: 0 ( Protect the port ). Permissions come in a later version |
| One set of hooks per deployment. Every featuremeshd with hooks enabled runs every hook and view of its registry. There is no subset per deployment, and no pause for one hook | To stop a hook, drop it. Its group keeps its offsets ( Consumer groups ). To keep hooks off a deployment, leave serving.hooks.enabled off there |
| Any featuremeshd with hooks enabled can win any view's lease, and a larger pod does not pin a view | Give each one the memory of the largest view's run, beside its hooks ( View memory ) |
Related
- Deploy featuremeshd : the chart's values files that hold this configuration.
- Status and writes :
SHOW SERVING STATUSand the counters. - Delivery and failures : batches, the fence, failures.