Extractors
The extractors are the part of dfe-fetcher that runs external tools and takes their records, with no tick and no checkpoint behind them.
| Repo | hyperi-io/dfe-fetcher, crates/fetcher/src/extractor/ and crates/fetcher/src/ingest/ |
| Image and chart | ghcr.io/hyperi-io/dfe-fetcher, and the thin chart each release assembles from crates/fetcher/src/deployment.rs |
| Config reference | extractors and ingest in config.example.yaml. Every change needs a restart |
| Endpoints | Ingest HTTP on 8080 (POST /ingest/{source}, POST /ingest/{source}/{topic}), Vector gRPC on 6000. Both ship off |
| Metrics | dfe_fetcher_extractor_* and dfe_fetcher_ingest_* on :9090/metrics |
A container can reach the fetcher two ways: printing JSON lines to stdout, or posting JSON to the ingest server. Vector runs in a container or as a sidecar and pushes over its native gRPC protocol.
Figure 1. L4 Detail -- Extractors. The dashed box is outside DFE. Up: L3 Components -- dfe-fetcher. Down: L4 Detail -- Container extractor lifecycle.
How it works
A container extractor runs its tool in Docker or podman. A scheduled one runs every interval_secs and waits between runs. A continuous one starts at once and is restarted after it exits.
Figure 2. L4 Detail -- Container extractor lifecycle. Up: L4 Detail -- Extractors.
The backoff doubles up to 64 s, or up to max_restart_backoff_secs when that is lower. It resets once a run stays up for stable_after_secs. A container that exits more than max_restart_attempts times with no stable run between stops for good (0, the default, restarts it forever). No health check runs during a run: an extractor is judged by its container's exit.
The stdout reader and the ingest server hand each line or body to the sink as it came. The Vector receiver converts a push's events to JSON first. The sink stamps them as the Emitter page sets out.
Interfaces
The ingest server needs ingest.auth_token, and every /ingest call carries Authorization: Bearer <token>. With no token it won't start unless ingest.allow_unauthenticated: true is set. /livez and /readyz are exempt. /ingest/{source}/{topic} takes its topic from the URL, so an open listener lets anything that reaches the port write to any topic.
The Vector receiver speaks cleartext gRPC, so a proxy in front of it must speak h2c. A Vector push names no instance, so the listener it arrives on decides its topic. The shared extractors.vector.grpc_bind_address, the one port the chart publishes, takes at most one instance and lands on its topic, or on vector when none shares it. Every other instance names a separate grpc_bind_address. Two instances sharing a listener are refused at load.
Scaling and failure
What each mode guarantees its sender:
- Vector: With
extractors.vector.acknowledgements.enabled(the default), a push is answeredOKonce the outputs took its events or the DLQ confirmed them, andUNAVAILABLEotherwise. Vector's sink retries. A push still unanswered near its 25 s hold budget is answeredUNAVAILABLEtoo, so a slow output can duplicate but not lose. Disabled, a push is answered once queued and a crash loses it. Under memory pressure a push is refusedUNAVAILABLEbefore any work. - HTTP: With
ingest.acknowledgements.enabled(the default),/ingestanswers200once the outputs took the record or the DLQ confirmed it, and503otherwise, withRetry-Afteron backpressure. Disabled, it answers200at once and a failed delivery loses the record. - stdout: A pipe can't be read twice, so a line the outputs can't take is held and retried from 1 s up to 30 s. The container blocks on its writes meanwhile. A line with no output to go to, or still held at shutdown, is dropped and counted.
At shutdown the extractors deliver what they hold for up to 20 s before the outputs close. A scheduled container's timeout_secs bounds the whole run, stdout included. A Vector listener that can't bind at start-up fails the process, so the pod restarts rather than stay Ready with a dead intake.
Profile, container or Vector
A REST or JSON API becomes a profile, a database or files a sources.db or sources.file block, and anything else an extractor.
Figure 3. L4 Detail -- Choosing a mode for a source. Up: L4 Detail -- Extractors.
A profile that needs a signer, a lister, a row builder or a paging quirk adds a hook on the matching axis in crates/rest and stays a profile.
| Criterion | REST profile | Container | Vector |
|---|---|---|---|
| A plain REST or JSON API | Yes | - | - |
| A mature tool in another language does the job | - | Yes | - |
| Vector has a native source for it | - | - | Yes |
| Needs process isolation from the fetcher | - | Yes | - |
| Third-party maintained | - | Yes | Yes |
| Wanted: checkpoint after ack, the snapshot envelope, the memory brake | Yes | - | - |
| Source | Mode | Reason |
|---|---|---|
| AWS CloudTrail | Profile | JSON API signed with the sigv4 auth mode |
| Azure Activity Log | Profile | REST API paged by nextLink |
| M365 Audit Log | Profile | A prelude, a paged content list and a manifest per blob |
| runZero inventory | Profile | NDJSON exports as snapshot dumps |
| An inventory database | sources.db | A table dumped whole or tailed by key |
| Prometheus exporters | Container | A mature exporter run as a sidecar |
| Syslog collection | Vector | Vector has a native syslog source |
| Network captures | Container | Zeek or Suricata printing JSON lines |
A log file the fetcher can read is a sources.file tail unit, not a container. Filebeat has no HTTP output (its outputs), so Beats data goes to dfe-receiver's Lumberjack listener instead.
Key metrics
| Metric | Healthy when |
|---|---|
dfe_fetcher_active_extractors | Matches the extractors configured |
dfe_fetcher_extractor_runs_error_total | Flat. A rise is a container exiting non-zero |
dfe_fetcher_extractor_restart_exhausted_total | Zero. Any count is a container stopped for good |
dfe_fetcher_extractor_records_failed_total{extractor,outcome} | No dropped outcomes |
dfe_fetcher_ingest_requests_total | 503s stay rare |
Related
- Emitter, where the sink's batches go
- Source framework, the scheduled path for APIs, databases and files
- config.example.yaml, every extractor and ingest key