Skip to main content

dfe-transform-vector architecture

dfe-transform-vector runs a Vector pipeline as a DFE transform stage, for the transforms beyond VRL's remap. A Rust supervisor is PID 1 and gives Vector what every DFE app has: one config, one ops port, health, metrics and restarts.

Figure 1. L3 Components -- dfe-transform-vector. The arrows between Bridge intake, Vector and Bridge return are the direct transport. On the bus Vector reads and writes Kafka itself. Up: L2 Services -- DFE deployment. Down: L4 Detail -- Config engine, L4 Detail -- Vector, L4 Detail -- Direct transport bridge.

How data flows​

  1. The Config engine turns the big-dial config and your transform files into a Vector config directory, wires the graph and runs vector validate.
  2. The Process manager spawns Vector on that directory, and restarts it after a crash.
  3. On the bus, Vector's kafka source reads <source>_land. On the direct transport, the Bridge intake takes Push calls on port 6000 and hands records to Vector over loopback.
  4. Vector runs the transforms.
  5. On the bus, Vector's kafka sink writes <source>_load. On direct, the Bridge return takes Vector's output and pushes it to the next stage.
  6. The Metrics merge scrapes Vector's exporter and serves its vector_* series beside the supervisor's, on one port and one OTLP push.

Components​

PartRolePage
Config engineBuilds and validates Vector's config, and reloads transformsinternals.md
Process managerSpawns Vector, forwards SIGTERM, restarts it with backoffvector.md
Metrics mergeServes Vector's metrics with the supervisor'svector.md
Bridge intakeTranslates scalo Transport/Push into Vector's PushEventsdirect-transport.md
VectorThe upstream binary, at the version VECTOR_VERSION pinsvector.md
Bridge returnTakes Vector's output and pushes it onwarddirect-transport.md

You write the transforms: and enrichment_tables: blocks. The supervisor generates the source, the sink and the observability config.

External dependencies​

DependencyNeeded forSwappable
KafkaThe bus transport, read and written by VectorAny broker source.brokers and sink.brokers reach. Direct needs none
A DFE service over gRPCThe direct sink, http://dfe-loader:6000 by defaultAny stage running a Push listener
Dead-letter queueRecords over the next hop's size ceilingdfe_transform_dlq on the bus, a file spool on direct
dfe-engineWriting a deployment per source configdfe-infra's apps.yaml declares the app, so the engine has no code for it

Deployment variants​

VariantWhat runs
Docker singleOn by default. One instance per source that binds a Vector transform
Kubernetes, every profileWhen a deployment asks for it. One deployment per source config, KEDA sets replicas

One Vector runs per pod, and replicas scale out. The released chart scales on CPU. dfe-infra's values add a pressure trigger in single, scale and mesh, but the gauge it reads stays 0 when Vector runs, so that trigger never scales a pod out and CPU does the scaling. Feeding it is tracked in https://github.com/hyperi-io/dfe-transform-vector/issues/117. Lag isn't a trigger, because it rises when a downstream stage breaks and more pods can't fix that.

The chart mounts the config and transform files, and an edit to either rolls the pods. Outside a chart, a transform change hot-reloads. reference/configuration.md has the config layers and what the chart fixes.

Design considerations​

Security. Vector runs whatever a transform file declares, with read access to the Kafka credentials. So a transform file may declare transforms (never lua) and enrichment_tables alone, and a table must resolve inside transforms.data_dir and outside every credential path. A transform can't read a file, reach the network or inflate a record: no transform may set file or files, and the VRL host, network, file and decompression functions are refused before Vector sees them. A failed validate is logged as the components and error codes alone, never the source Vector quotes. Credentials reach Vector as SECRET[...] file references, never as values in its config. Vector runs without the DFE_TRANSFORM_VECTOR_* variables.

Reliability. Delivery is at least once on both transports. A crashed Vector restarts on an exponential backoff capped at a minute, with no crash limit. A failed bridge leg stops the process, because its senders would otherwise retry forever against a live pod.

Operations. /readyz means Vector survived 500 ms after spawn and its sink isn't stalled. A pod with an unreachable broker and nothing held stays Ready. Vector's exporter on 9598 is a loopback debug surface, and 9090 is the scrape target.

Performance. Vector's buffers have no memory cap of their own, so the pod's limit has to cover Vector's worst case. For VRL alone, dfe-transform-vrl runs in-process with bounded buffers.

Why it's built this way​

A subprocess, not a library. Vector has no stable API for embedding. Running the upstream release binary makes a Vector upgrade a version bump and an image rebuild, not a rebuild against every Vector release.

One pin. VECTOR_VERSION in src/deployment.rs feeds the Dockerfile, the default vector.version and the contract. vector.version_check: strict stops a pod whose config and binary disagree.

Polling for reload. S3-backed mounts (s3fs, goofys, Mountpoint for S3) raise no filesystem events, so inotify would work on a laptop and silently stop reloading in production.

Wiring from labels. The config engine reads each transform's inputs and joins dfe_source to dfe_sink through them, so a transform author never hand-wires the topology.

Diagram map​

What's next​