Features & Enable Order¶
Drakkar’s optional features depend on each other. This page is the map: which switch turns what on, what each feature silently needs, and the order to enable things in as a deployment grows from a minimal worker to a full-featured fleet.
Per-feature guides: Configuration · Config Reference · Observability · Cache · Input Sources · Webapp · Local Databases.
The switches¶
Every feature is optional. A worker can run its main loop only: no API, no UI, no recorder, no autodiscovery.
| Feature | Toggle | Default | What it controls |
|---|---|---|---|
| Metrics exporter | metrics.enabled |
on (:9090) |
Raw Prometheus endpoint on its own port |
| API server + probes | api.enabled |
on (:8080) |
The HTTP server: /healthz + /readyz and the peer route |
| Operator UI | ui.enabled |
on (same port) | The pages, the bundle fetch, /api/v1, /ws and the docs; needs api.enabled |
| Message probe endpoint | ui.probe.enabled |
on | POST /api/v1/debug/probe: runs caller bytes through the live handler and real executor pool; false = 403, independently of auth_token |
| Database merge endpoint | ui.merge_enabled |
on | POST /api/v1/debug/merge: writes a merged-<ts>-<token>.db into <storage.shared_dir>/merged/ per call, deleted after recorder.archive.merged_retention while archiving is on; false = 403, independently of auth_token |
| Merge result delete | ui.delete_enabled |
off | DELETE /api/v1/debug/files/{path}: deletes one merge result (merged/<name>.db) from the Databases view; nothing else can be deleted; false = 403, independently of auth_token |
| Kafka read API | ui.kafka_read_enabled |
on | GET /api/v1/debug/kafka/*: pipeline-invisible reads of the configured topics; false = 403, independently of auth_token |
| Consume pause | ui.consume_pause.enabled |
off | Timed Live-page pause of message intake (auto-resume); off because pausing is production-affecting |
| Detach | sources.kafka.detach.enabled |
off | The worker can leave its Kafka consumer group for a bounded time and join it again (handler detach() / attach()); needs autodiscover, which keeps the budget of detached workers |
| Operator detach | ui.detach_enabled |
off | POST /api/v1/debug/detach and /attach and the Detach control on the Live page; needs sources.kafka.detach.enabled; false = 403 |
| Flight recorder, memory store | recorder.enabled and ui.enabled |
on | Recent events in memory for the UI (recorder.memory.window) |
| Flight recorder, durable store | recorder.enabled, recorder.provider |
on, sqlite |
Event history in files in storage.dir (sqlite) or in a Postgres table (postgres) |
| Own storage | storage.dir |
/tmp/drakkar |
Where this worker’s event history, cache file and crash marker live |
| Recorder archiving | recorder.archive.enabled |
on (provider sqlite) |
Fold sealed recorder files into .db.gz window archives, for the whole cluster (with autodiscover and storage.shared_dir) or for this worker’s own files |
| Decoupled UI bundle | ui.release.enabled |
on | Fetch + serve the drakkar-ui SPA release; with no bundle cached the worker serves its JSON API and WebSocket without pages (page requests answer 503); ui.enabled: false turns the UI off |
| Prometheus panel + links | ui.prometheus.url |
off (empty) | Dashboard deep-links into a Prometheus instance |
| Autodiscover (registry + election) | autodiscover.enabled, autodiscover.provider |
off | Workers find each other and cluster-scope periodic tasks elect one runner; needs api.enabled; provider filesystem needs storage.shared_dir, the other providers need a connection |
| Cross-worker fleet view | autodiscover plus a storage.shared_dir every worker mounts |
n/a | The workers list, history trace over the cluster’s sealed files, cluster-wide database view |
| Handler cache | cache.enabled |
off | LWW key/value store for handler code |
| Cache exchange | cache.exchange.enabled |
on (needs the cache and autodiscover) | Cross-worker cache convergence: each worker pulls the cluster/global rows of its autodiscover peers over HTTP |
| Offload pool | threads.offload |
null (derived) |
handler.offload(): CPU-bound hook work off the event loop; always available, the knob only sizes it |
| Blocking-I/O pool size | threads.io |
null (Python’s sizing) |
Size of asyncio’s default to_thread executor; null keeps min(32, cpu_count + 4): a knob, not a switch |
| Runtime health monitor | runtime_health.enabled |
on | Event-loop lag heartbeat, stall stack sampling, Runtime tab, runtime_health events |
| Kafka input source | sources.kafka.enabled |
off | Consumer group, poll loop, arrange(), offset commits |
| HTTP input source | sources.http.enabled |
off (:8090) |
POST, handler pipeline, JSON response |
| Aligned startup | sources.kafka.startup_align.enabled |
on | Fleet restarts converge on one rebalance |
| DLQ | dlq.enabled |
on | Failed messages written to a Kafka topic as DLQ records |
| Split | split.enabled |
off | A handler with split() cuts large messages into parts that every worker processes, and aggregate() puts the results together; needs sources.kafka.enabled and two topics that the operator creates |
Sources are not optional as a group: at least one input source must be
enabled. Both are off by default, so every worker states where its work
comes from. A config with neither fails to load
(no input source enabled: ...). See Input Sources.
Sinks are not a toggle either: at least one sink instance (of any type)
is required when results go to sinks, that is when the Kafka source is on
or sources.http.deliver_to_sinks is true. Such a worker with zero sinks fails
startup. An HTTP-only worker with deliver_to_sinks: false (the default)
answers each request with the handler’s response and needs no sink. The DLQ is built
whenever the Kafka source is on (topic {sources.kafka.topic}_dlq) or
dlq.topic is set, and the circuit breaker always wraps sink delivery.
Dependency rules (and what happens when they’re unmet)¶
Each rule names the failure mode so you can decide what your deployment needs. A rule that is a config check fails the load with a message that names the key to change.
- Probes need the API server.
/healthzand/readyzare served only by the API server.api.enabled: falsemeans no probe endpoints at all: Kubernetes liveness/readiness checks simply fail. The worker logs a warning at startup; under Kubernetes, keep the API enabled. The UI may be off (ui.enabled: false): the probes do not depend on it.ui.enabledandautodiscover.enabledneedapi.enabled, and the load fails when it is off. - The recorder and the UI are separate. The memory store exists to
serve the UI, so it needs
ui.enabled. A durable store needs onlyrecorder.enabled. With both off the worker records nothing. - A durable
sqliterecorder needs a writablestorage.dir. The worker creates it (mode0700) when it is missing. An emptystorage.dirwithrecorder.enabledand providersqlitefails the load; setrecorder.enabled: falseto keep recent events in memory only. With providerpostgres,storage.dirmay be empty. An emptystorage.diralso disables the OOM watchdog (<storage.dir>/<cluster>/<worker>/<worker>.watchdog). - The SPA bundle needs the UI.
ui.release.enabledfetches and serves the drakkar-ui release; a fetch failure is non-fatal, and release tags are immutable, so a bundle downloaded once serves from the shared cache on every later start, offline ones included. There is no HTML fallback in the package: with nothing cached the worker serves its JSON API and WebSocket without pages, and page requests answer 503 naming how to supply a bundle. For an air-gapped deployment, stage one withdrakkar-ui fetch --version=vX.Y.Zor pointui.release.repoat an internal mirror. - The workers list needs autodiscover; cross-tracing needs a SHARED
folder. Workers find each other through autodiscover.
It needs
autodiscover.providerandapi.enabledand, for thefilesystemprovider, astorage.shared_dirall workers see. Every worker seals its finished recorder files into<storage.shared_dir>/history/<cluster>/, and a history trace reads the sealed files there (see Local Databases); every worker must see the same shared folder (the mount path may differ: no file stores an absolute path). With autodiscover off each worker lists only itself. Setapi.public_urlper worker so the card and cross-links carry a reachable address instead of the bind IP. - The cache engine needs
storage.dirtoo. The cache file lives there, private to the worker; withstorage.dirempty the cache runs memory-only (WARNcache_engine_disabled_no_storage_dir) and the cache exchange turns itself off. - Cache exchange needs autodiscover and reachable API ports. A worker
pulls only the peers that autodiscover lists, at the
URL on each card. With autodiscover off the exchange does nothing and
the worker logs
cache_exchange_off_no_autodiscoveronce at startup. Every worker must also reach the API port of its peers: across hosts, bindapi.hostto a reachable address or setapi.public_url. The cache file itself is never shared. - The webapp needs handler support, checked at construction. A
worker with
sources.http.enabledand a handler that lacks the HTTP hooks (arrange_http_request+on_http_request_completeplus the 3rd/4th generic models) fails fast with aConfigurationError. A webapp bind failure at startup is fatal too: the webapp is an input source, so a worker that cannot bind its socket stops rather than run with nothing to read. An API-server bind failure is fatal as well. - The webapp’s dashboard tile needs the UI + recorder. The tile on the operator dashboard reads request counts from recorder events; UI off = no tile, recorder off = counts from the memory window only.
- The Prometheus panel needs
ui.prometheus.url. Unset = the dashboard links section is hidden. The optionalui.prometheus.worker_label/ui.prometheus.cluster_label/ui.custom_linkskeys refine it. - At least one source must be enabled.
sources.kafka.enabledandsources.http.enabledboth default tofalse; a config with neither fails to load withno input source enabled: set sources.kafka.enabled or sources.http.enabled. Handler validation follows the enabled sources:arrange()is required only with the Kafka source, the HTTP hooks only with the HTTP source. - The DLQ needs the Kafka source or an explicit
dlq.topic. The default DLQ topic is derived from the source topic, so a worker withsources.kafka.enabled: falseand an emptydlq.topicbuilds no DLQ producer at all. DLQ sends are then dropped, warned once, and counted indrakkar_dlq_unconfigured_drops_total. Setdlq.topicwhen an HTTP-only worker must not lose failed payloads (the rule). - Cluster-scope periodic tasks need autodiscover. A task declared
with
scope='cluster'and autodiscover off fails startup. - A consumer names a declared connection. The Kafka source, every
Kafka, Postgres, Mongo and Redis sink, the DLQ, the Postgres recorder and
the
consul,postgresandredisautodiscover providers read their service fromconnections.<kind>.<name>; a missing entry fails the load. - Detach needs autodiscover; its operator routes need the feature.
sources.kafka.detach.enabledwith the Kafka source on fails the load whenautodiscover.enabledis false, because the budget of detached workers is kept in the autodiscover store.ui.detach_enabledfails the load withoutsources.kafka.detach.enabled. See Detach.
Enable order: minimal to full-featured¶
Each tier only depends on the tiers before it. Start at 0, stop at the tier your deployment needs.
Tier 0: choose your sources, then a minimal pipeline¶
Start here: decide where work comes in. Everything below builds on that choice. This tier shows the Kafka source; for HTTP, or for both, see Input Sources.
connections:
kafka:
main:
brokers: kafka:9092
sources:
kafka:
enabled: true
topic: input-events
executor:
binary_path: /app/process
sinks:
kafka:
results:
topic: output-events
recorder:
enabled: false # no durable history
api:
enabled: false # NOTE: no /healthz or /readyz in this tier!
ui:
enabled: false
Kafka in, subprocesses, sinks out, metrics on :9090. Suitable for
one-off local runs; not for Kubernetes (rule 1).
Tier 1: operability (UI, probes, history)¶
api:
enabled: true # default
ui:
enabled: true # default
auth_token: "${UI_TOKEN}"
storage:
dir: /var/lib/drakkar
Adds the API server with /healthz + /readyz, the operator UI,
persistent event history, and the OOM watchdog. This is the sensible
production baseline.
Tier 2: the real UI + Prometheus links¶
ui:
release:
enabled: true # default: fetches the drakkar-ui SPA
prometheus:
url: "http://prometheus:9090"
api:
public_url: "http://worker-1.internal:8080"
The worker serves the versioned drakkar-ui SPA (shared per-host cache,
managed with the drakkar-ui CLI) and the dashboard gains Prometheus
deep-links.
Tier 3: fleet view (multi-worker)¶
storage:
shared_dir: /shared/drakkar # the same volume on EVERY worker (any mount path)
autodiscover:
enabled: true
provider: filesystem
cluster:
name: search-cluster
Workers discover each other, the UI’s worker switcher fills in, and tracing follows a message across workers. Any worker that implements the on-disk format can share the directory (spec).
Tier 4: handler cache + cache exchange¶
self.cache becomes persistent and converges across the cluster: each
worker pulls the cluster and global rows of the peers it finds through
the Tier 3 autodiscover, over HTTP, and merges them by last-write-wins (see
Cache exchange). The workers must reach each
other’s API port.
Tier 5: synchronous HTTP ingress¶
POST requests flow through the same handler pipeline with per-client
auth, rate limits, and the max_body cap. Requires the HTTP hooks
in your handler (rule 8). Turn sources.kafka.enabled off in the same
config and the worker serves HTTP only.
Quick sanity checklist¶
- Kubernetes?
api.enabled: true(rule 1), probes pointed at the API port. - More than one worker?
autodiscoveron, one shared folder on every worker (rule 5),api.public_urlset per worker. - Cache not syncing? Check that the peers appear in the workers list
(rule 7), that
drakkar_fleet_peer_requests_totalshowsokrequests (otherwise the API ports are not reachable at the card URLs), and that both workers are in the same cluster forcluster-scoped keys. - Token set and the UI shows other workers as unreachable? List every
worker origin in
ui.allowed_origins(Cross-origin reads). - Worker will not start with
no input source enabled? Turn onsources.kafka.enabled,sources.http.enabled, or both (rule 11). - HTTP-only worker losing failed payloads? Set
dlq.topic; the derived default needs a Kafka source (rule 12). - Air-gapped? Stage the bundle once with
drakkar-ui fetch --version=vX.Y.Zinto a cache the workers share, or pointui.release.repoat an internal mirror.ui.release.enabled: falsefetches nothing and substitutes nothing: the worker then serves its JSON API and WebSocket without pages.ui.enabled: falseturns the UI off.