Skip to main content

Configuration reference

The archiver reads two sets of settings from two cascades: the archiver's sections from its config file and the flat DFE_ARCHIVER_* variables, and scalo's runtime sections from scalo's cascade. Every key of the archiver's sections, with its type and default, is in config-schema.yaml, generated from Config.

The archiver's sections​

transport, kafka, grpc, archive, buffer, routing, compression and dlq resolve in this order, highest first:

  1. The flat DFE_ARCHIVER_* variables below. An empty value reads as unset.
  2. .env in the working directory, loaded into the environment without replacing a variable set before it.
  3. The config file: --config, else DFE_ARCHIVER_CONFIG, else the first of config.yaml, config/settings.yaml and /etc/dfe-archiver/config.yaml that exists.
  4. The defaults.

These sections take the flat names and no others. DFE_ARCHIVER_KAFKA__BROKERS reaches nothing, and neither does an unprefixed KAFKA_BROKERS or ARCHIVER_DESTINATION, with no warning. The file is read as written, so ${VAR} in it stays a literal string.

The running pipeline reads its config once, at startup. The reloader watches the config file and SIGHUP, and a change to any section but kafka.batch_size logs that it needs a restart. An idle archiver is the exception: the change that gives it a destination starts the pipeline (internals.md).

scalo's sections​

version_check, metrics, logger, self_regulation, scaling and memory belong to scalo's runtime, which reads them from scalo's cascade, highest first:

  1. The CLI flags.
  2. DFE_ARCHIVER_<SECTION>__<KEY>, so DFE_ARCHIVER_SCALING__ENABLED sets scaling.enabled. The flat DFE_ARCHIVER_MEMORY_* names below set the memory guard.
  3. settings.<env>.yaml, then settings.yaml with the --config file over it, then defaults.yaml, each looked for in the working directory, config/ and /config/. <env> is APP_ENV, ENVIRONMENT or ENV, and development when none is set.
  4. The defaults.

The archiver resolves its config file (--config, else DFE_ARCHIVER_CONFIG, else a default path) before scalo sets this cascade up, so the one file feeds both the archiver's sections and scalo's, however it was given.

Environment variables​

VariableSetsDefault
DFE_ARCHIVER_TRANSPORTtransport: kafka or grpckafka
DFE_ARCHIVER_GRPC_LISTENgrpc.listen, the Push listener's address0.0.0.0:6000
DFE_ARCHIVER_KAFKA_BROKERSkafka.brokers, comma-separatedlocalhost:9092
DFE_ARCHIVER_KAFKA_GROUP_IDkafka.group_iddfe-archiver
DFE_ARCHIVER_KAFKA_TOPICSkafka.topics, comma-separated. Empty discoversempty
DFE_ARCHIVER_KAFKA_TOPIC_INCLUDEkafka.topic_include, regexes a discovered topic must matchempty
DFE_ARCHIVER_KAFKA_TOPIC_EXCLUDEkafka.topic_exclude, regexes that drop a discovered topicscalo's list: Kafka's internal and _dlq topics
DFE_ARCHIVER_KAFKA_TOPIC_REFRESH_SECSkafka.topic_refresh_secs60
DFE_ARCHIVER_KAFKA_SECURITY_PROTOCOLkafka.security_protocolPLAINTEXT
DFE_ARCHIVER_KAFKA_SASL_MECHANISMkafka.sasl_mechanismnone, PLAIN when a user and password are set
DFE_ARCHIVER_KAFKA_SASL_USERkafka.sasl_usernamenone
DFE_ARCHIVER_KAFKA_SASL_PASSWORDkafka.sasl_passwordnone
DFE_ARCHIVER_KAFKA_SSL_CA_LOCATIONkafka.ssl_ca_locationnone
DFE_ARCHIVER_KAFKA_ALLOW_INSECURE_TRANSPORTkafka.allow_insecure_transport (true, 1 or yes)false
DFE_ARCHIVER_DLQ_ENABLEDdlq.enabled. Always off on grpctrue
DFE_ARCHIVER_DLQ_MODEdlq.mode: fan_out, file_only, kafka_only or cascade. Any other value warns and takes cascadecascade
DFE_ARCHIVER_DLQ_TOPICdlq.kafka.common_topic, one topic for every entrydfe_archiver_dlq
DFE_ARCHIVER_DESTINATIONarchive.destinationnone, so the archiver idles
DFE_ARCHIVER_PATH_TEMPLATEarchive.path_template{year}/{month}/{day}/{hour}
DFE_ARCHIVER_COMPRESSION_CODECcompression.codeczstd
DFE_ARCHIVER_FLUSH_BYTESbuffer.flush_bytes1048576
DFE_ARCHIVER_FLUSH_INTERVAL_SECSbuffer.flush_age_secs60
DFE_ARCHIVER_MULTIPART_CHUNK_SIZEarchive.multipart_chunk_size8388608
DFE_ARCHIVER_SPOOL_DIRbuffer.spool_dir/var/spool/dfe/archiver
DFE_ARCHIVER_S3_BUCKETarchive.s3.bucketthe destination URL's
DFE_ARCHIVER_S3_REGIONarchive.s3.regionthe AWS SDK's
DFE_ARCHIVER_S3_ACCESS_KEY_IDarchive.s3.access_key_idthe AWS credential chain
DFE_ARCHIVER_S3_SECRET_ACCESS_KEYarchive.s3.secret_access_keythe AWS credential chain
DFE_ARCHIVER_S3_ENDPOINTarchive.s3.endpointAWS
DFE_ARCHIVER_S3_ALLOW_HTTParchive.s3.allow_http (true, 1 or yes)false

The store SDKs read the AWS_*, GOOGLE_* and AZURE_* variables (internals.md).

scalo runtime variables​

VariableSetsDefault
DFE_ARCHIVER_CONFIGthe archiver's config file, when --config names nonenone
DFE_ARCHIVER_MEMORY_LIMIT_BYTESthe memory guard's limit. 0 reads it from the cgroup0
DFE_ARCHIVER_MEMORY_PRESSURE_THRESHOLDshare of the limit at which the guard reports pressure0.8
DFE_ARCHIVER_MEMORY_CGROUP_HEADROOMshare of the cgroup limit the guard takes as its limit0.85
DFE_ARCHIVER_SELF_REGULATION__ENABLEDfalse stops intake pausing under pressuretrue
DFE_ARCHIVER_SCALING__ENABLEDfalse holds scaling_pressure at 0true
DFE_ARCHIVER_SCALING__MEMORY_GATE_THRESHOLDscalo's memory gate, which nothing feeds in the archiver, so it changes nothing0.8
DFE_ARCHIVER_VERSION_CHECK__ENABLEDfalse stops the version check against releases.hyperi.iotrue
DFE_ARCHIVER_METRICS__ADDRESS, METRICS_ADDR, --metrics-addrthe metrics listener's address. The flag wins, then METRICS_ADDR0.0.0.0:9090
LOG_LEVEL, --log-levellog level. -v is debug, -q is errorinfo
LOG_FORMAT, --log-formatjson, text or autoauto
TOKIO_WORKER_THREADSTokio worker threads, never fewer than 2the CPUs available